From 1624240a958e1e30e0fda1ee45a33c786f763369 Mon Sep 17 00:00:00 2001 From: chin Date: Fri, 28 Jan 2022 00:26:21 +0800 Subject: [PATCH] fix: error of `eslint` rules - comma-dangle - semi - no-async-promise-executor --- .eslintrc | 19 + API_Generator.js | 820 ------ .../DataTypesSummary.js | 4 +- .../resourceGenerator.js | 28 +- api/FHIR/Patient/controller/deletePatient.js | 2 +- api/FHIR/Patient/controller/getPatient.js | 224 +- .../Patient/controller/getPatientHistory.js | 2 +- .../controller/getPatientHistoryById.js | 2 +- api/FHIR/Patient/controller/postPatient.js | 2 +- .../Patient/controller/postPatientValidate.js | 2 +- api/FHIR/Patient/controller/putPatient.js | 2 +- api/FHIRApiService/$validate.js | 26 +- api/FHIRApiService/delete.js | 8 +- api/FHIRApiService/history.js | 4 +- api/FHIRApiService/read.js | 4 +- api/FHIRApiService/search.js | 4 +- api/FHIRApiService/update.js | 62 +- api/FHIRApiService/validateContained.js | 10 +- api/FHIRApiService/vread.js | 4 +- api/apiService.js | 12 +- api/user/controller/deleteToken.js | 4 +- api/user/controller/getIssuedToken.js | 8 +- api/user/controller/getLoginStatus.js | 2 +- api/user/controller/postRefreshToken.js | 2 +- api/user/controller/postTokenIssue.js | 2 +- api/user/index.js | 2 +- api/user/service/refreshTokenService.js | 6 +- api/user/service/tokenIssueService.js | 4 +- api/validator.js | 4 +- api_generator/API_Generator_V2.js | 42 +- api_generator/history_model_Generator.js | 20 +- api_generator/parameterHandler.js | 181 +- .../searchParametersCodeGenerator.js | 5 +- config/config.template.js | 2 +- models/FHIR/func.js | 4 +- models/FHIR/httpMessage.js | 4 +- models/FHIR/queryBuild.js | 85 +- models/FHIR/resourceType.js | 2 +- .../FHIRDataTypesSchema/base64Binary.js | 2 +- models/mongodb/FHIRDataTypesSchema/boolean.js | 2 +- .../mongodb/FHIRDataTypesSchema/canonical.js | 2 +- models/mongodb/FHIRDataTypesSchema/code.js | 2 +- models/mongodb/FHIRDataTypesSchema/date.js | 2 +- .../mongodb/FHIRDataTypesSchema/dateTime.js | 2 +- models/mongodb/FHIRDataTypesSchema/decimal.js | 2 +- models/mongodb/FHIRDataTypesSchema/id.js | 2 +- models/mongodb/FHIRDataTypesSchema/instant.js | 4 +- models/mongodb/FHIRDataTypesSchema/integer.js | 2 +- .../mongodb/FHIRDataTypesSchema/markdown.js | 2 +- models/mongodb/FHIRDataTypesSchema/oid.js | 2 +- .../FHIRDataTypesSchema/positiveInt.js | 2 +- models/mongodb/FHIRDataTypesSchema/string.js | 2 +- models/mongodb/FHIRDataTypesSchema/time.js | 2 +- .../FHIRDataTypesSchema/unsignedInt.js | 2 +- models/mongodb/FHIRDataTypesSchema/uri.js | 2 +- models/mongodb/FHIRDataTypesSchema/url.js | 2 +- models/mongodb/FHIRDataTypesSchema/uuid.js | 2 +- models/mongodb/FHIRDataTypesSchema/xhtml.js | 2 +- models/mongodb/FHIRTypeSchema/Bundle.js | 4 +- models/mongodb/connector.js | 8 +- models/mongodb/model/Patient.js | 8 +- models/mongodb/model/Patient_history.js | 16 +- models/mongodb/staticModel/FHIRStoredID.js | 2 +- models/mongodb/staticModel/issuedToken.js | 4 +- models/user/passport.js | 4 +- package-lock.json | 2221 ++++++++++++++++- package.json | 6 +- routes.js | 2 +- server.js | 2 +- web/index/index.js | 5 +- 70 files changed, 2612 insertions(+), 1332 deletions(-) create mode 100644 .eslintrc delete mode 100644 API_Generator.js diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..51173c5b --- /dev/null +++ b/.eslintrc @@ -0,0 +1,19 @@ +{ + "parserOptions": { + "ecmaVersion": 2018 + }, + "env": { + "browser": true, + "node": true, + "es6": true + }, + "extends": ["eslint:recommended"], + "rules": { + "semi": ["error", "always"], + "comma-dangle": ["error", "never"], + "no-unused-vars": "off", + "no-console": 0 , + "no-useless-escape": "off" + }, + "ignorePatterns": ["public/**", "temp/**", "models/FHIR/fhir/**"] +} \ No newline at end of file diff --git a/API_Generator.js b/API_Generator.js deleted file mode 100644 index 3a5a47a6..00000000 --- a/API_Generator.js +++ /dev/null @@ -1,820 +0,0 @@ -const fhirgen = require('./FHIR-mongoose-Models-Generator/resourceGenerator'); -const fs =require('fs'); -const mkdirp = require('mkdirp'); -const beautify = require('js-beautify').js; -const _ = require('lodash'); -require('dotenv').config(); - -function getDeepKeys(obj) { - var keys = []; - for(var key in obj) { - keys.push(key); - if(typeof obj[key] === "object") { - var subkeys = getDeepKeys(obj[key]); - keys = keys.concat(subkeys.map(function(subkey) { - return key + "." + subkey; - })); - } - } - return keys; -} - -const tokenDataTypes = [ - { - dataType : "Coding" , - uri : "" , - code : "code" - } , - { - dataType : "CodeableConcept" , - uri : "coding.system" , - code : "coding.code" - } , - { - dataType : "ContactPoint" , - uri : "" , - code : "value" - } , - { - dataType : "Identifier" , - uri : "" , - code : "value" - } , - { - dataType : "code" , - uri : "" , - code : "" - } , - { - dataType : "string" , - uri : "" , - code : "" - } , - { - dataType : "boolean" , - uri : "" , - code : "" - } -]; - -const datePrimitiveType = ['instant' ,'time' , 'dateTime' , 'date']; - -const genParamFunc = { - "string" : (param , field , schema={}) => { - let txt = ""; - let searchFields = field.split("|"); - for (let searchField of searchFields) { - let [resource] = searchField.split('.'); - let fieldInResource = searchField.replace(`${resource}.` , ""); - fieldInResource = fieldInResource.trim(); - if (param.includes ('address')) { - txt += ` - paramsSearch["${param}"] = (query) => { - let buildResult = queryBuild.addressQuery(query["${param}"] ,"${fieldInResource}"); - query.$and.push(buildResult); - delete query[${param}]; - } - `; - } else if (param == "name") { - txt+= ` - paramsSearch["name"] = (query) => { - if (!_.isArray(query["name"])) { - query["name"] = [query["name"]] - } - for (let item of query["name"]) { - let buildResult = queryBuild.nameQuery(item , "name"); - query.$and.push(buildResult); - } - delete query['name']; - } - ` - } else { - txt += ` - paramsSearch["${param}"] = (query) => { - queryBuild.arrayStringBuild(query ,"${param}" , "${fieldInResource}" , ["${param}"]); - } - ` - } - } - return txt; - } , - "token" : (param , field , schema={}) => { - let txt = ""; - let searchFields = field.split("|"); - for (let searchField of searchFields) { - let [resource] = searchField.split('.'); - let fieldInResource = searchField.replace(`${resource}.` , ""); - fieldInResource = fieldInResource.trim(); - if (param == "phone") { - txt+=` - paramsSearch["phone"] = (query) => { - let buildResult =queryBuild.tokenQuery(query["phone"] , "value" , "telecom" , "phone"); - for (let i in buildResult) { - query.$and.push({ - [i] : buildResult[i] - }); - } - delete query['phone']; - } - ` - } else if (param == "email") { - txt+=` - paramsSearch["email"] = (query) => { - let buildResult =queryBuild.tokenQuery(query["email"] , "value" , "telecom" , "email"); - for (let i in buildResult) { - query.$and.push({ - [i] : buildResult[i] - }); - } - delete query['email']; - } - ` - } else if (param =="identifier") { - txt+=` - paramsSearch["identifier"] = (query) => { - let buildResult = queryBuild.tokenQuery(query["identifier"] , "value" , "identifier" ,""); - for (let i in buildResult) { - query.$and.push({ - [i] : buildResult[i] - }); - } - delete query['identifier']; - } - ` - } else { - let deepKeys = getDeepKeys(_.cloneDeep(schema)); - if (/\(.*\)/.test(fieldInResource)) { - fieldInResource = fieldInResource.substr(0 , fieldInResource.indexOf(".")); - } - let typePath = deepKeys.filter(v=> { - let fieldNamePath = fieldInResource.split("."); - return fieldNamePath.every(item => v.includes(item) && v.includes("type")) - }); - typePath = typePath.reduce(function (a , b){ - return a.length < b.length ? a : b - }) - let typeOfField = _.get(schema , typePath); - if (typeOfField == "object") { - let propertiesOfField = _.get(schema , typePath.replace(".type" , ".properties")); - let propertiesKeysLength =Object.keys(propertiesOfField).length; - if (propertiesKeysLength == 3) { - typeOfField = "CodeableConcept" - } else if (propertiesKeysLength == 5) { - typeOfField = "Coding" - } else { - typeOfField = "Identifier" - } - } - let hitToken = tokenDataTypes.find(v=> v.dataType == typeOfField); - if (hitToken) { - let isCodeableConcept = hitToken.dataType == "CodeableConcept"; - txt+=` - paramsSearch["${param}"] = (query) => { - let buildResult = queryBuild.tokenQuery(query["${param}"] , "${hitToken.code}" , "${fieldInResource}" ,"" , ${isCodeableConcept}); - for (let i in buildResult) { - query.$and.push({ - [i] : buildResult[i] - }); - } - delete query['${param}']; - } - `; - } else { - txt+=` - paramsSearch["${param}"] = (query) => { - let buildResult = queryBuild.tokenQuery(query["${param}"] , "" , "${fieldInResource}" ,"" , false); - for (let i in buildResult) { - query.$and.push({ - [i] : buildResult[i] - }); - } - delete query['${param}']; - } - `; - } - } - } - return txt; - } , - "number" : (param , field , schema={}) => { - let txt = ""; - let searchFields = field.split("|"); - for (let searchField of searchFields) { - let [resource] = searchField.split('.'); - let fieldInResource = searchField.replace(`${resource}.` , ""); - fieldInResource = fieldInResource.trim(); - txt += ` - paramsSearch["${param}"] = (query) => { - let buildResult = numberQuery(item , "${field}"); - query.$and.push({ - "${fieldInResource}": buildResult - }); - delete query["${field}"]; - } - } - ` - } - return txt; - } , - "date" : (param , field , schema={}) => { - let txt = ""; - let searchFields = field.split("|"); - for (let searchField of searchFields) { - let [resource] = searchField.split('.'); - let fieldInResource = searchField.replace(`${resource}.` , ""); - fieldInResource = fieldInResource.trim(); - if (!fieldInResource.includes(")")) { - txt += ` - paramsSearch["${param}"] = (query) => { - if (!_.isArray(query["${param}"])) { - query["${param}"] = [query["${param}"]] - } - for (let i in query["${param}"]) { - let buildResult = queryBuild.dateQuery(query["${param}"][i] , "${fieldInResource}"); - if (!buildResult) { - errorMessage = handleError.processing(\`invalid date: \${query["${param}"]}\`) - throw new Error(errorMessage); - } - query.$and.push(buildResult); - } - delete query["${param}"]; - } - ` - } else { - console.log("date insteadof:" , fieldInResource); - fieldInResource = fieldInResource.substr(0 , fieldInResource.indexOf(" as")).replace(/[\(\)]/gm , ""); - let resourceFields = Object.keys(schema.properties); - let hitTokenFields = resourceFields.filter(v=> v.includes(fieldInResource)); - for(let field of hitTokenFields) { - let hitDate= datePrimitiveType.includes(schema.properties[field].type); - console.log(schema.properties[field].type); - console.log(hitDate); - if (hitDate) { - console.log(field); - } - } - } - } - return txt; - } , - "reference" : (param , field , schema={}) => { - let txt = ""; - let searchFields = field.split("|"); - for (let searchField of searchFields) { - let [resource] = searchField.split('.'); - let fieldInResource = searchField.replace(`${resource}.` , ""); - fieldInResource = fieldInResource.trim(); - if (fieldInResource.includes("where")) { - let lastIndexFieldInField = fieldInResource.lastIndexOf("."); - fieldInResource = fieldInResource.substring(0 , lastIndexFieldInField) + ".reference"; - } else { - fieldInResource = fieldInResource + ".reference"; - } - txt += ` - paramsSearch["${param}"] = (query) => { - let buildResult = queryBuild.referenceQuery(query["${param}"] , "${fieldInResource}"); - for (let i in buildResult) { - query.$and.push({ - [i] : buildResult[i] - }); - } - delete query["${param}"]; - } - ` - } - return txt; - } -} - - -/** - * - * @param {Object} option - * @param {Array} option.resources the resources want to use - */ -function generateAPI(option) { - for (let res of option.resources) { - fhirgen(res, {resourcePath : "./models/mongodb/model" , typePath: "./models/mongodb/FHIRTypeSchema"}); - } - - for (let res of option.resources) { - mkdirp.sync(`./api/FHIR/${res}/controller`); - - //#region search - let get = ` - const _ = require('lodash'); - const mongodb = require('models/mongodb'); - const {createBundle} = require('models/FHIR/func'); - const queryBuild = require('models/FHIR/queryBuild.js'); - const {handleError} = require('models/FHIR/httpMessage'); - - module.exports = async function (req, res) { - let queryParameter = _.cloneDeep(req.query); - let paginationSkip = queryParameter['_offset'] == undefined ? 0 : queryParameter['_offset']; - let paginationLimit = queryParameter['_count'] == undefined ? 100 : queryParameter['_count']; - _.set(req.query , "_offset" ,paginationSkip); - _.set(req.query , "_count" , paginationLimit); - let realLimit = paginationLimit+ paginationSkip; - delete queryParameter['_count']; - delete queryParameter['_offset']; - Object.keys(queryParameter).forEach(key => { - if (!queryParameter[key] || _.isObject(queryParameter[key])) { - delete queryParameter[key]; - } - }); - queryParameter.$and = []; - for (let key in queryParameter) { - try { - paramsSearch[key](queryParameter); - } catch (e) { - if (key != "$and") { - console.error(e); - return res.status(400).send(handleError.processing(\`Unknown search parameter \${key} or value \${queryParameter[key]}\`)) - } - } - } - if (queryParameter.$and.length == 0) { - delete queryParameter["$and"]; - } - try { - let docs = await mongodb.${res}.find(queryParameter). - limit(realLimit). - skip(paginationSkip). - sort({_id : -1 }). - exec(); - docs = docs.map(v=> { - return v.getFHIRField(); - }); - let count = await mongodb.${res}.countDocuments(queryParameter); - let bundle = createBundle(req , docs , count , paginationSkip , paginationLimit , "${res}"); - return res.status(200).json(bundle); - } catch (e) { - console.log('api api/fhir/${res}/ has error, ', e) - return res.status(500).json(handleError.exception(e)); - } - }; - - const paramsSearch = { - "_id" : (query) => { - query.$and.push({ - id : query["_id"] - }); - delete query["_id"]; - } - }` - - let searchParameter = fs.readFileSync('./FHIRParametersClean.json' , 'utf-8'); - searchParameter = JSON.parse(searchParameter); - let resSearchParams = searchParameter[res]; - let mongodb = require('./models/mongodb'); - //console.log(res); - let resJsonSchema = mongodb[res].jsonSchema(); - for (let key in resSearchParams) { - let paramObj = resSearchParams[key]; - let param = paramObj["parameter"]; - let type = paramObj["type"]; - let field = paramObj["field"]; - try { - let searchFuncTxt = genParamFunc[type](param , field , resJsonSchema); - get+= beautify(searchFuncTxt); - } catch (e) { - if (e.message.includes("not a function")) { - console.log(type); - console.error(e); - } - } - } - //#endregion - - //#region getById - const getById = ` - const mongodb = require('models/mongodb'); - const {handleError} = require('../../../../models/FHIR/httpMessage'); - module.exports = async function (req, res) { - let id = req.params.id; - try { - let docs = await mongodb.${res}.findOne({id : id}).exec(); - if (docs) { - return res.status(200).json(docs.getFHIRField()); - } - let errorMessage = \`not found ${res}/\${id}\`; - return res.status(404).json(handleError["not-found"](errorMessage)); - } catch (e) { - console.log('api api/fhir/${res}/:id has error, ', e) - return res.status(500).json(handleError.exception('server has something error')); - } - }; - ` - //#endregion - - //#region getHistory - const getHistory = ` - const _ = require('lodash'); - const mongodb = require('models/mongodb'); - const { - createBundle - } = require('models/FHIR/func'); - const queryBuild = require('models/FHIR/queryBuild.js'); - - module.exports = async function(req, res) { - let queryParameter = _.cloneDeep(req.query); - let id = req.params.id; - let paginationSkip = queryParameter['_offset'] == undefined ? 0 : queryParameter['_offset']; - let paginationLimit = queryParameter['_count'] == undefined ? 100 : queryParameter['_count']; - _.set(req.query, "_offset", paginationSkip); - _.set(req.query, "_count", paginationLimit); - let realLimit = paginationLimit + paginationSkip; - delete queryParameter['_count']; - delete queryParameter['_offset']; - try { - let docs = await mongodb.${res}_history.find({ id : id}). - limit(realLimit). - skip(paginationSkip). - sort({_id : -1 }). - exec(); - docs = docs.map(v => { - return v.getFHIRBundleField(); - }); - let count = await mongodb.${res}_history.countDocuments({ id : id }); - let bundle = createBundle(req, docs, count, paginationSkip, paginationLimit, "${res}" , { - type : "history" - }); - return res.status(200).json(bundle); - } catch (e) { - console.log('api api/fhir/${res}/:id/history has error, ', e) - return res.status(500).json(handleError.exception(e)); - } - }; - `; - //#endregion - - //#region getHistoryById - const getHistoryById = ` - const mongodb = require('models/mongodb'); - const { - handleError - } = require('../../../../models/FHIR/httpMessage'); - module.exports = async function(req, res) { - let id = req.params.id; - let version = req.params.version; - try { - let docs = await mongodb.${res}_history.findOne({ - $and : [ - { - id: id - } , - { - "meta.versionId": version - } - ] - }).exec(); - if (docs) { - return res.status(200).json(docs.getFHIRField()); - } - let errorMessage = \`not found ${res}/\${id} with version \${version} in history\`; - return res.status(404).json(handleError["not-found"](errorMessage)); - } catch (e) { - console.log('api api/fhir/${res}/:id has error, ', e) - return res.status(500).json(handleError.exception('server has something error')); - } - }; - `; - //#endregion - - //#region create resource (post) - const post = ` - const mongodb = require('models/mongodb'); - const { handleError } = require('../../../../models/FHIR/httpMessage'); - const uuid = require('uuid'); - const errorMessage = { - "code": "" , - "message" : "" - }; - module.exports = async function (req, res) { - console.log(req.body); - try { - let resFunc = { - "true" : (doc) => { - return res.status(201).send(doc); - } , - "false" : (doc) => { - if (errorMessage.message.code == 11000) { - return res.status(409).json(handleError.duplicate(errorMessage.message)); - } - return res.status(500).send(handleError.exception(errorMessage.message)); - } - } - let insertData = req.body; - let [status , doc] = await insert${res}(insertData); - return resFunc[status](doc); - } catch(e) { - console.error(e); - return res.status(500).send(handleError.exception(e)); - } - } - - async function insert${res}(insertData) { - return new Promise(async (resolve, reject) => { - try { - delete insertData.text; - delete insertData.meta; - insertData.id = uuid.v4(); - let new${res} = new mongodb.${res}(insertData); - new${res}.save(function (err, doc) { - if (err) { - errorMessage.message = err; - return resolve([false ,err]); - } - return resolve([true, doc.getFHIRField()]); - }); - } catch (e) { - console.error(e); - return resolve([false , e]); - } - }); - } - ` - //#endregion - - //#region update (put) - const put = ` - const mongodb = require('models/mongodb'); - const { handleError } = require('models/FHIR/httpMessage'); - - - const errorMessage = { - code : "" , - message : "" - } - - module.exports = async function (req ,res) { - let resFunc = { - "true" : (data) => { - return res.status(data.code).send(data.doc); - } , - "false" : (error) => { - return res.status(500).send(handleError.exception(errorMessage.message)); - } - } - let dataExist = await isDocExist(req.params.id); - if (dataExist == 0) { - return res.status(500).json(handleError.exception(errorMessage.message)); - } - let dataFuncAfterCheckExist = { - 0 : (req) => { - return ["false" , ""]; - } , - 1 : doUpdateData , - 2 : doInsertData - } - let [ status , result] =await dataFuncAfterCheckExist[dataExist](req); - return resFunc[status](result); - } - - function isDocExist (id) { - return new Promise (async (resolve , reject) => { - mongodb.${res}.findOne ({id : id} , async function (err ,doc) { - if (err) { - errorMessage.message = err; - return resolve (0); //error - } - if (doc) { - return resolve(1); //have doc - } else { - return resolve(2); //no doc - } - }); - }); - } - function doUpdateData (req) { - return new Promise((resolve , reject) => { - let data = req.body; - let id = req.params.id; - delete data._id; - delete data.text; - delete data.meta; - data.id = id; - mongodb.${res}.findOneAndUpdate({id : id } ,{$set : data} , { new : true , rawResult: true} , function (err , newDoc) { - if (err) { - errorMessage.message = err; - return resolve (["false" , err]); - } - return resolve(["true", { - id: id, - doc: newDoc.value.getFHIRField() , - code : 200 - }]); - }); - }); - } - - function doInsertData(req) { - return new Promise ((resolve ) => { - let data = req.body; - data.id = req.params.id; - delete data.text; - delete data.meta; - let updateData = new mongodb.${res}(data); - updateData.save(function (err, doc) { - errorMessage.message = err; - return resolve(err ? ["false",err] : ["true", { - code : 201 , - doc: doc.getFHIRField() - }]); - }); - }); - }` - //#endregion - - //#region delete - const deleteJs = ` - const mongodb = require('models/mongodb'); - const {getDeleteMessage , handleError} = require('../../../../models/FHIR/httpMessage'); - - const errorMessage = { - "message" : "" , - "code" : "" - } - - module.exports = async function(req ,res) { - let resFunc = { - "true" : (doc) => { - if (!doc) { - let errorMessage = \`not found ${res}/\${req.params.id}\`; - return res.status(404).json(handleError["not-found"](errorMessage)); - } - return res.status(200).json(getDeleteMessage("${res}" , req.params.id)); - } , - "false" : (doc) => { - return res.status(500).json(handleError.exception(errorMessage.message)); - } - } - let [status , doc] = await delete${res}(req); - return resFunc[status.toString()](doc); - } - - async function delete${res} (req) { - return new Promise((resolve)=> { - const id = req.params.id; - mongodb.${res}.findOneAndDelete({id : id} , (err , doc)=> { - if (err) { - console.log(err); - errorMessage.code = 500; - errorMessage.message = err; - return resolve([false , err]); - } - return resolve([true, doc]); - }) - }); - }` - //#endregion - - fs.writeFileSync(`./api/FHIR/${res}/controller/get${res}.js` , beautify(get)); - fs.writeFileSync(`./api/FHIR/${res}/controller/get${res}ById.js` , beautify(getById)); - fs.writeFileSync(`./api/FHIR/${res}/controller/get${res}History.js` , beautify(getHistory)); - fs.writeFileSync(`./api/FHIR/${res}/controller/get${res}HistoryById.js` , beautify(getHistoryById)); - fs.writeFileSync(`./api/FHIR/${res}/controller/post${res}.js` , beautify(post)); - fs.writeFileSync(`./api/FHIR/${res}/controller/put${res}.js` , beautify(put)); - fs.writeFileSync(`./api/FHIR/${res}/controller/delete${res}.js` , beautify(deleteJs)); - let indexJs = ` - const express = require('express'); - const router = express.Router(); - const joi = require('joi'); - const {validateParams} = require('api/validator'); - - router.use((req, res, next) => { - res.set('Content-Type', 'application/fhir+json'); - next(); - }); - router.get('/' , validateParams({ - "_offset" : joi.number().integer() , - "_count" : joi.number().integer() - } , "query" ,{ allowUnknown : true }) ,require('./controller/get${res}')); - - router.get('/:id' ,require('./controller/get${res}ById')); - - router.get('/:id/_history' ,validateParams({ - "_offset": joi.number().integer(), - "_count": joi.number().integer() - }, "query", { - allowUnknown: true - }) , require('./controller/get${res}History')); - - router.get('/:id/_history/:version' , require('./controller/get${res}HistoryById')); - - router.post('/' ,require('./controller/post${res}')); - - router.put('/:id' , require("./controller/put${res}")); - - router.delete('/:id', require("./controller/delete${res}")); - module.exports = router;` - fs.writeFileSync(`./api/FHIR/${res}/index.js` , beautify(indexJs)); - } -} -function generateMetaData () { - let dirInFHIRAPI = fs.readdirSync('./api/FHIR' , {withFileTypes : true}) - .filter(itemInDir => itemInDir.isDirectory()) - .map(dirItem => { - if (dirItem.name.toLocaleLowerCase() != "metadata") { - return dirItem.name; - } - }); - dirInFHIRAPI = _.compact(dirInFHIRAPI); - const fhirUrl = "http://hl7.org/fhir/R4"; - let metaData = { - "rest" : [ - { - "mode" : "server" , - "resource" : [] - } - ] - }; - console.log(dirInFHIRAPI); - for (let resource of dirInFHIRAPI) { - metaData.rest[0].resource.push( { - "type" : resource , - "profile" : `${fhirUrl}/${resource.toLocaleLowerCase()}.html` , - "interaction" : [ - { - "code" : "read" - } , - { - "code" : "update" - } , - { - "code" : "delete" - } , - { - 'code' : "create" - } - ] , - "updateCreate" : true , - "conditionalDelete" : "single" , - "searchInclude" : [] , - "searchRevInclude" : [] , - "searchParam" : [ - { - "name" : "_id" , - "type" : "string" - } - ] - }); - } - mkdirp.sync("./api/FHIR/metadata"); - mkdirp.sync("./api/FHIR/metadata/controller"); - let metadataRouteIndexText = ` - const express = require('express'); - const router = express.Router(); - const {validateParams} = require('../../validator'); - const Joi = require('joi'); - - router.use((req, res, next) => { - res.set('Content-Type', 'application/fhir+json'); - next(); - }); - - router.get('/' , require('./controller/getMetadata')); - - module.exports = router;` - fs.writeFileSync("./api/FHIR/metadata/index.js" , beautify(metadataRouteIndexText)); - let metadataText = ` - const fhirUrl = "http://hl7.org/fhir/R4"; - - module.exports = async function (req ,res) { - const metaData = { - "resourceType": "CapabilityStatement", - "status": "active", - "date": Date.now().toString(), - "publisher": "Not provided", - "kind": "instance", - "software": { - "name": "Simple-Express-FHIR-Server", - "version": "1.0.0" - }, - "implementation": { - "description": "Simple-Express FHIR R4 Server", - "url": \`http://${process.env.FHIRSERVER_HOST}/${process.env.FHIRSERVER_APIPATH}\` - }, - "fhirVersion": "4.0.1", - "format": [ "json" ], - "rest" : ${JSON.stringify(metaData.rest[0] , null , 4)} - } - res.json(metaData); - } - ` - fs.writeFileSync("./api/FHIR/metadata/controller/getMetadata.js" , beautify(metadataText)); -} -/*generateAPI({ - resources : ["Patient" , "MedicationRequest" , "Observation" , "ImagingStudy" , "Claim"] -})*/ - -module.exports = { - generateAPI : generateAPI , - generateMetaData : generateMetaData -} - - - - - - diff --git a/FHIR-mongoose-Models-Generator/DataTypesSummary.js b/FHIR-mongoose-Models-Generator/DataTypesSummary.js index c26fc0b0..a23f3cdb 100644 --- a/FHIR-mongoose-Models-Generator/DataTypesSummary.js +++ b/FHIR-mongoose-Models-Generator/DataTypesSummary.js @@ -43,7 +43,7 @@ module.exports = { "Duration", "Count", "MoneyQuantity", - "SimpleQuantity", + "SimpleQuantity" ] , MetadataTypes: [ "ContactDetail", @@ -53,7 +53,7 @@ module.exports = { "UsageContext", "ParameterDefinition", "Expression", - "TriggerDefinition", + "TriggerDefinition" ] , SpecialPurposeDataTypes: [ "Reference" , diff --git a/FHIR-mongoose-Models-Generator/resourceGenerator.js b/FHIR-mongoose-Models-Generator/resourceGenerator.js index 75cbd0ad..de9fe3dd 100644 --- a/FHIR-mongoose-Models-Generator/resourceGenerator.js +++ b/FHIR-mongoose-Models-Generator/resourceGenerator.js @@ -54,7 +54,7 @@ function fixChoiceTypeOfDate (fieldName, type) { return { yes: true, type: lowerFirstDateTypes - } + }; } } return { @@ -87,7 +87,7 @@ function getSchema (resource , name) { if (resource.properties[i].items.enum) { result[i] = { type : `[String]` - } + }; continue; } let arrayRefClean = arrayRef.split('/'); @@ -96,7 +96,7 @@ function getSchema (resource , name) { if (choiceTypeDate.yes) typeOfField = choiceTypeDate.type; result[i] = { type : `[${typeOfField}]` - } + }; } else if (refSchema) { if (/^#/.test(refSchema)) { let refClean = refSchema.split('/'); @@ -107,7 +107,7 @@ function getSchema (resource , name) { } else { result[i] = { type : typeOfField - } + }; } } else if (!/^#/.test(refSchema)) { @@ -118,8 +118,8 @@ function getSchema (resource , name) { result[i] = typeOfField; } else { result[i] = { - type : typeOfField , - } + type : typeOfField + }; } } } else if (isCode) { @@ -128,7 +128,7 @@ function getSchema (resource , name) { result[i] = { type : typeOfField , enum : JSON.stringify(isCode) - } + }; } else { if (choiceTypeDate.yes) type = choiceTypeDate.type; if (isPrimitiveType(type)) { @@ -136,7 +136,7 @@ function getSchema (resource , name) { } else { result[i] = { type : type - } + }; } } let isRequired = _.get(resource , "required"); @@ -192,7 +192,7 @@ async function generateSchema (type) { let schema = getSchema(FHIRJson[type] , type); cleanChildSchema(schema); let importLibs = getImportLibs(schema); - let schemaStr = JSON.stringify(schema , null , 4).replace(/\"/gm , '') + let schemaStr = JSON.stringify(schema , null , 4).replace(/\"/gm , ''); let code = `module.exports = new mongoose.Schema (${schemaStr.replace(/\\/gm , '"')} , { _id : false , id: false, @@ -259,11 +259,11 @@ function generateResourceSchema (type) { ${type}.id = { ...id , index: true - } + }; ${type}.contained = { type: [Object], default: void 0 - } + }; module.exports.schema = ${type}; let schemaConfig = { toObject : { getters : true} , @@ -286,7 +286,7 @@ function generateResourceSchema (type) { _.set(result, "collection", tempCollectionField); } return result; - } + }; ${type}Schema.pre('save', async function (next) { let mongodb = require('../index'); @@ -419,7 +419,7 @@ function generateResourceSchema (type) { } else { importLibs =`const moment = require('moment');\r\nconst _ = require('lodash');\r\n${importLibs}\r\n`; } - code = `${importLibs}${code}`; + code = `${importLibs}${code};`; mkdirp.sync(config.resourcePath); fs.writeFileSync(`${config.resourcePath}/${type}.js` , beautify(code , {indent_size : 4 ,pace_in_empty_paren: true })); } @@ -445,7 +445,7 @@ module.exports = function (inputResourceType , option) { //mkdirp.sync(`${config.typePath}/`); config.requirePath = path.relative(resourcePath , "./models/mongodb/FHIRDataTypesSchema").replace(/\\/gm ,"/"); generateResourceSchema(inputResourceType); -} +}; function main(inputResourceType , option) { if (option.cwd) { diff --git a/api/FHIR/Patient/controller/deletePatient.js b/api/FHIR/Patient/controller/deletePatient.js index ef779f7e..29767a9c 100644 --- a/api/FHIR/Patient/controller/deletePatient.js +++ b/api/FHIR/Patient/controller/deletePatient.js @@ -2,4 +2,4 @@ const deleteAPI = require('../../../FHIRApiService/delete'); module.exports = async function(req, res) { return await deleteAPI(req, res, "Patient"); -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/FHIR/Patient/controller/getPatient.js b/api/FHIR/Patient/controller/getPatient.js index a7d8daaa..13cdd04e 100644 --- a/api/FHIR/Patient/controller/getPatient.js +++ b/api/FHIR/Patient/controller/getPatient.js @@ -11,7 +11,7 @@ const search = require('../../../FHIRApiService/search'); module.exports = async function(req, res) { return await search(req, res, "Patient", paramsSearch); -} +}; let paramsSearchFields = {}; const paramsSearch = { @@ -21,11 +21,11 @@ const paramsSearch = { }); delete query["_id"]; } -} +}; paramsSearch["_lastUpdated"] = (query) => { if (!_.isArray(query["_lastUpdated"])) { - query["_lastUpdated"] = [query["_lastUpdated"]] + query["_lastUpdated"] = [query["_lastUpdated"]]; } for (let i in query["_lastUpdated"]) { let buildResult = queryBuild.instantQuery(query["_lastUpdated"][i], "meta.lastUpdated"); @@ -35,11 +35,11 @@ paramsSearch["_lastUpdated"] = (query) => { query.$and.push(buildResult); } delete query["_lastUpdated"]; -} +}; paramsSearchFields["address"] = ["address"]; paramsSearch["address"] = (query) => { if (!_.isArray(query["address"])) { - query["address"] = [query["address"]] + query["address"] = [query["address"]]; } for (let item of query["address"]) { let buildQs = { @@ -54,11 +54,11 @@ paramsSearch["address"] = (query) => { }); } delete query["address"]; -} +}; paramsSearchFields["address-city"] = ["address.city"]; paramsSearch["address-city"] = (query) => { if (!_.isArray(query["address-city"])) { - query["address-city"] = [query["address-city"]] + query["address-city"] = [query["address-city"]]; } for (let item of query["address-city"]) { let buildQs = { @@ -73,11 +73,11 @@ paramsSearch["address-city"] = (query) => { }); } delete query["address-city"]; -} +}; paramsSearchFields["address-country"] = ["address.country"]; paramsSearch["address-country"] = (query) => { if (!_.isArray(query["address-country"])) { - query["address-country"] = [query["address-country"]] + query["address-country"] = [query["address-country"]]; } for (let item of query["address-country"]) { let buildQs = { @@ -92,11 +92,11 @@ paramsSearch["address-country"] = (query) => { }); } delete query["address-country"]; -} +}; paramsSearchFields["address-postalcode"] = ["address.postalCode"]; paramsSearch["address-postalcode"] = (query) => { if (!_.isArray(query["address-postalcode"])) { - query["address-postalcode"] = [query["address-postalcode"]] + query["address-postalcode"] = [query["address-postalcode"]]; } for (let item of query["address-postalcode"]) { let buildQs = { @@ -111,11 +111,11 @@ paramsSearch["address-postalcode"] = (query) => { }); } delete query["address-postalcode"]; -} +}; paramsSearchFields["address-state"] = ["address.state"]; paramsSearch["address-state"] = (query) => { if (!_.isArray(query["address-state"])) { - query["address-state"] = [query["address-state"]] + query["address-state"] = [query["address-state"]]; } for (let item of query["address-state"]) { let buildQs = { @@ -130,35 +130,16 @@ paramsSearch["address-state"] = (query) => { }); } delete query["address-state"]; -} -paramsSearchFields["address-use"] = ["address.use"]; -paramsSearch["address-use"] = (query) => { - if (!_.isArray(query["address-use"])) { - query["address-use"] = [query["address-use"]] - } - for (let item of query["address-use"]) { - let buildQs = { - $or: [] - }; - for (let field of paramsSearchFields["address-use"]) { - let buildResult = queryBuild.tokenQuery(item, "", field, "", false); - buildQs.$or = [...buildQs.$or, ...buildResult.$or]; - } - query.$and.push({ - ...buildQs - }); - } - delete query['address-use']; -} +}; paramsSearchFields["birthdate"] = ["birthDate"]; const birthdateSearchFunc = {}; birthdateSearchFunc["birthDate"] = (value, field) => { return queryBuild.dateQuery(value, field); -} +}; paramsSearch["birthdate"] = (query) => { if (!_.isArray(query["birthdate"])) { - query["birthdate"] = [query["birthdate"]] + query["birthdate"] = [query["birthdate"]]; } for (let item of query["birthdate"]) { let buildQs = { @@ -173,11 +154,26 @@ paramsSearch["birthdate"] = (query) => { }); } delete query['birthdate']; -} +}; +paramsSearchFields["email"] = ["telecom.where(system='email')"]; +paramsSearch["email"] = (query) => { + if (!_.isArray(query["email"])) { + query["email"] = [query["email"]]; + } + for (let item of query["email"]) { + let buildResult = queryBuild.tokenQuery(item, "value", "telecom", "email", false); + for (let i in buildResult) { + query.$and.push({ + [i]: buildResult[i] + }); + } + } + delete query['email']; +}; paramsSearchFields["family"] = ["name.family"]; paramsSearch["family"] = (query) => { if (!_.isArray(query["family"])) { - query["family"] = [query["family"]] + query["family"] = [query["family"]]; } for (let item of query["family"]) { let buildQs = { @@ -186,7 +182,7 @@ paramsSearch["family"] = (query) => { for (let field of paramsSearchFields["family"]) { let buildResult = { [field]: queryBuild.stringQuery(item, field) - } + }; buildQs.$or.push(buildResult); } query.$and.push({ @@ -194,30 +190,11 @@ paramsSearch["family"] = (query) => { }); } delete query['family']; -} -paramsSearchFields["gender"] = ["gender"]; -paramsSearch["gender"] = (query) => { - if (!_.isArray(query["gender"])) { - query["gender"] = [query["gender"]] - } - for (let item of query["gender"]) { - let buildQs = { - $or: [] - }; - for (let field of paramsSearchFields["gender"]) { - let buildResult = queryBuild.tokenQuery(item, "", field, "", false); - buildQs.$or = [...buildQs.$or, ...buildResult.$or]; - } - query.$and.push({ - ...buildQs - }); - } - delete query['gender']; -} +}; paramsSearchFields["given"] = ["name.given"]; paramsSearch["given"] = (query) => { if (!_.isArray(query["given"])) { - query["given"] = [query["given"]] + query["given"] = [query["given"]]; } for (let item of query["given"]) { let buildQs = { @@ -226,7 +203,7 @@ paramsSearch["given"] = (query) => { for (let field of paramsSearchFields["given"]) { let buildResult = { [field]: queryBuild.stringQuery(item, field) - } + }; buildQs.$or.push(buildResult); } query.$and.push({ @@ -234,11 +211,26 @@ paramsSearch["given"] = (query) => { }); } delete query['given']; -} +}; +paramsSearchFields["phone"] = ["telecom.where(system='phone')"]; +paramsSearch["phone"] = (query) => { + if (!_.isArray(query["phone"])) { + query["phone"] = [query["phone"]]; + } + for (let item of query["phone"]) { + let buildResult = queryBuild.tokenQuery(item, "value", "telecom", "phone", false); + for (let i in buildResult) { + query.$and.push({ + [i]: buildResult[i] + }); + } + } + delete query['phone']; +}; paramsSearchFields["phonetic"] = ["name"]; paramsSearch["phonetic"] = (query) => { if (!_.isArray(query["phonetic"])) { - query["phonetic"] = [query["phonetic"]] + query["phonetic"] = [query["phonetic"]]; } for (let item of query["phonetic"]) { let buildQs = { @@ -247,7 +239,7 @@ paramsSearch["phonetic"] = (query) => { for (let field of paramsSearchFields["phonetic"]) { let buildResult = { [field]: queryBuild.stringQuery(item, field) - } + }; buildQs.$or.push(buildResult); } query.$and.push({ @@ -255,61 +247,23 @@ paramsSearch["phonetic"] = (query) => { }); } delete query['phonetic']; -} -paramsSearchFields["telecom"] = ["telecom"]; -paramsSearch["telecom"] = (query) => { - if (!_.isArray(query["telecom"])) { - query["telecom"] = [query["telecom"]] - } - for (let item of query["telecom"]) { - let buildQs = { - $or: [] - }; - for (let field of paramsSearchFields["telecom"]) { - let buildResult = queryBuild.tokenQuery(item, "value", field, "", false); - buildQs.$or = [...buildQs.$or, ...buildResult.$or]; - } - query.$and.push({ - ...buildQs - }); - } - delete query['telecom']; -} -paramsSearchFields["active"] = ["active"]; -paramsSearch["active"] = (query) => { - if (!_.isArray(query["active"])) { - query["active"] = [query["active"]] - } - for (let item of query["active"]) { - let buildQs = { - $or: [] - }; - for (let field of paramsSearchFields["active"]) { - let buildResult = queryBuild.tokenQuery(item, "", field, "", false); - buildQs.$or = [...buildQs.$or, ...buildResult.$or]; - } - query.$and.push({ - ...buildQs - }); - } - delete query['active']; -} +}; paramsSearchFields["death-date"] = ["deceasedDateTime"]; const death_dateSearchFunc = {}; death_dateSearchFunc["deceasedDateTime"] = (value, field) => { return queryBuild.dateTimeQuery(value, field); -} +}; paramsSearch["death-date"] = (query) => { if (!_.isArray(query["death-date"])) { - query["death-date"] = [query["death-date"]] + query["death-date"] = [query["death-date"]]; } for (let item of query["death-date"]) { let buildQs = { $or: [] }; for (let field of paramsSearchFields["death-date"]) { - let buildResult = death - dateSearchFunc[field](item, field); + let buildResult = death_dateSearchFunc[field](item, field); buildQs.$or.push(buildResult); } query.$and.push({ @@ -317,30 +271,11 @@ paramsSearch["death-date"] = (query) => { }); } delete query['death-date']; -} -paramsSearchFields["deceased"] = ["deceased.exists() and Patient.deceased != false"]; -paramsSearch["deceased"] = (query) => { - if (!_.isArray(query["deceased"])) { - query["deceased"] = [query["deceased"]] - } - for (let item of query["deceased"]) { - let buildQs = { - $or: [] - }; - for (let field of paramsSearchFields["deceased"]) { - let buildResult = queryBuild.tokenQuery(item, "", field, "", false); - buildQs.$or = [...buildQs.$or, ...buildResult.$or]; - } - query.$and.push({ - ...buildQs - }); - } - delete query['deceased']; -} +}; paramsSearchFields["general-practitioner"] = ["generalPractitioner.reference"]; paramsSearch["general-practitioner"] = (query) => { if (!_.isArray(query["general-practitioner"])) { - query["general-practitioner"] = [query["general-practitioner"]] + query["general-practitioner"] = [query["general-practitioner"]]; } for (let item of query["general-practitioner"]) { @@ -356,11 +291,11 @@ paramsSearch["general-practitioner"] = (query) => { }); } delete query['general-practitioner']; -} +}; paramsSearchFields["identifier"] = ["identifier"]; paramsSearch["identifier"] = (query) => { if (!_.isArray(query["identifier"])) { - query["identifier"] = [query["identifier"]] + query["identifier"] = [query["identifier"]]; } for (let item of query["identifier"]) { let buildQs = { @@ -375,30 +310,11 @@ paramsSearch["identifier"] = (query) => { }); } delete query['identifier']; -} -paramsSearchFields["language"] = ["communication.language"]; -paramsSearch["language"] = (query) => { - if (!_.isArray(query["language"])) { - query["language"] = [query["language"]] - } - for (let item of query["language"]) { - let buildQs = { - $or: [] - }; - for (let field of paramsSearchFields["language"]) { - let buildResult = queryBuild.tokenQuery(item, "coding.code", field, "", true); - buildQs.$or = [...buildQs.$or, ...buildResult.$or]; - } - query.$and.push({ - ...buildQs - }); - } - delete query['language']; -} +}; paramsSearchFields["link"] = ["link.other.reference"]; paramsSearch["link"] = (query) => { if (!_.isArray(query["link"])) { - query["link"] = [query["link"]] + query["link"] = [query["link"]]; } for (let item of query["link"]) { @@ -414,22 +330,22 @@ paramsSearch["link"] = (query) => { }); } delete query['link']; -} +}; paramsSearchFields["name"] = ["name"]; paramsSearch["name"] = (query) => { if (!_.isArray(query["name"])) { - query["name"] = [query["name"]] + query["name"] = [query["name"]]; } for (let item of query["name"]) { let buildResult = queryBuild.nameQuery(item, "name"); query.$and.push(buildResult); } delete query['name']; -} +}; paramsSearchFields["organization"] = ["managingOrganization.reference"]; paramsSearch["organization"] = (query) => { if (!_.isArray(query["organization"])) { - query["organization"] = [query["organization"]] + query["organization"] = [query["organization"]]; } for (let item of query["organization"]) { @@ -445,4 +361,4 @@ paramsSearch["organization"] = (query) => { }); } delete query['organization']; -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/FHIR/Patient/controller/getPatientHistory.js b/api/FHIR/Patient/controller/getPatientHistory.js index 7b038932..125f864f 100644 --- a/api/FHIR/Patient/controller/getPatientHistory.js +++ b/api/FHIR/Patient/controller/getPatientHistory.js @@ -2,4 +2,4 @@ const history = require('../../../FHIRApiService/history'); module.exports = async function(req, res) { return await history(req, res, "Patient"); -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/FHIR/Patient/controller/getPatientHistoryById.js b/api/FHIR/Patient/controller/getPatientHistoryById.js index 24e97874..06fc4d39 100644 --- a/api/FHIR/Patient/controller/getPatientHistoryById.js +++ b/api/FHIR/Patient/controller/getPatientHistoryById.js @@ -2,4 +2,4 @@ const vread = require('../../../FHIRApiService/vread'); module.exports = async function(req, res) { return await vread(req, res, "Patient"); -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/FHIR/Patient/controller/postPatient.js b/api/FHIR/Patient/controller/postPatient.js index 737cc4af..09499ca1 100644 --- a/api/FHIR/Patient/controller/postPatient.js +++ b/api/FHIR/Patient/controller/postPatient.js @@ -1,4 +1,4 @@ const create = require('../../../FHIRApiService/create'); module.exports = async function(req, res) { return await create(req, res, "Patient"); -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/FHIR/Patient/controller/postPatientValidate.js b/api/FHIR/Patient/controller/postPatientValidate.js index 3e6b17f1..6a60d1d8 100644 --- a/api/FHIR/Patient/controller/postPatientValidate.js +++ b/api/FHIR/Patient/controller/postPatientValidate.js @@ -2,4 +2,4 @@ const validate = require('../../../FHIRApiService/$validate'); module.exports = async function(req, res) { return await validate(req, res, "Patient"); -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/FHIR/Patient/controller/putPatient.js b/api/FHIR/Patient/controller/putPatient.js index 36a4cb4f..6d8db042 100644 --- a/api/FHIR/Patient/controller/putPatient.js +++ b/api/FHIR/Patient/controller/putPatient.js @@ -2,4 +2,4 @@ const update = require('../../../FHIRApiService/update.js'); module.exports = async function(req, res) { return await update(req, res, "Patient"); -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/FHIRApiService/$validate.js b/api/FHIRApiService/$validate.js index 6ee576f1..c8e07adb 100644 --- a/api/FHIRApiService/$validate.js +++ b/api/FHIRApiService/$validate.js @@ -20,7 +20,7 @@ module.exports = async function (req, res, resourceType) { return res.status(code).send(xmlItem); } return res.status(code).send(item); - } + }; let operationOutcomeMessage; let query = req.query; let resourceBody = req.body; @@ -41,12 +41,12 @@ module.exports = async function (req, res, resourceType) { .filter(v => v.includes("binding.valueSet") //&& //v.includes("snapshot") - ) + ); let parsedValueSetsKeys = Object.keys(parser.parsedValueSets); for (let key of valueSetKeys) { - let valueSetUri = _.get(profileJson, key) + let valueSetUri = _.get(profileJson, key); if (!parsedValueSetsKeys.includes(valueSetUri)) { - console.log(`Get valueSet from "${valueSetUri}"`) + console.log(`Get valueSet from "${valueSetUri}"`); let valueSetRes = await fetch(valueSetUri, { headers: { "accept": "application/fhir+json" @@ -55,7 +55,7 @@ module.exports = async function (req, res, resourceType) { let valueSetJson = await valueSetRes.json(); console.log(`Load valueSet "${valueSetJson.id}"`); parser.parseValueSet(valueSetJson); - console.log(`Success parse valuset "${valueSetJson.id}"`) + console.log(`Success parse valuset "${valueSetJson.id}"`); } } @@ -75,26 +75,26 @@ module.exports = async function (req, res, resourceType) { operationOutcomeMessage = { code: 412, msg: operationOutcomeError - } + }; } else { operationOutcomeMessage = { code: 200, msg: operationOutcomeError - } + }; } } else { - let operationOutcomeInfo = handleError.informational("No issues detected during validation") + let operationOutcomeInfo = handleError.informational("No issues detected during validation"); operationOutcomeMessage = { code: 200, msg: operationOutcomeInfo - } + }; } } catch (e) { console.error(e); operationOutcomeMessage = { code: 500, msg: handleError.exception(e) - } + }; } } else { let fhir = new FHIR(); @@ -107,15 +107,15 @@ module.exports = async function (req, res, resourceType) { operationOutcomeMessage = { code: 412, msg: operationOutcomeError - } + }; } } else { let operationOutcomeInfo = handleError.informational("No issues detected during validation"); operationOutcomeMessage = { code: 200, msg: operationOutcomeInfo - } + }; } } return doRes(operationOutcomeMessage.code, operationOutcomeMessage.msg); -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/FHIRApiService/delete.js b/api/FHIRApiService/delete.js index 88f155ad..ddeb80de 100644 --- a/api/FHIRApiService/delete.js +++ b/api/FHIRApiService/delete.js @@ -21,7 +21,7 @@ module.exports = async function(req, res, resourceType) { return res.status(code).send(xmlItem); } return res.status(code).send(item); - } + }; if (!user.checkTokenPermission(req, resourceType, "detele")) { return doRes(403,handleError.forbidden("Your token doesn't have permission with this API")); } @@ -42,10 +42,10 @@ module.exports = async function(req, res, resourceType) { } return doRes(500,handleError.exception(err.message)); } - } + }; let [status, doc] = await doDeleteData(req, resourceType); return resFunc[status.toString()](doc); -} +}; async function doDeleteData(req, resourceType) { return new Promise((resolve) => { @@ -58,6 +58,6 @@ async function doDeleteData(req, resourceType) { return resolve([false, err]); } return resolve([true, doc]); - }) + }); }); } \ No newline at end of file diff --git a/api/FHIRApiService/history.js b/api/FHIRApiService/history.js index f37733e3..9aaca7b7 100644 --- a/api/FHIRApiService/history.js +++ b/api/FHIRApiService/history.js @@ -21,7 +21,7 @@ module.exports = async function(req, res, resourceType) { return res.status(code).send(xmlItem); } return res.status(code).send(item); - } + }; if (!user.checkTokenPermission(req, resourceType, "history")) { return doRes(403,handleError.forbidden("Your token doesn't have permission with this API")); } @@ -60,7 +60,7 @@ module.exports = async function(req, res, resourceType) { res.header('Last-Modified', new Date().toUTCString()); return doRes(200, bundle); } catch (e) { - console.log(`api ${process.env.FHIRSERVER_APIPATH}/${resourceType}/:id/history has error, `, e) + console.log(`api ${process.env.FHIRSERVER_APIPATH}/${resourceType}/:id/history has error, `, e); let operationOutcomeError = handleError.exception(e); return doRes(500, operationOutcomeError); } diff --git a/api/FHIRApiService/read.js b/api/FHIRApiService/read.js index b6c49ec0..068f4c77 100644 --- a/api/FHIRApiService/read.js +++ b/api/FHIRApiService/read.js @@ -19,7 +19,7 @@ module.exports = async function (req , res , resourceType) { return res.status(code).send(xmlItem); } return res.status(code).send(item); - } + }; if (!user.checkTokenPermission(req, resourceType, "read")) { return doRes(403,handleError.forbidden("Your token doesn't have permission with this API")); } @@ -41,4 +41,4 @@ module.exports = async function (req , res , resourceType) { let operationOutcomeError = handleError.exception(e); return doRes(500, operationOutcomeError); } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/FHIRApiService/search.js b/api/FHIRApiService/search.js index 811a4c2d..17b51474 100644 --- a/api/FHIRApiService/search.js +++ b/api/FHIRApiService/search.js @@ -25,7 +25,7 @@ module.exports = async function(req, res,resourceType,paramsSearch) { return res.status(code).send(xmlItem); } return res.status(code).send(item); - } + }; if (!user.checkTokenPermission(req, resourceType, "search-type")) { return doRes(403,handleError.forbidden("Your token doesn't have permission with this API")); } @@ -71,7 +71,7 @@ module.exports = async function(req, res,resourceType,paramsSearch) { res.header('Last-Modified', new Date().toUTCString()); return doRes(200 , bundle); } catch (e) { - console.log(`api ${process.env.FHIRSERVER_APIPATH}/${resourceType}/ has error, `, e) + console.log(`api ${process.env.FHIRSERVER_APIPATH}/${resourceType}/ has error, `, e); let operationOutcomeError = handleError.exception(e); return doRes(500 , operationOutcomeError); } diff --git a/api/FHIRApiService/update.js b/api/FHIRApiService/update.js index a1f49a2a..0ac833f0 100644 --- a/api/FHIRApiService/update.js +++ b/api/FHIRApiService/update.js @@ -22,7 +22,7 @@ module.exports = async function (req, res, resourceType) { return res.status(code).send(xmlItem); } return res.status(code).send(item); - } + }; if (!user.checkTokenPermission(req, resourceType, "update")) { return doRes(403,handleError.forbidden("Your token doesn't have permission with this API")); } @@ -41,26 +41,26 @@ module.exports = async function (req, res, resourceType) { operationOutcomeMessage = { code : 409 , msg : handleError.duplicate(err.message) - } + }; } else if (err.stack.includes("ValidationError")) { operationOutcomeMessage = { code : 400 , msg : handleError.processing(err.message) - } + }; } else if (err.stack.includes("stored by resource")) { operationOutcomeMessage = { code : 400 , msg : handleError.processing(err.message) - } + }; } else { operationOutcomeMessage = { code : 500 , msg : handleError.exception(err.message) - } + }; } return doRes(operationOutcomeMessage.code , operationOutcomeMessage.msg); } - } + }; let updateData = req.body; if (_.get(updateData, "contained")) { let containedResources = _.get(updateData, "contained"); @@ -76,7 +76,7 @@ module.exports = async function (req, res, resourceType) { if (process.env.ENABLE_CHECK_REFERENCE == "true") { let checkReferenceRes = await checkReference(updateData); if (!checkReferenceRes.status) { - let notExistReferenceList = getNotExistReferenceList(checkReferenceRes) + let notExistReferenceList = getNotExistReferenceList(checkReferenceRes); let operationOutcomeError = handleError.processing(`The reference not found : ${_.map(notExistReferenceList , "value").join(",")}`); _.set(operationOutcomeError , "issue.0.location" , _.map(notExistReferenceList , "path")); return doRes(400, operationOutcomeError); @@ -84,7 +84,7 @@ module.exports = async function (req, res, resourceType) { } let dataExist = await isDocExist(req.params.id, resourceType); if (dataExist.status == 0) { - return doRes(500, handleError.exception(dataExist.error)) + return doRes(500, handleError.exception(dataExist.error)); } let dataFuncAfterCheckExist = { 0: (req,resourceType) => { @@ -92,35 +92,33 @@ module.exports = async function (req, res, resourceType) { }, 1: doUpdateData, 2: doInsertData - } + }; let [status, result] = await dataFuncAfterCheckExist[dataExist.status](req,resourceType); return resFunc[status](result); -} +}; function isDocExist(id,resourceType) { - return new Promise(async (resolve, reject) => { - mongodb[resourceType].findOne({ - id: id - }, async function (err, doc) { - if (err) { - return resolve({ - status: 0, - error: err - }); //error - } - if (doc) { - return resolve({ - status: 1, - error: "" - }); //have doc - } else { - return resolve({ - status: 2, - error: "" - }); //no doc - } - }); + mongodb[resourceType].findOne({ + id: id + }, async function (err, doc) { + if (err) { + return { + status: 0, + error: err + }; //error + } + if (doc) { + return { + status: 1, + error: "" + }; //have doc + } else { + return { + status: 2, + error: "" + }; //no doc + } }); } diff --git a/api/FHIRApiService/validateContained.js b/api/FHIRApiService/validateContained.js index e14df09e..7f6071a3 100644 --- a/api/FHIRApiService/validateContained.js +++ b/api/FHIRApiService/validateContained.js @@ -7,7 +7,7 @@ module.exports = (resourceItem, index) => { return { status: false, message: `Missing resourceType in contained[${index}]` - } + }; } if (mongodb[resourceType]) { let resourceToMongoModel = new mongodb[resourceType](resourceItem); @@ -16,16 +16,16 @@ module.exports = (resourceItem, index) => { return { status: false, message: validation.message - } + }; } return { status: true, message: "success" - } + }; } else { return { status: false, message: `Burni not support this resource type. ${resourceType}` - } + }; } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/FHIRApiService/vread.js b/api/FHIRApiService/vread.js index 46398021..9be2abfa 100644 --- a/api/FHIRApiService/vread.js +++ b/api/FHIRApiService/vread.js @@ -19,7 +19,7 @@ module.exports = async function(req, res, resourceType) { return res.status(code).send(xmlItem); } return res.status(code).send(item); - } + }; if (!user.checkTokenPermission(req, resourceType, "vread")) { return doRes(403,handleError.forbidden("Your token doesn't have permission with this API")); } @@ -44,7 +44,7 @@ module.exports = async function(req, res, resourceType) { let operationOutcomeError = handleError.exception(errorMessage); return doRes(404 , operationOutcomeError); } catch (e) { - console.log(`api ${process.env.FHIRSERVER_APIPATH}/${resourceType}/:id has error, `, e) + console.log(`api ${process.env.FHIRSERVER_APIPATH}/${resourceType}/:id has error, `, e); let operationOutcomeError = handleError.exception(e); return doRes(500 , operationOutcomeError); } diff --git a/api/apiService.js b/api/apiService.js index fa646ba3..834e4f19 100644 --- a/api/apiService.js +++ b/api/apiService.js @@ -128,7 +128,7 @@ async function checkReference(resourceData) { return { status : checkedReferenceList.every(v=> v.exist), checkedReferenceList: checkedReferenceList - } + }; } return { status: true, @@ -179,11 +179,11 @@ const user = { if (err.name == "TokenExpiredError") { return res.status(401).send(handleError.expired("token expired")); } - return res.status(401).send(handleError.security(err.message)) + return res.status(401).send(handleError.security(err.message)); } req.tokenObj = decoded; return next(); - }) + }); } else { return res.status(401).send(handleError.security("the token not found")); } @@ -215,7 +215,7 @@ const user = { return false; } } -} +}; /** * * @param {import('express').Request} req @@ -233,7 +233,7 @@ user["checkTokenPermission"] = async (req, resourceType, interaction) => { } } return false; -} +}; module.exports = { getDeepKeys: getDeepKeys, @@ -241,4 +241,4 @@ module.exports = { checkReference: checkReference , getNotExistReferenceList: getNotExistReferenceList, user : user -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/user/controller/deleteToken.js b/api/user/controller/deleteToken.js index f37a4e33..7b735eed 100644 --- a/api/user/controller/deleteToken.js +++ b/api/user/controller/deleteToken.js @@ -13,7 +13,7 @@ module.exports = async function(req, res) { return res.status(200).send({ status: true, message: "Delete success" - }) + }); } catch(e) { console.error(e); return res.status(500).send({ @@ -22,4 +22,4 @@ module.exports = async function(req, res) { }); } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/user/controller/getIssuedToken.js b/api/user/controller/getIssuedToken.js index 492bb213..efa3ee82 100644 --- a/api/user/controller/getIssuedToken.js +++ b/api/user/controller/getIssuedToken.js @@ -43,8 +43,7 @@ module.exports = async function(req, res) { console.error(e); return res.status(500).send(); } - -} +}; function getDecodedTokenObj(token) { return new Promise((resolve , reject)=> { @@ -55,13 +54,12 @@ function getDecodedTokenObj(token) { if (err) { if (err.name != "TokenExpiredError") { reject(err); - return res.status(401).send(handleError.expired("token expired")); } else { tokenObj.status = false; tokenObj.message = "token expired"; } } resolve(tokenObj); - }) - }) + }); + }); } \ No newline at end of file diff --git a/api/user/controller/getLoginStatus.js b/api/user/controller/getLoginStatus.js index 490ec499..1f5d5d8c 100644 --- a/api/user/controller/getLoginStatus.js +++ b/api/user/controller/getLoginStatus.js @@ -6,4 +6,4 @@ */ module.exports = function (req, res) { return res.status(200).send(req.user); -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/user/controller/postRefreshToken.js b/api/user/controller/postRefreshToken.js index cb88d498..f6128f8a 100644 --- a/api/user/controller/postRefreshToken.js +++ b/api/user/controller/postRefreshToken.js @@ -25,4 +25,4 @@ module.exports = async function (req , res) { console.error(err); return res.status(500).json(err); } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/user/controller/postTokenIssue.js b/api/user/controller/postTokenIssue.js index f8d94109..3255b390 100644 --- a/api/user/controller/postTokenIssue.js +++ b/api/user/controller/postTokenIssue.js @@ -27,4 +27,4 @@ module.exports = async function (req , res) { console.error(err); return res.status(500).json(err); } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/user/index.js b/api/user/index.js index 350bc456..4fec4ff2 100644 --- a/api/user/index.js +++ b/api/user/index.js @@ -60,7 +60,7 @@ router.post( "refresh_token": Joi.string().required() }, "body" , { allowUnknown: false }), require("./controller/postRefreshToken") -) +); module.exports = router; diff --git a/api/user/service/refreshTokenService.js b/api/user/service/refreshTokenService.js index 449dd4b6..7d64f96e 100644 --- a/api/user/service/refreshTokenService.js +++ b/api/user/service/refreshTokenService.js @@ -14,7 +14,7 @@ module.exports = async function (refresh_token,expiresIn='1y') { status: false, code: 404, data: "Not found with refresh token" - } + }; } let decodedTokenObj = jwt.decode(hitTokenObj.token, { complete:true }); let id = await uidGenerator.generate(); @@ -25,7 +25,7 @@ module.exports = async function (refresh_token,expiresIn='1y') { token: token, id: `Bearer ${id}`, refresh_token: refresh_token - } + }; await mongodb.issuedToken.findOneAndUpdate({ refresh_token: refresh_token } , tokenObj); @@ -42,4 +42,4 @@ module.exports = async function (refresh_token,expiresIn='1y') { data: e }; } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/user/service/tokenIssueService.js b/api/user/service/tokenIssueService.js index c3fe6c4f..314c1d21 100644 --- a/api/user/service/tokenIssueService.js +++ b/api/user/service/tokenIssueService.js @@ -14,7 +14,7 @@ module.exports = async function (needSignData,expiresIn='1y') { token: token, id: `Bearer ${id}`, refresh_token: refresh_token - }) + }); await tokenObj.save(); return { status : true, @@ -27,4 +27,4 @@ module.exports = async function (needSignData,expiresIn='1y') { data: e }; } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api/validator.js b/api/validator.js index 3d6b026e..bb2942fa 100644 --- a/api/validator.js +++ b/api/validator.js @@ -27,7 +27,7 @@ const validateParams = function (paramSchema , item , options) { }); } next(); - } + }; }; const FHIRValidateParams = function (paramSchema , item , options) { @@ -46,7 +46,7 @@ const FHIRValidateParams = function (paramSchema , item , options) { return res.status(400).send(sendErrorMessage); } next(); - } + }; }; module.exports = { validateParams: validateParams , diff --git a/api_generator/API_Generator_V2.js b/api_generator/API_Generator_V2.js index df67e374..9b5e71b3 100644 --- a/api_generator/API_Generator_V2.js +++ b/api_generator/API_Generator_V2.js @@ -32,7 +32,7 @@ function generateAPI(option) { module.exports = async function(req, res) { return await search(req, res,"${res}", paramsSearch); - } + }; let paramsSearchFields = {}; const paramsSearch = { @@ -42,11 +42,11 @@ function generateAPI(option) { }); delete query["_id"]; } - } + }; paramsSearch["_lastUpdated"] = (query) => { if (!_.isArray(query["_lastUpdated"])) { - query["_lastUpdated"] = [query["_lastUpdated"]] + query["_lastUpdated"] = [query["_lastUpdated"]]; } for (let i in query["_lastUpdated"]) { let buildResult = queryBuild.instantQuery(query["_lastUpdated"][i], "meta.lastUpdated"); @@ -56,8 +56,8 @@ function generateAPI(option) { query.$and.push(buildResult); } delete query["_lastUpdated"]; - } - ` + }; + `; let searchParameter = require('./FHIRParametersClean.json'); let resSearchParams = searchParameter[res]; @@ -89,7 +89,7 @@ function generateAPI(option) { module.exports = async function(req, res) { return await read(req , res , "${res}"); }; - ` + `; //#endregion //#region getHistory @@ -98,7 +98,7 @@ function generateAPI(option) { module.exports = async function(req , res) { return await history(req, res, "${res}"); - } + }; `; //#endregion @@ -108,7 +108,7 @@ function generateAPI(option) { module.exports = async function(req, res) { return await vread(req ,res, "${res}"); - } + }; `; //#endregion @@ -117,7 +117,7 @@ function generateAPI(option) { const create = require('../../../FHIRApiService/create'); module.exports = async function(req, res) { return await create(req , res , "${res}"); - } + }; `; if (res == "List") { post = ` @@ -136,7 +136,7 @@ function generateAPI(option) { } } return await create(req , res , "${res}"); - } + }; `; } //#endregion @@ -147,8 +147,8 @@ function generateAPI(option) { module.exports = async function(req, res) { return await update(req, res, "${res}"); - } - ` + }; + `; if (res == "List") { put = ` const update = require('../../../FHIRApiService/update.js'); @@ -166,7 +166,7 @@ function generateAPI(option) { } } return await update(req, res, "${res}"); - } + }; `; } //#endregion @@ -177,8 +177,8 @@ function generateAPI(option) { module.exports = async function (req, res) { return await deleteAPI(req, res, "${res}"); - } - ` + }; + `; //#endregion const validationScript = ` @@ -186,7 +186,7 @@ function generateAPI(option) { module.exports = async function (req, res) { return await validate(req,res, "${res}"); - } + }; `; fs.writeFileSync(`./api/FHIR/${res}/controller/get${res}.js`, beautify(get)); @@ -290,7 +290,7 @@ function generateAPI(option) { router.delete('/:id', require("./controller/delete${res}")); } - module.exports = router;` + module.exports = router;`; fs.writeFileSync(`./api/FHIR/${res}/index.js`, beautify(indexJs)); } } @@ -364,7 +364,7 @@ function generateMetaData() { router.get('/' , require('./controller/getMetadata')); - module.exports = router;` + module.exports = router;`; fs.writeFileSync("./api/FHIR/metadata/index.js", beautify(metadataRouteIndexText)); let metadataText = ` const uuid = require('uuid'); @@ -395,7 +395,7 @@ function generateMetaData() { } res.json(metaData); } - ` + `; fs.writeFileSync("./api/FHIR/metadata/controller/getMetadata.js", beautify(metadataText)); } /*generateAPI({ @@ -412,14 +412,14 @@ function generateConfig() { } } } - fs.writeFileSync("./config/config.js", `module.exports=${JSON.stringify(configJson, null, 4)}`); + fs.writeFileSync("./config/config.js", `module.exports=${JSON.stringify(configJson, null, 4)};`); } module.exports = { generateAPI: generateAPI, generateMetaData: generateMetaData, generateConfig: generateConfig -} +}; diff --git a/api_generator/history_model_Generator.js b/api_generator/history_model_Generator.js index 570864ab..77faabf2 100644 --- a/api_generator/history_model_Generator.js +++ b/api_generator/history_model_Generator.js @@ -17,9 +17,9 @@ function genHistoryModel() { let historyModel = ` const mongoose = require('mongoose'); const moment = require('moment'); - const _ = require('lodash') + const _ = require('lodash'); module.exports = function() { - let ${fileBaseName} = require('./${fileBaseName}').schema + let ${fileBaseName} = require('./${fileBaseName}').schema; ${fileBaseName}.id.unique = false; ${fileBaseName}.request = { "type" : Object , @@ -31,17 +31,17 @@ function genHistoryModel() { type: String , required : true } - } + }; ${fileBaseName}.response = { "type" : Object , "status" : { type : String , required : true } - } + }; let schemaConfig = { - toObject : { getters : true} , - toJSON : { getters : true} , + toObject : { getters : true}, + toJSON : { getters : true} }; if (process.env.MONGODB_IS_SHARDING_MODE == "true") { schemaConfig["shardKey"] = { @@ -57,21 +57,21 @@ function genHistoryModel() { delete result['request']; delete result['response']; return result; - } + }; ${fileBaseName}HistorySchema.methods.getFHIRBundleField = function() { let result = this.toObject(); delete result._id; delete result.__v; delete result['name._id']; return result; - } + }; const ${fileBaseName}HistoryModel = mongoose.model("${fileBaseName}_history", ${fileBaseName}HistorySchema, "${fileBaseName}_history"); return ${fileBaseName}HistoryModel; - }` + };`; fs.writeFileSync(`./models/mongodb/model/${fileBaseName}_history.js`, beautify(historyModel)); } } } -module.exports.genHistoryModel = genHistoryModel \ No newline at end of file +module.exports.genHistoryModel = genHistoryModel; \ No newline at end of file diff --git a/api_generator/parameterHandler.js b/api_generator/parameterHandler.js index 534fe5b7..7dfece83 100644 --- a/api_generator/parameterHandler.js +++ b/api_generator/parameterHandler.js @@ -18,10 +18,6 @@ function getSearchFields(field) { } class StringParameter { - Param; - Field; - ResourceDef; - constructor(param, field, resourceDef) { this.Param = param; this.Field = field; @@ -32,7 +28,7 @@ class StringParameter { return ` paramsSearch["${this.Param}"] = (query) => { if (!_.isArray(query["${this.Param}"])) { - query["${this.Param}"] = [query["${this.Param}"]] + query["${this.Param}"] = [query["${this.Param}"]]; } for (let item of query["${this.Param}"]) { let buildQs = { @@ -47,7 +43,7 @@ class StringParameter { }); } delete query["${this.Param}"]; - } + }; `; } @@ -57,7 +53,7 @@ class StringParameter { return ` paramsSearch["name"] = (query) => { if (!_.isArray(query["name"])) { - query["name"] = [query["name"]] + query["name"] = [query["name"]]; } for (let item of query["name"]) { let buildQs = { @@ -66,7 +62,7 @@ class StringParameter { for (let field of paramsSearchFields["name"]) { let buildResult = { [field] : queryBuild.stringQuery(item, field) - } + }; buildQs.$or.push(buildResult); } query.$and.push({ @@ -74,20 +70,20 @@ class StringParameter { }); } delete query['name']; - } + }; `; } else { return ` paramsSearch["name"] = (query) => { if (!_.isArray(query["name"])) { - query["name"] = [query["name"]] + query["name"] = [query["name"]]; } for (let item of query["name"]) { let buildResult = queryBuild.nameQuery(item , "name"); query.$and.push(buildResult); } delete query['name']; - } + }; `; } } @@ -96,7 +92,7 @@ class StringParameter { return ` paramsSearch["${this.Param}"] = (query) => { if (!_.isArray(query["${this.Param}"])) { - query["${this.Param}"] = [query["${this.Param}"]] + query["${this.Param}"] = [query["${this.Param}"]]; } for (let item of query["${this.Param}"]) { let buildQs = { @@ -105,7 +101,7 @@ class StringParameter { for (let field of paramsSearchFields["${this.Param}"]) { let buildResult = { [field] : queryBuild.stringQuery(item, field) - } + }; buildQs.$or.push(buildResult); } query.$and.push({ @@ -113,7 +109,7 @@ class StringParameter { }); } delete query['${this.Param}']; - } + }; `; } @@ -129,47 +125,7 @@ class StringParameter { } class TokenParameter { - Param; - Field; - ResourceDef; - ParamsSearchFieldTxt = ""; - TokenDataTypes = [ - { - dataType: "Coding", - uri: "", - code: "code" - }, - { - dataType: "CodeableConcept", - uri: "coding.system", - code: "coding.code" - }, - { - dataType: "ContactPoint", - uri: "", - code: "value" - }, - { - dataType: "Identifier", - uri: "", - code: "value" - }, - { - dataType: "code", - uri: "", - code: "" - }, - { - dataType: "string", - uri: "", - code: "" - }, - { - dataType: "boolean", - uri: "", - code: "" - } - ]; + constructor(param, field, resourceDef, paramsSearchFieldTxt= "") { this.Param = param; this.Field = field; @@ -183,11 +139,11 @@ class TokenParameter { } handlePhone() { - fixedParamsSearchFieldTxt(); + this.fixedParamsSearchFieldTxt(); return ` paramsSearch["phone"] = (query) => { if (!_.isArray(query["phone"])) { - query["phone"] = [query["phone"]] + query["phone"] = [query["phone"]]; } for (let item of query["phone"]) { let buildResult = queryBuild.tokenQuery(item, "value" , "telecom" , "phone", false); @@ -198,16 +154,16 @@ class TokenParameter { } } delete query['phone']; - } + }; `; } handleEmail() { - fixedParamsSearchFieldTxt(); + this.fixedParamsSearchFieldTxt(); return ` paramsSearch["email"] = (query) => { if (!_.isArray(query["email"])) { - query["email"] = [query["email"]] + query["email"] = [query["email"]]; } for (let item of query["email"]) { let buildResult =queryBuild.tokenQuery(item , "value" , "telecom" , "email", false); @@ -218,7 +174,7 @@ class TokenParameter { } } delete query['email']; - } + }; `; } @@ -226,7 +182,7 @@ class TokenParameter { return ` paramsSearch["identifier"] = (query) => { if (!_.isArray(query["identifier"])) { - query["identifier"] = [query["identifier"]] + query["identifier"] = [query["identifier"]]; } for (let item of query["identifier"]) { let buildQs = { @@ -241,7 +197,7 @@ class TokenParameter { }); } delete query['identifier']; - } + }; `; } @@ -253,7 +209,7 @@ class TokenParameter { return ` paramsSearch["${this.Param}"] = (query) => { if (!_.isArray(query["${this.Param}"])) { - query["${this.Param}"] = [query["${this.Param}"]] + query["${this.Param}"] = [query["${this.Param}"]]; } for (let item of query["${this.Param}"]) { let buildQs = { @@ -268,13 +224,13 @@ class TokenParameter { }); } delete query['${this.Param}']; - } + }; `; } else { return ` paramsSearch["${this.Param}"] = (query) => { if (!_.isArray(query["${this.Param}"])) { - query["${this.Param}"] = [query["${this.Param}"]] + query["${this.Param}"] = [query["${this.Param}"]]; } for (let item of query["${this.Param}"]) { let buildQs = { @@ -289,7 +245,7 @@ class TokenParameter { }); } delete query['${this.Param}']; - } + }; `; } } @@ -305,11 +261,45 @@ class TokenParameter { } } } +TokenParameter.TokenDataTypes = [ + { + dataType: "Coding", + uri: "", + code: "code" + }, + { + dataType: "CodeableConcept", + uri: "coding.system", + code: "coding.code" + }, + { + dataType: "ContactPoint", + uri: "", + code: "value" + }, + { + dataType: "Identifier", + uri: "", + code: "value" + }, + { + dataType: "code", + uri: "", + code: "" + }, + { + dataType: "string", + uri: "", + code: "" + }, + { + dataType: "boolean", + uri: "", + code: "" + } +]; class NumberParameter { - Param; - Field; - constructor(param, field) { this.Param = param; this.Field = field; @@ -318,11 +308,11 @@ class NumberParameter { getCodeString() { let txt = ""; let searchFields = getSearchFields(this.Field); - txt += `paramsSearchFields["${param}"]= ${JSON.stringify(searchFields)};`; + txt += `paramsSearchFields["${this.Param }"]= ${JSON.stringify(searchFields)};`; txt += ` paramsSearch["${this.Param}"] = (query) => { if (!_.isArray(query["${this.Param}"])) { - query["${this.Param}"] = [query["${this.Param}"]] + query["${this.Param}"] = [query["${this.Param}"]]; } for (let item of query["${this.Param}"]) { let buildQs = { @@ -331,7 +321,7 @@ class NumberParameter { for (let field of paramsSearchFields["${this.Param}"]) { let buildResult = { [field] : queryBuild.numberQuery(item, field) - } + }; buildQs.$or.push(buildResult); } query.$and.push({ @@ -339,7 +329,7 @@ class NumberParameter { }); } delete query['${this.Param}']; - } + }; `; return txt; } @@ -347,43 +337,39 @@ class NumberParameter { } class DateParameter { - Param; - Field; - ResourceDef; - NormalizeParamName; - LookUpFunc = { - "date": (field) => this.handleDate(field), - "dateTime": (field)=> this.handleDateTime(field), - "instant": (field)=> this.handleInstant(field), - "Period" : (field)=> this.handlePeriod(field), - "Timing" : (field)=> this.handleTiming(field) - } constructor(param, field, resourceDef) { this.Param = param; this.Field = field; this.ResourceDef = resourceDef; this.NormalizeParamName = this.Param.replace(/-/gm, "_"); + this.LookUpFunc = { + "date": (field) => this.handleDate(field), + "dateTime": (field)=> this.handleDateTime(field), + "instant": (field)=> this.handleInstant(field), + "Period" : (field)=> this.handlePeriod(field), + "Timing" : (field)=> this.handleTiming(field) + }; } handleDate(field) { return ` ${this.NormalizeParamName}SearchFunc["${field}"] = (value, field) => { return queryBuild.dateQuery(value , field); - } + }; `; } handleDateTime(field) { return ` ${this.NormalizeParamName}SearchFunc["${field}"] = (value, field) => { return queryBuild.dateTimeQuery(value , field); - } + }; `; } handleInstant(field) { return ` ${this.NormalizeParamName}SearchFunc["${field}"] = (value, field) => { return queryBuild.instantQuery(value , field); - } + }; `; } @@ -391,7 +377,7 @@ class DateParameter { return ` ${this.NormalizeParamName}SearchFunc["${field}"] = (value, field) => { return queryBuild.periodQuery(value , field); - } + }; `; } @@ -399,7 +385,7 @@ class DateParameter { return ` ${this.NormalizeParamName}SearchFunc["${field}"] = (value, field) => { return queryBuild.timingQuery(value , field); - } + }; `; } @@ -420,14 +406,14 @@ class DateParameter { codeStr += ` paramsSearch["${this.Param}"] = (query) => { if (!_.isArray(query["${this.Param}"])) { - query["${this.Param}"] = [query["${this.Param}"]] + query["${this.Param}"] = [query["${this.Param}"]]; } for (let item of query["${this.Param}"]) { let buildQs = { $or: [] }; for (let field of paramsSearchFields["${this.Param}"]) { - let buildResult = ${this.Param}SearchFunc[field](item, field); + let buildResult = ${this.NormalizeParamName}SearchFunc[field](item, field); buildQs.$or.push(buildResult); } query.$and.push({ @@ -435,16 +421,13 @@ class DateParameter { }); } delete query['${this.Param}']; - } + }; `; return codeStr; } } class ReferenceParameter { - Param; - Field; - constructor(param, field) { this.Param = param; this.Field = field; @@ -468,7 +451,7 @@ class ReferenceParameter { txt += ` paramsSearch["${this.Param}"] = (query) => { if (!_.isArray(query["${this.Param}"])) { - query["${this.Param}"] = [query["${this.Param}"]] + query["${this.Param}"] = [query["${this.Param}"]]; } for (let item of query["${this.Param}"]) { @@ -484,7 +467,7 @@ class ReferenceParameter { }); } delete query['${this.Param}']; - } + }; `; return txt; } @@ -496,4 +479,4 @@ module.exports = { NumberParameter: NumberParameter, DateParameter: DateParameter, ReferenceParameter: ReferenceParameter -} \ No newline at end of file +}; \ No newline at end of file diff --git a/api_generator/searchParametersCodeGenerator.js b/api_generator/searchParametersCodeGenerator.js index 9f0296ba..c4e45331 100644 --- a/api_generator/searchParametersCodeGenerator.js +++ b/api_generator/searchParametersCodeGenerator.js @@ -1,3 +1,4 @@ +const { capitalizeFirstLetter } = require('normalize-text'); const { StringParameter, TokenParameter, NumberParameter, DateParameter, ReferenceParameter } = require('./parameterHandler'); const genParamFunc = { @@ -50,8 +51,8 @@ const genParamFunc = { let referenceParameterHandler = new ReferenceParameter(param, field); return referenceParameterHandler.getCodeString(); } -} +}; module.exports = { genParamFunc: genParamFunc -} +}; diff --git a/config/config.template.js b/config/config.template.js index 9e97899e..5685e802 100644 --- a/config/config.template.js +++ b/config/config.template.js @@ -10,4 +10,4 @@ module.exports = { "search": true } } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/FHIR/func.js b/models/FHIR/func.js index dad6d43e..00eaed8b 100644 --- a/models/FHIR/func.js +++ b/models/FHIR/func.js @@ -50,7 +50,7 @@ function getPreviousUrl(params , http ="http" , resource) { } function getEntryFullUrl(item , http="http" ,resource) { - let url = `${http}://${process.env.FHIRSERVER_HOST}:${process.env.FHIRSERVER_PORT}/${process.env.FHIRSERVER_APIPATH}/${resource}/${item.id}` + let url = `${http}://${process.env.FHIRSERVER_HOST}:${process.env.FHIRSERVER_PORT}/${process.env.FHIRSERVER_APIPATH}/${resource}/${item.id}`; return url; } @@ -130,4 +130,4 @@ function createBundle (req , docs , count , skip , limit , resource , option) { module.exports = { createBundle : createBundle , getEntryFullUrl : getEntryFullUrl -} +}; diff --git a/models/FHIR/httpMessage.js b/models/FHIR/httpMessage.js index 7d5e6788..efe7f427 100644 --- a/models/FHIR/httpMessage.js +++ b/models/FHIR/httpMessage.js @@ -49,10 +49,10 @@ const handleError = { "security": (err) => getOperationOutCome(err, "security"), "expired": (err) => getOperationOutCome(err, "expired"), "forbidden": (err) => getOperationOutCome(err, "forbidden") -} +}; module.exports = { getDeleteMessage : getDeleteMessage , handleError : handleError -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/FHIR/queryBuild.js b/models/FHIR/queryBuild.js index c017c809..5c2f9d4f 100644 --- a/models/FHIR/queryBuild.js +++ b/models/FHIR/queryBuild.js @@ -8,7 +8,7 @@ function stringQuery(str, key) { const buildContainsOrExact = { "contains": stringContains, "exact": stringExact - } + }; let buildFunc = { '1': () => { return stringContainStart(str); @@ -17,7 +17,7 @@ function stringQuery(str, key) { let modifier = keySplit[1]; return buildContainsOrExact[modifier](str); } - } + }; return buildFunc[keySplit.length](); } @@ -73,12 +73,12 @@ function tokenQuery(item, type, field, required , isCodeableConcept = false) { for(let i in queryBuilder) { ors.$or.push({ [i] : queryBuilder[i] - }) + }); } return ors; } return queryBuilder; -}; +} function quantityQuery(item, field) { let queryBuilder = {}; @@ -104,12 +104,12 @@ function quantityQuery(item, field) { for(let i in queryBuilder) { ors.$or.push({ [i] : queryBuilder[i] - }) + }); } return ors; } return queryBuilder; -}; +} function addressQuery(target , key) { @@ -128,7 +128,7 @@ function addressQuery(target , key) { ); } return ors; -}; +} function nameQuery(target , key) { let totalSplit = target.split(/[\s.,]+/); @@ -145,7 +145,8 @@ function nameQuery(target , key) { ); } return ors; -}; +} + let dateQueryBuilder = { "eq" : (queryBuilder, field , date , format) => { let gte = moment(date).startOf(format); @@ -153,7 +154,7 @@ let dateQueryBuilder = { let result = { "$gte" : gte.toDate() , "$lte" : lte.toDate() - } + }; queryBuilder[field] = result; return queryBuilder; } , @@ -164,7 +165,7 @@ let dateQueryBuilder = { $or : [ { [field] : { - "$gte" : moment(gd).toDate() , + "$gte" : moment(gd).toDate() } } , { @@ -173,39 +174,39 @@ let dateQueryBuilder = { } } ] - } + }; queryBuilder = result; return queryBuilder; } , "lt" : (queryBuilder, field , date , format) => { let result = { "$lt" : moment(date).toDate() - } + }; queryBuilder[field] = result; return queryBuilder; } , "gt" : (queryBuilder, field , date , format) => { let result = { "$gt" : moment(date).toDate() - } + }; queryBuilder[field] = result; return queryBuilder; } , "ge" : (queryBuilder, field , date , format) => { let result = { "$gte" : moment(date).toDate() - } + }; queryBuilder[field] = result; return queryBuilder; } , "le" : (queryBuilder, field , date , format) => { let result = { "$lte" : moment(date).toDate() - } + }; queryBuilder[field] = result; return queryBuilder; } -} +}; function dateQuery (value, field) { let queryBuilder = {}; let date = value.substring(2); @@ -290,7 +291,7 @@ function periodQuery(value , field) { ...queryOfEnd } ] - } + }; return query; } @@ -319,46 +320,46 @@ let instantQueryBuilder ={ "eq": (queryBuilder, field, date) => { let result = { "$eq": date - } + }; queryBuilder[field] = result; return queryBuilder; }, "ne": (queryBuilder, field, date) => { let result = { "$ne": date - } + }; queryBuilder[field] = result; return queryBuilder; }, "lt" : (queryBuilder, field, date) => { let result = { "$lt": date - } + }; queryBuilder[field] = result; return queryBuilder; }, "gt" : (queryBuilder, field, date) => { let result = { "$gt": date - } + }; queryBuilder[field] = result; return queryBuilder; }, "ge" : (queryBuilder, field, date) => { let result = { "$gte": date - } + }; queryBuilder[field] = result; return queryBuilder; }, "le" : (queryBuilder, field, date) => { let result = { "$lte": date - } + }; queryBuilder[field] = result; return queryBuilder; } -} +}; function instantQuery(value, field) { @@ -375,12 +376,12 @@ function instantQuery(value, field) { } if (date.includes("+")) { let dateSplitPlus = date.split("+"); - let inputTimezone = `-${dateSplitPlus.pop().replace(":","")}` + let inputTimezone = `-${dateSplitPlus.pop().replace(":","")}`; let realDate = moment(dateSplitPlus.join("")).format("YYYY-MM-DDTHH:mm:ss.SSS"); date = moment(realDate).utc(true).utcOffset(inputTimezone).format("YYYY-MM-DDTHH:mm:ss.SSS"); } else if (date.includes("-") && date.match(/:/g).length == 3) { let dateSplitHyphen = date.split("-"); - let inputTimezone = `+${dateSplitHyphen.pop().replace(":", "")}` + let inputTimezone = `+${dateSplitHyphen.pop().replace(":", "")}`; let realDate = moment(dateSplitHyphen.join("-")).format("YYYY-MM-DDTHH:mm:ss.SSS"); date = moment(realDate).utc(true).utcOffset(inputTimezone).format("YYYY-MM-DDTHH:mm:ss.SSS"); } else { @@ -399,11 +400,11 @@ function referenceQuery (query , field) { if (isUrl) { _.set(queryBuilder , field , isUrl[3]); queryBuilder[field] = isUrl[3]; - return result; + return queryBuilder; } else if (typeAndId.length == 2) { - queryBuilder[field] = `${typeAndId[0]}/${typeAndId[1]}` + queryBuilder[field] = `${typeAndId[0]}/${typeAndId[1]}`; } else { - queryBuilder[field] = {$regex : new RegExp(query)} + queryBuilder[field] = {$regex : new RegExp(query)}; } return queryBuilder; } @@ -426,49 +427,42 @@ let numberQueryBuilder = { "eq" : (queryBuilder, field , num) => { let result = { "$eq" : Number(num) - } + }; queryBuilder[field] = result; return queryBuilder; } , "ne" : (queryBuilder, field , num) => { let result = { "$ne" : Number(num) - } - queryBuilder[field] = result; - return queryBuilder; - } , - "ne" : (queryBuilder, field , num) => { - let result = { - "$eq" : Number(num) - } + }; queryBuilder[field] = result; return queryBuilder; } , "gt" : (queryBuilder, field , num) => { let result = { "$gt" : Number(num) - } + }; queryBuilder[field] = result; return queryBuilder; } , "lt" : (queryBuilder, field , num) => { let result = { "$lt" : Number(num) - } + }; queryBuilder[field] = result; return queryBuilder; } , "ge" : (queryBuilder, field , num) => { let result = { "$gte" : Number(num) - } + }; queryBuilder[field] = result; return queryBuilder; } , "le" : (queryBuilder, field , num) => { let result = { "$lte" : Number(num) - } + }; queryBuilder[field] = result; return queryBuilder; } , @@ -480,9 +474,8 @@ let numberQueryBuilder = { } , "ap" : (queryBuilder, field , num) => { return new Error("not support prefix"); - } , - -} + } +}; function numberQuery (value, field) { try { let queryBuilder = {}; @@ -513,4 +506,4 @@ module.exports = { quantityQuery : quantityQuery , referenceQuery : referenceQuery , arrayStringBuild : arrayStringBuild -} +}; diff --git a/models/FHIR/resourceType.js b/models/FHIR/resourceType.js index 56aa47a9..b6fddf52 100644 --- a/models/FHIR/resourceType.js +++ b/models/FHIR/resourceType.js @@ -145,4 +145,4 @@ module.exports = [ "ValueSet", "VerificationResult", "VisionPrescription" -] \ No newline at end of file +]; \ No newline at end of file diff --git a/models/mongodb/FHIRDataTypesSchema/base64Binary.js b/models/mongodb/FHIRDataTypesSchema/base64Binary.js index 2cfbdea0..e5c44d04 100644 --- a/models/mongodb/FHIRDataTypesSchema/base64Binary.js +++ b/models/mongodb/FHIRDataTypesSchema/base64Binary.js @@ -2,4 +2,4 @@ const moment = require('moment'); module.exports = { type: String, default: void 0 -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/FHIRDataTypesSchema/boolean.js b/models/mongodb/FHIRDataTypesSchema/boolean.js index 3ce84296..141bece1 100644 --- a/models/mongodb/FHIRDataTypesSchema/boolean.js +++ b/models/mongodb/FHIRDataTypesSchema/boolean.js @@ -7,4 +7,4 @@ module.exports = { message: props => `${props.value} is not a valid boolean!` }, default: void 0 -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/FHIRDataTypesSchema/canonical.js b/models/mongodb/FHIRDataTypesSchema/canonical.js index 0fbccaeb..c4a3f6c9 100644 --- a/models/mongodb/FHIRDataTypesSchema/canonical.js +++ b/models/mongodb/FHIRDataTypesSchema/canonical.js @@ -7,4 +7,4 @@ module.exports = { message: props => `${props.value} is not a valid canonical!` }, default: void 0 -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/FHIRDataTypesSchema/code.js b/models/mongodb/FHIRDataTypesSchema/code.js index 357d015e..d74a3b02 100644 --- a/models/mongodb/FHIRDataTypesSchema/code.js +++ b/models/mongodb/FHIRDataTypesSchema/code.js @@ -7,4 +7,4 @@ module.exports = { message: props => `${props.value} is not a valid code!` }, default: void 0 -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/FHIRDataTypesSchema/date.js b/models/mongodb/FHIRDataTypesSchema/date.js index 7555398f..b7785aba 100644 --- a/models/mongodb/FHIRDataTypesSchema/date.js +++ b/models/mongodb/FHIRDataTypesSchema/date.js @@ -5,4 +5,4 @@ module.exports = { get: function(v) { if (v) return moment(v).format('YYYY-MM-DD'); } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/FHIRDataTypesSchema/dateTime.js b/models/mongodb/FHIRDataTypesSchema/dateTime.js index bc0e3996..6c116a84 100644 --- a/models/mongodb/FHIRDataTypesSchema/dateTime.js +++ b/models/mongodb/FHIRDataTypesSchema/dateTime.js @@ -5,4 +5,4 @@ module.exports = { get: function(v) { if (v) return moment(v).format('YYYY-MM-DDTHH:mm:ssZ'); } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/FHIRDataTypesSchema/decimal.js b/models/mongodb/FHIRDataTypesSchema/decimal.js index 74a28bb6..6b373025 100644 --- a/models/mongodb/FHIRDataTypesSchema/decimal.js +++ b/models/mongodb/FHIRDataTypesSchema/decimal.js @@ -7,4 +7,4 @@ module.exports = { message: props => `${props.value} is not a valid decimal!` }, default: void 0 -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/FHIRDataTypesSchema/id.js b/models/mongodb/FHIRDataTypesSchema/id.js index b695564a..7634430f 100644 --- a/models/mongodb/FHIRDataTypesSchema/id.js +++ b/models/mongodb/FHIRDataTypesSchema/id.js @@ -7,4 +7,4 @@ module.exports = { message: props => `${props.value} is not a valid id!` }, default: void 0 -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/FHIRDataTypesSchema/instant.js b/models/mongodb/FHIRDataTypesSchema/instant.js index 13e6b3c5..3506a127 100644 --- a/models/mongodb/FHIRDataTypesSchema/instant.js +++ b/models/mongodb/FHIRDataTypesSchema/instant.js @@ -4,5 +4,5 @@ module.exports = { get: function(v) { if (v) return moment(v).format("YYYY-MM-DDTHH:mm:ss.SSSZ"); } , - default: void 0, -} \ No newline at end of file + default: void 0 +}; \ No newline at end of file diff --git a/models/mongodb/FHIRDataTypesSchema/integer.js b/models/mongodb/FHIRDataTypesSchema/integer.js index 53f7a172..e1435fbc 100644 --- a/models/mongodb/FHIRDataTypesSchema/integer.js +++ b/models/mongodb/FHIRDataTypesSchema/integer.js @@ -7,4 +7,4 @@ module.exports = { message: props => `${props.value} is not a valid integer!` }, default: void 0 -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/FHIRDataTypesSchema/markdown.js b/models/mongodb/FHIRDataTypesSchema/markdown.js index c0d24185..da9db72f 100644 --- a/models/mongodb/FHIRDataTypesSchema/markdown.js +++ b/models/mongodb/FHIRDataTypesSchema/markdown.js @@ -7,4 +7,4 @@ module.exports = { message: props => `${props.value} is not a valid markdown!` }, default: void 0 -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/FHIRDataTypesSchema/oid.js b/models/mongodb/FHIRDataTypesSchema/oid.js index 0f11d90a..5d5b124c 100644 --- a/models/mongodb/FHIRDataTypesSchema/oid.js +++ b/models/mongodb/FHIRDataTypesSchema/oid.js @@ -7,4 +7,4 @@ module.exports = { message: props => `${props.value} is not a valid oid!` }, default: void 0 -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/FHIRDataTypesSchema/positiveInt.js b/models/mongodb/FHIRDataTypesSchema/positiveInt.js index 8cdbdbe8..88613067 100644 --- a/models/mongodb/FHIRDataTypesSchema/positiveInt.js +++ b/models/mongodb/FHIRDataTypesSchema/positiveInt.js @@ -7,4 +7,4 @@ module.exports = { message: props => `${props.value} is not a valid positiveInt!` }, default: void 0 -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/FHIRDataTypesSchema/string.js b/models/mongodb/FHIRDataTypesSchema/string.js index 25e2d031..30ac013a 100644 --- a/models/mongodb/FHIRDataTypesSchema/string.js +++ b/models/mongodb/FHIRDataTypesSchema/string.js @@ -7,4 +7,4 @@ module.exports = { message: props => `${props.value} is not a valid string!` }, default: void 0 -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/FHIRDataTypesSchema/time.js b/models/mongodb/FHIRDataTypesSchema/time.js index e8e8a4be..1cc15957 100644 --- a/models/mongodb/FHIRDataTypesSchema/time.js +++ b/models/mongodb/FHIRDataTypesSchema/time.js @@ -25,4 +25,4 @@ module.exports = { } } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/FHIRDataTypesSchema/unsignedInt.js b/models/mongodb/FHIRDataTypesSchema/unsignedInt.js index 727688cb..46e11a05 100644 --- a/models/mongodb/FHIRDataTypesSchema/unsignedInt.js +++ b/models/mongodb/FHIRDataTypesSchema/unsignedInt.js @@ -7,4 +7,4 @@ module.exports = { message: props => `${props.value} is not a valid unsignedInt!` }, default: void 0 -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/FHIRDataTypesSchema/uri.js b/models/mongodb/FHIRDataTypesSchema/uri.js index 9cf595de..1a561fc7 100644 --- a/models/mongodb/FHIRDataTypesSchema/uri.js +++ b/models/mongodb/FHIRDataTypesSchema/uri.js @@ -10,4 +10,4 @@ module.exports = { if (v) return encodeURI(v); }, default: void 0 -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/FHIRDataTypesSchema/url.js b/models/mongodb/FHIRDataTypesSchema/url.js index edbd97cd..62a39aba 100644 --- a/models/mongodb/FHIRDataTypesSchema/url.js +++ b/models/mongodb/FHIRDataTypesSchema/url.js @@ -10,4 +10,4 @@ module.exports = { if (v) return encodeURI(v); }, default: void 0 -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/FHIRDataTypesSchema/uuid.js b/models/mongodb/FHIRDataTypesSchema/uuid.js index dd9a2772..1a019316 100644 --- a/models/mongodb/FHIRDataTypesSchema/uuid.js +++ b/models/mongodb/FHIRDataTypesSchema/uuid.js @@ -7,4 +7,4 @@ module.exports = { message: props => `${props.value} is not a valid uuid!` }, default: void 0 -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/FHIRDataTypesSchema/xhtml.js b/models/mongodb/FHIRDataTypesSchema/xhtml.js index 2cfbdea0..e5c44d04 100644 --- a/models/mongodb/FHIRDataTypesSchema/xhtml.js +++ b/models/mongodb/FHIRDataTypesSchema/xhtml.js @@ -2,4 +2,4 @@ const moment = require('moment'); module.exports = { type: String, default: void 0 -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/FHIRTypeSchema/Bundle.js b/models/mongodb/FHIRTypeSchema/Bundle.js index ff8ad42c..2fb14f5e 100644 --- a/models/mongodb/FHIRTypeSchema/Bundle.js +++ b/models/mongodb/FHIRTypeSchema/Bundle.js @@ -1,6 +1,6 @@ class Bundle { constructor() { - this.resourceType = "Bundle" + this.resourceType = "Bundle"; this.type = "" ; this.total = 0 ; this.link = []; @@ -31,5 +31,5 @@ module.exports = { Bundle : Bundle , entry : entry , link : link -} +}; diff --git a/models/mongodb/connector.js b/models/mongodb/connector.js index 81949860..27197246 100644 --- a/models/mongodb/connector.js +++ b/models/mongodb/connector.js @@ -16,7 +16,7 @@ module.exports = exports = function(config) { hosts.forEach((host, index) => { if (index == 0) { - databaseUrl += `mongodb://${host}:${ports[0]}` + databaseUrl += `mongodb://${host}:${ports[0]}`; } else { databaseUrl += `,${dbName}`; } @@ -65,18 +65,18 @@ module.exports = exports = function(config) { function getCollections (dirname, collectionObj) { let jsFilesInDir = fs.readdirSync(__dirname + dirname) - .filter((file) => (file.indexOf('.') !== 0) && (file !== basename) && (file.slice(-3) === '.js')) + .filter((file) => (file.indexOf('.') !== 0) && (file !== basename) && (file.slice(-3) === '.js')); for (let file of jsFilesInDir) { const moduleName = file.split('.')[0]; console.log('moduleName :: ', moduleName); - console.log('path : ', __dirname + dirname) + console.log('path : ', __dirname + dirname); collectionObj[moduleName] = require(__dirname + dirname +'/' + moduleName)(mongoose); } } function shardCollection(dirname) { let jsFilesInDir = fs.readdirSync(__dirname + dirname) - .filter((file) => (file.indexOf('.') !== 0) && (file !== basename) && (file.slice(-3) === '.js')) + .filter((file) => (file.indexOf('.') !== 0) && (file !== basename) && (file.slice(-3) === '.js')); for (let file of jsFilesInDir) { const moduleName = file.split('.')[0]; if (process.env.MONGODB_IS_SHARDING_MODE == "true") { diff --git a/models/mongodb/model/Patient.js b/models/mongodb/model/Patient.js index bf0e3a4a..4bf97d57 100644 --- a/models/mongodb/model/Patient.js +++ b/models/mongodb/model/Patient.js @@ -137,11 +137,11 @@ module.exports = function() { Patient.id = { ...id, index: true - } + }; Patient.contained = { type: [Object], default: void 0 - } + }; module.exports.schema = Patient; let schemaConfig = { toObject: { @@ -169,7 +169,7 @@ module.exports = function() { _.set(result, "collection", tempCollectionField); } return result; - } + }; PatientSchema.pre('save', async function(next) { let mongodb = require('../index'); @@ -296,4 +296,4 @@ module.exports = function() { const PatientModel = mongoose.model("Patient", PatientSchema, "Patient"); return PatientModel; -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/model/Patient_history.js b/models/mongodb/model/Patient_history.js index 968f8e85..0349ec49 100644 --- a/models/mongodb/model/Patient_history.js +++ b/models/mongodb/model/Patient_history.js @@ -1,8 +1,8 @@ const mongoose = require('mongoose'); const moment = require('moment'); -const _ = require('lodash') +const _ = require('lodash'); module.exports = function() { - let Patient = require('./Patient').schema + let Patient = require('./Patient').schema; Patient.id.unique = false; Patient.request = { "type": Object, @@ -14,21 +14,21 @@ module.exports = function() { type: String, required: true } - } + }; Patient.response = { "type": Object, "status": { type: String, required: true } - } + }; let schemaConfig = { toObject: { getters: true }, toJSON: { getters: true - }, + } }; if (process.env.MONGODB_IS_SHARDING_MODE == "true") { schemaConfig["shardKey"] = { @@ -44,15 +44,15 @@ module.exports = function() { delete result['request']; delete result['response']; return result; - } + }; PatientHistorySchema.methods.getFHIRBundleField = function() { let result = this.toObject(); delete result._id; delete result.__v; delete result['name._id']; return result; - } + }; const PatientHistoryModel = mongoose.model("Patient_history", PatientHistorySchema, "Patient_history"); return PatientHistoryModel; -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/staticModel/FHIRStoredID.js b/models/mongodb/staticModel/FHIRStoredID.js index b832b5eb..35d22813 100644 --- a/models/mongodb/staticModel/FHIRStoredID.js +++ b/models/mongodb/staticModel/FHIRStoredID.js @@ -21,4 +21,4 @@ module.exports = function (mongodb) { }); let FHIRStoredID = mongodb.model('FHIRStoredID', FHIRStoredIDSchema, 'FHIRStoredID'); return FHIRStoredID; -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/mongodb/staticModel/issuedToken.js b/models/mongodb/staticModel/issuedToken.js index 81d8164d..d06664e3 100644 --- a/models/mongodb/staticModel/issuedToken.js +++ b/models/mongodb/staticModel/issuedToken.js @@ -62,7 +62,7 @@ module.exports = function (mongodb) { } },{ strict: false, - versionKey : false, + versionKey : false }); issuedTokenSchema.index({ @@ -71,4 +71,4 @@ module.exports = function (mongodb) { let issuedToken = mongodb.model('issuedToken', issuedTokenSchema, 'issuedToken'); return issuedToken; -} \ No newline at end of file +}; \ No newline at end of file diff --git a/models/user/passport.js b/models/user/passport.js index e24c6f6d..9cc88b6c 100644 --- a/models/user/passport.js +++ b/models/user/passport.js @@ -56,7 +56,7 @@ module.exports = function (passport) { if (username === process.env.ADMIN_USERNAME && password === process.env.ADMIN_PASSWORD) { return done(null ,username); } - return done(null, false, 'Invalid user or password') + return done(null, false, 'Invalid user or password'); })); passport.use(new BearerStrategy( @@ -67,7 +67,7 @@ module.exports = function (passport) { return done(null, user.account, { scope: 'all' }); }); } - )) + )); }; async function My_Auth(username , password) { diff --git a/package-lock.json b/package-lock.json index 05b278a0..23dbd19c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,6 +39,203 @@ "uid-generator": "^2.0.0", "uuid": "^8.3.2", "xml-js": "^1.6.11" + }, + "devDependencies": { + "babel-eslint": "^10.1.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/generator": { + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.8.tgz", + "integrity": "sha512-1ojZwE9+lOXzcWdWmO6TbUzDfqLD39CmEhN8+2cX9XkDo5yW1OpgfejfliysR2AWLpMamTiOiAp/mtroaymhpw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.8", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", + "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", + "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", + "dev": true, + "dependencies": { + "@babel/helper-get-function-arity": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-get-function-arity": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", + "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", + "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.16.12", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.12.tgz", + "integrity": "sha512-VfaV15po8RiZssrkPweyvbGVSe4x2y+aciFCgn0n0/SJMR22cwofRV1mtnJQYcSB1wUTaA/X1LnA3es66MCO5A==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/template": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.10.tgz", + "integrity": "sha512-yzuaYXoRJBGMlBhsMJoUW7G1UmSb/eXr/JHYM/MsOJgavJibLwASijW7oXBdw3NQ6T0bW7Ty5P/VarOs9cHmqw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.8", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.16.10", + "@babel/types": "^7.16.8", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/traverse/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/@babel/types": { + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.8.tgz", + "integrity": "sha512-smN2DQc5s4M7fntyjGtyIPbRJv6wW4rU/94fmYJ7PKQuZkC0qGMHXJbg6sNGt12JmVr4k5YaptI/XtiLJBnmIg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@bitty/pipe": { @@ -46,6 +243,78 @@ "resolved": "https://registry.npmjs.org/@bitty/pipe/-/pipe-0.2.2.tgz", "integrity": "sha512-XRlh5DP+l3gbo27Kggf6uZ5XcfYJHoeZ0xlEGhiG9QWxu5+H+TVwvy5hdfjsSHreyN86k8GaozWnIxSdS/neUw==" }, + "node_modules/@eslint/eslintrc": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", + "integrity": "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==", + "dev": true, + "peer": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.2.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc/node_modules/debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "peer": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", + "dev": true, + "peer": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "peer": true + }, "node_modules/@hapi/hoek": { "version": "9.2.1", "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.2.1.tgz", @@ -59,6 +328,53 @@ "@hapi/hoek": "^9.0.0" } }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.3.tgz", + "integrity": "sha512-3xSMlXHh03hCcCmFc0rbKp3Ivt2PFEJnQUJDDMTJQ2wkECZWdq4GePs2ctc5H8zV+cHPaq8k2vU8mrQjA6iHdQ==", + "dev": true, + "peer": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "peer": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "peer": true + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true, + "peer": true + }, "node_modules/@mapbox/node-pre-gyp": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.8.tgz", @@ -146,6 +462,29 @@ "node": ">= 0.6" } }, + "node_modules/acorn": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "dev": true, + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peer": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -178,6 +517,23 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -227,6 +583,13 @@ "node": ">= 6" } }, + "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==", + "dev": true, + "peer": true + }, "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -237,6 +600,27 @@ "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" }, + "node_modules/babel-eslint": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", + "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", + "deprecated": "babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0", + "eslint-visitor-keys": "^1.0.0", + "resolve": "^1.12.0" + }, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "eslint": ">= 4.12.1" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -319,6 +703,16 @@ "node": ">= 0.8" } }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -505,6 +899,21 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "peer": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -513,6 +922,13 @@ "ms": "2.0.0" } }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "peer": true + }, "node_modules/delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", @@ -550,6 +966,19 @@ "node": ">=0.10" } }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "peer": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/dotenv": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-6.2.0.tgz", @@ -633,6 +1062,322 @@ "node": ">=0.8.0" } }, + "node_modules/eslint": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.7.0.tgz", + "integrity": "sha512-ifHYzkBGrzS2iDU7KjhCAVMGCvF6M3Xfs8X8b37cgrUlDt6bWRTpRh6T/gtSXv1HJ/BUGgmjvNvOEGu85Iif7w==", + "dev": true, + "peer": true, + "dependencies": { + "@eslint/eslintrc": "^1.0.5", + "@humanwhocodes/config-array": "^0.9.2", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.0", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.2.0", + "espree": "^9.3.0", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^6.0.1", + "globals": "^13.6.0", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-scope": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", + "integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==", + "dev": true, + "peer": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "peer": true, + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "peer": true + }, + "node_modules/eslint/node_modules/debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "peer": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz", + "integrity": "sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ==", + "dev": true, + "peer": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint/node_modules/globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", + "dev": true, + "peer": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "peer": true + }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/espree": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.0.tgz", + "integrity": "sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ==", + "dev": true, + "peer": true, + "dependencies": { + "acorn": "^8.7.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^3.1.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz", + "integrity": "sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ==", + "dev": true, + "peer": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "peer": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "peer": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -753,6 +1498,40 @@ } ] }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "peer": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "peer": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true, + "peer": true + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "peer": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, "node_modules/filelist": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.2.tgz", @@ -778,6 +1557,27 @@ "node": ">= 0.8" } }, + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "peer": true, + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", + "dev": true, + "peer": true + }, "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -810,6 +1610,19 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true, + "peer": true + }, "node_modules/gauge": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", @@ -848,6 +1661,40 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "peer": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -920,6 +1767,53 @@ "node": ">=0.10.0" } }, + "node_modules/ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "peer": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.8.19" + } + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -947,6 +1841,28 @@ "node": ">= 0.10" } }, + "node_modules/is-core-module": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", + "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -955,11 +1871,31 @@ "node": ">=8" } }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "peer": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true, + "peer": true + }, "node_modules/jake": { "version": "10.8.2", "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.2.tgz", @@ -1008,6 +1944,51 @@ "node": ">=10" } }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "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==", + "dev": true, + "peer": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "peer": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true, + "peer": true + }, "node_modules/jsonwebtoken": { "version": "8.5.1", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", @@ -1066,6 +2047,20 @@ "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.2.tgz", "integrity": "sha512-STHz9P7X2L4Kwn72fA4rGyqyXdmrMSdxqHx9IXon/FXluXieaFA6KJ2upcHAHxQPQ0LeM/OjLrhFxifHewOALQ==" }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "peer": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -1101,6 +2096,13 @@ "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "peer": true + }, "node_modules/lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", @@ -1471,6 +2473,13 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true, + "peer": true + }, "node_modules/negotiator": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", @@ -1579,6 +2588,37 @@ "node": ">=4" } }, + "node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "peer": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "peer": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -1637,6 +2677,22 @@ "node": ">=0.10.0" } }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, "node_modules/path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", @@ -1655,6 +2711,16 @@ "node": ">=4" } }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -1682,6 +2748,16 @@ "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, "node_modules/qs": { "version": "6.9.6", "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.6.tgz", @@ -1742,6 +2818,19 @@ "resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-1.0.0.tgz", "integrity": "sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw==" }, + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, "node_modules/require_optional": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz", @@ -1767,6 +2856,23 @@ "node": ">=4" } }, + "node_modules/resolve": { + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.8.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/resolve-from": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", @@ -1903,6 +3009,29 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "peer": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, "node_modules/sift": { "version": "13.5.2", "resolved": "https://registry.npmjs.org/sift/-/sift-13.5.2.tgz", @@ -1923,6 +3052,15 @@ "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/sparse-bitfield": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", @@ -1972,6 +3110,19 @@ "node": ">=8" } }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -1983,6 +3134,18 @@ "node": ">=4" } }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/tar": { "version": "6.1.11", "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", @@ -2004,6 +3167,22 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true, + "peer": true + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", @@ -2017,6 +3196,32 @@ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "peer": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -2056,6 +3261,16 @@ "node": ">= 0.8" } }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "peer": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -2077,6 +3292,13 @@ "uuid": "dist/bin/uuid" } }, + "node_modules/v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true, + "peer": true + }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -2099,6 +3321,22 @@ "webidl-conversions": "^3.0.0" } }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "peer": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/wide-align": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", @@ -2107,34 +3345,244 @@ "string-width": "^1.0.2 || 2 || 3 || 4" } }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, - "node_modules/xml-js": { - "version": "1.6.11", - "resolved": "https://registry.npmjs.org/xml-js/-/xml-js-1.6.11.tgz", - "integrity": "sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==", - "dependencies": { - "sax": "^1.2.4" - }, - "bin": { - "xml-js": "bin/cli.js" + "node_modules/xml-js": { + "version": "1.6.11", + "resolved": "https://registry.npmjs.org/xml-js/-/xml-js-1.6.11.tgz", + "integrity": "sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==", + "dependencies": { + "sax": "^1.2.4" + }, + "bin": { + "xml-js": "bin/cli.js" + } + }, + "node_modules/yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + } + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.16.7" + } + }, + "@babel/generator": { + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.8.tgz", + "integrity": "sha512-1ojZwE9+lOXzcWdWmO6TbUzDfqLD39CmEhN8+2cX9XkDo5yW1OpgfejfliysR2AWLpMamTiOiAp/mtroaymhpw==", + "dev": true, + "requires": { + "@babel/types": "^7.16.8", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-environment-visitor": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", + "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-function-name": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", + "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", + "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-hoist-variables": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", + "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.16.7", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.16.12", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.12.tgz", + "integrity": "sha512-VfaV15po8RiZssrkPweyvbGVSe4x2y+aciFCgn0n0/SJMR22cwofRV1mtnJQYcSB1wUTaA/X1LnA3es66MCO5A==", + "dev": true + }, + "@babel/template": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" + } + }, + "@babel/traverse": { + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.10.tgz", + "integrity": "sha512-yzuaYXoRJBGMlBhsMJoUW7G1UmSb/eXr/JHYM/MsOJgavJibLwASijW7oXBdw3NQ6T0bW7Ty5P/VarOs9cHmqw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.8", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.16.10", + "@babel/types": "^7.16.8", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "dependencies": { + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.8.tgz", + "integrity": "sha512-smN2DQc5s4M7fntyjGtyIPbRJv6wW4rU/94fmYJ7PKQuZkC0qGMHXJbg6sNGt12JmVr4k5YaptI/XtiLJBnmIg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" } }, - "node_modules/yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" - } - }, - "dependencies": { "@bitty/pipe": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/@bitty/pipe/-/pipe-0.2.2.tgz", "integrity": "sha512-XRlh5DP+l3gbo27Kggf6uZ5XcfYJHoeZ0xlEGhiG9QWxu5+H+TVwvy5hdfjsSHreyN86k8GaozWnIxSdS/neUw==" }, + "@eslint/eslintrc": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", + "integrity": "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==", + "dev": true, + "peer": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.2.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "peer": true, + "requires": { + "ms": "2.1.2" + } + }, + "globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", + "dev": true, + "peer": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true, + "peer": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "peer": true + } + } + }, "@hapi/hoek": { "version": "9.2.1", "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.2.1.tgz", @@ -2148,6 +3596,44 @@ "@hapi/hoek": "^9.0.0" } }, + "@humanwhocodes/config-array": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.3.tgz", + "integrity": "sha512-3xSMlXHh03hCcCmFc0rbKp3Ivt2PFEJnQUJDDMTJQ2wkECZWdq4GePs2ctc5H8zV+cHPaq8k2vU8mrQjA6iHdQ==", + "dev": true, + "peer": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "dependencies": { + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "peer": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "peer": true + } + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true, + "peer": true + }, "@mapbox/node-pre-gyp": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.8.tgz", @@ -2226,6 +3712,21 @@ "negotiator": "0.6.2" } }, + "acorn": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "dev": true, + "peer": true + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peer": true, + "requires": {} + }, "agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -2249,6 +3750,19 @@ } } }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "peer": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -2288,6 +3802,13 @@ } } }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "peer": true + }, "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -2298,6 +3819,20 @@ "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=" }, + "babel-eslint": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", + "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0", + "eslint-visitor-keys": "^1.0.0", + "resolve": "^1.12.0" + } + }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -2367,6 +3902,13 @@ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.1.tgz", "integrity": "sha512-dWe4nWO/ruEOY7HkUJ5gFt1DCFV9zPRoJr8pV0/ASQermOZjtq8jMjOprC0Kd10GLN+l7xaUPvxzJFWtxGu8Fg==" }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "peer": true + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -2510,6 +4052,18 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "peer": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -2518,6 +4072,13 @@ "ms": "2.0.0" } }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "peer": true + }, "delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", @@ -2543,6 +4104,16 @@ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "peer": true, + "requires": { + "esutils": "^2.0.2" + } + }, "dotenv": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-6.2.0.tgz", @@ -2607,6 +4178,239 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, + "eslint": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.7.0.tgz", + "integrity": "sha512-ifHYzkBGrzS2iDU7KjhCAVMGCvF6M3Xfs8X8b37cgrUlDt6bWRTpRh6T/gtSXv1HJ/BUGgmjvNvOEGu85Iif7w==", + "dev": true, + "peer": true, + "requires": { + "@eslint/eslintrc": "^1.0.5", + "@humanwhocodes/config-array": "^0.9.2", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.0", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.2.0", + "espree": "^9.3.0", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^6.0.1", + "globals": "^13.6.0", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "peer": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "peer": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "peer": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "peer": true + }, + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "peer": true, + "requires": { + "ms": "2.1.2" + } + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "peer": true + }, + "eslint-visitor-keys": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz", + "integrity": "sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ==", + "dev": true, + "peer": true + }, + "globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", + "dev": true, + "peer": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "peer": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "peer": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "peer": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "eslint-scope": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", + "integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==", + "dev": true, + "peer": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + } + }, + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "peer": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "peer": true + } + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + }, + "espree": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.0.tgz", + "integrity": "sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ==", + "dev": true, + "peer": true, + "requires": { + "acorn": "^8.7.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^3.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz", + "integrity": "sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ==", + "dev": true, + "peer": true + } + } + }, + "esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "peer": true, + "requires": { + "estraverse": "^5.1.0" + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "peer": true, + "requires": { + "estraverse": "^5.2.0" + } + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "peer": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "peer": true + }, "etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -2688,6 +4492,37 @@ } } }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "peer": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "peer": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true, + "peer": true + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "peer": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, "filelist": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.2.tgz", @@ -2710,6 +4545,24 @@ "unpipe": "~1.0.0" } }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "peer": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", + "dev": true, + "peer": true + }, "forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -2733,6 +4586,19 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true, + "peer": true + }, "gauge": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", @@ -2762,6 +4628,31 @@ "path-is-absolute": "^1.0.0" } }, + "glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "peer": true, + "requires": { + "is-glob": "^4.0.3" + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -2816,6 +4707,40 @@ "safer-buffer": ">= 2.1.2 < 3" } }, + "ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true, + "peer": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "peer": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "peer": true + } + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "peer": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -2840,16 +4765,49 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, + "is-core-module": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", + "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "peer": true + }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "peer": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true, + "peer": true + }, "jake": { "version": "10.8.2", "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.2.tgz", @@ -2884,6 +4842,42 @@ "nopt": "^5.0.0" } }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "peer": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "peer": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true, + "peer": true + }, "jsonwebtoken": { "version": "8.5.1", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", @@ -2937,6 +4931,17 @@ "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.2.tgz", "integrity": "sha512-STHz9P7X2L4Kwn72fA4rGyqyXdmrMSdxqHx9IXon/FXluXieaFA6KJ2upcHAHxQPQ0LeM/OjLrhFxifHewOALQ==" }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "peer": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -2972,6 +4977,13 @@ "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "peer": true + }, "lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", @@ -3221,6 +5233,13 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true, + "peer": true + }, "negotiator": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", @@ -3297,6 +5316,31 @@ "resolved": "https://registry.npmjs.org/optional-require/-/optional-require-1.0.3.tgz", "integrity": "sha512-RV2Zp2MY2aeYK5G+B/Sps8lW5NHAzE5QClbFP15j+PWmP+T9PxlJXBOOLoSAdgwFvS4t0aMR4vpedMkbHfh0nA==" }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "peer": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "peer": true, + "requires": { + "callsites": "^3.0.0" + } + }, "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -3337,6 +5381,19 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "peer": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, "path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", @@ -3352,6 +5409,13 @@ "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==" }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "peer": true + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -3376,6 +5440,13 @@ "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "peer": true + }, "qs": { "version": "6.9.6", "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.6.tgz", @@ -3421,6 +5492,13 @@ "resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-1.0.0.tgz", "integrity": "sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw==" }, + "regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "peer": true + }, "require_optional": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz", @@ -3442,6 +5520,17 @@ "resolved": "https://registry.npmjs.org/require-at/-/require-at-1.0.6.tgz", "integrity": "sha512-7i1auJbMUrXEAZCOQ0VNJgmcT2VOKPRl2YGJwgpHpC9CE91Mv4/4UYIUm4chGJaI381ZDq1JUicFii64Hapd8g==" }, + "resolve": { + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "dev": true, + "requires": { + "is-core-module": "^2.8.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, "resolve-from": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", @@ -3555,6 +5644,23 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "peer": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "peer": true + }, "sift": { "version": "13.5.2", "resolved": "https://registry.npmjs.org/sift/-/sift-13.5.2.tgz", @@ -3575,6 +5681,12 @@ "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, "sparse-bitfield": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", @@ -3615,6 +5727,13 @@ "ansi-regex": "^5.0.1" } }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "peer": true + }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -3623,6 +5742,12 @@ "has-flag": "^3.0.0" } }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, "tar": { "version": "6.1.11", "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", @@ -3643,6 +5768,19 @@ } } }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true, + "peer": true + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, "toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", @@ -3653,6 +5791,23 @@ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "peer": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "peer": true + }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -3680,6 +5835,16 @@ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "peer": true, + "requires": { + "punycode": "^2.1.0" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -3695,6 +5860,13 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" }, + "v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true, + "peer": true + }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -3714,6 +5886,16 @@ "webidl-conversions": "^3.0.0" } }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "peer": true, + "requires": { + "isexe": "^2.0.0" + } + }, "wide-align": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", @@ -3722,6 +5904,13 @@ "string-width": "^1.0.2 || 2 || 3 || 4" } }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true, + "peer": true + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index 9919abee..0faa1e85 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "build": "node ./build/init.js", - "release": "standard-version" + "release": "standard-version", + "lint" : "eslint --ignore-path .gitignore ." }, "standard-version": { "skip": { @@ -50,5 +51,8 @@ "uid-generator": "^2.0.0", "uuid": "^8.3.2", "xml-js": "^1.6.11" + }, + "devDependencies": { + "babel-eslint": "^10.1.0" } } diff --git a/routes.js b/routes.js index ef361122..9c0222a4 100644 --- a/routes.js +++ b/routes.js @@ -27,4 +27,4 @@ module.exports = function (app, passport) { message: "not found" }); }); -} \ No newline at end of file +}; \ No newline at end of file diff --git a/server.js b/server.js index 9985e219..056402ac 100644 --- a/server.js +++ b/server.js @@ -18,7 +18,7 @@ const port = process.env.SERVER_PORT; const app = express(); require('rootpath')(); -require('dotenv').config() +require('dotenv').config(); app.use(compress()); app.use(flash()); app.use(express.static('public')); diff --git a/web/index/index.js b/web/index/index.js index a04b7434..baecbf30 100644 --- a/web/index/index.js +++ b/web/index/index.js @@ -1,4 +1,3 @@ - const express = require('express'); const router = express.Router(); const path = require('path'); @@ -14,7 +13,7 @@ router.get('/', function (req, res) { router.get(`/${process.env.ADMIN_LOGIN_PATH}`, function(req, res) { res.sendFile('login.html' , { root: __dirname + '../../../public/html' - }) + }); }); router.get('/tokenIssuer', user.checkIsLoggedIn, function (req, res, next) { @@ -37,6 +36,6 @@ router.get('/tokenManager', user.checkIsLoggedIn, function (req, res, next) { res.sendFile('tokenManager.html', { root: __dirname + '../../../public/html' }); -}) +}); module.exports = router; \ No newline at end of file