moved the api folder
This commit is contained in:
parent
0edd12ebad
commit
d8a836aa90
279
package-lock.json
generated
279
package-lock.json
generated
@ -12,16 +12,19 @@
|
||||
"body-parser": "^1.19.0",
|
||||
"dcc-utils": "^0.2.0",
|
||||
"express": "^4.17.1",
|
||||
"jsrsasign": "^10.4.0",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/express": "^4.17.13",
|
||||
"@types/jsrsasign": "^8.0.13",
|
||||
"@types/node": "^16.9.6",
|
||||
"@typescript-eslint/eslint-plugin": "^4.31.2",
|
||||
"@typescript-eslint/parser": "^4.31.2",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-airbnb-base": "^14.2.1",
|
||||
"eslint-plugin-import": "^2.24.2"
|
||||
"eslint-plugin-import": "^2.24.2",
|
||||
"ts-node": "^10.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame": {
|
||||
@ -1598,6 +1601,27 @@
|
||||
"node": ">=0.1.95"
|
||||
}
|
||||
},
|
||||
"node_modules/@cspotcode/source-map-consumer": {
|
||||
"version": "0.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz",
|
||||
"integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 12"
|
||||
}
|
||||
},
|
||||
"node_modules/@cspotcode/source-map-support": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.6.1.tgz",
|
||||
"integrity": "sha512-DX3Z+T5dt1ockmPdobJS/FAsQPW4V4SrWEhD2iYQT2Cb2tQsiMnYxrcUH9By/Z3B+v0S5LMBkQtV/XOBbpLEOg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@cspotcode/source-map-consumer": "0.8.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@cto.af/textdecoder": {
|
||||
"version": "0.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@cto.af/textdecoder/-/textdecoder-0.0.0.tgz",
|
||||
@ -2729,6 +2753,30 @@
|
||||
"optional": true,
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/@tsconfig/node10": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz",
|
||||
"integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@tsconfig/node12": {
|
||||
"version": "1.0.9",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz",
|
||||
"integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@tsconfig/node14": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz",
|
||||
"integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@tsconfig/node16": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz",
|
||||
"integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/asn1js": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/asn1js/-/asn1js-2.0.2.tgz",
|
||||
@ -2825,6 +2873,12 @@
|
||||
"integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/jsrsasign": {
|
||||
"version": "8.0.13",
|
||||
"resolved": "https://registry.npmjs.org/@types/jsrsasign/-/jsrsasign-8.0.13.tgz",
|
||||
"integrity": "sha512-+0Ij59D6NXP48KkeLhPXeQKOyLjvA9CD7zacc0Svy2IWHdl62BmDeTvGSIwKaGZSoamLJOo+on1AG/wPRLsd7A==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/mime": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz",
|
||||
@ -3191,6 +3245,15 @@
|
||||
"acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/acorn-walk": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
|
||||
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/aes-cbc-mac": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/aes-cbc-mac/-/aes-cbc-mac-1.0.1.tgz",
|
||||
@ -3383,6 +3446,12 @@
|
||||
"optional": true,
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/arg": {
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
|
||||
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/argparse": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
|
||||
@ -4628,6 +4697,12 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/create-require": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
||||
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
@ -4768,6 +4843,15 @@
|
||||
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
|
||||
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
|
||||
},
|
||||
"node_modules/diff": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
||||
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/dir-glob": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
|
||||
@ -7304,6 +7388,14 @@
|
||||
"resolved": "https://registry.npmjs.org/jsqr/-/jsqr-1.4.0.tgz",
|
||||
"integrity": "sha512-dxLob7q65Xg2DvstYkRpkYtmKm2sPJ9oFhrhmudT1dZvNFFTlroai3AWSpLey/w5vMcLBXRgOJsbXpdN9HzU/A=="
|
||||
},
|
||||
"node_modules/jsrsasign": {
|
||||
"version": "10.4.0",
|
||||
"resolved": "https://registry.npmjs.org/jsrsasign/-/jsrsasign-10.4.0.tgz",
|
||||
"integrity": "sha512-C8qLhiAssh/b74KJpGhWuFGG9cFhJqMCVuuHXRibb3Z5vPuAW0ue0jUirpoExCdpdhv4nD3sZ1DAwJURYJTm9g==",
|
||||
"funding": {
|
||||
"url": "https://github.com/kjur/jsrsasign#donations"
|
||||
}
|
||||
},
|
||||
"node_modules/kind-of": {
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
|
||||
@ -7603,6 +7695,12 @@
|
||||
"semver": "bin/semver"
|
||||
}
|
||||
},
|
||||
"node_modules/make-error": {
|
||||
"version": "1.3.6",
|
||||
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
||||
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/makeerror": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz",
|
||||
@ -11008,6 +11106,62 @@
|
||||
"optional": true,
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/ts-node": {
|
||||
"version": "10.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.2.1.tgz",
|
||||
"integrity": "sha512-hCnyOyuGmD5wHleOQX6NIjJtYVIO8bPP8F2acWkB4W06wdlkgyvJtubO/I9NkI88hCFECbsEgoLc0VNkYmcSfw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@cspotcode/source-map-support": "0.6.1",
|
||||
"@tsconfig/node10": "^1.0.7",
|
||||
"@tsconfig/node12": "^1.0.7",
|
||||
"@tsconfig/node14": "^1.0.0",
|
||||
"@tsconfig/node16": "^1.0.2",
|
||||
"acorn": "^8.4.1",
|
||||
"acorn-walk": "^8.1.1",
|
||||
"arg": "^4.1.0",
|
||||
"create-require": "^1.1.0",
|
||||
"diff": "^4.0.1",
|
||||
"make-error": "^1.1.1",
|
||||
"yn": "3.1.1"
|
||||
},
|
||||
"bin": {
|
||||
"ts-node": "dist/bin.js",
|
||||
"ts-node-cwd": "dist/bin-cwd.js",
|
||||
"ts-node-script": "dist/bin-script.js",
|
||||
"ts-node-transpile-only": "dist/bin-transpile.js",
|
||||
"ts-script": "dist/bin-script-deprecated.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@swc/core": ">=1.2.50",
|
||||
"@swc/wasm": ">=1.2.50",
|
||||
"@types/node": "*",
|
||||
"typescript": ">=2.7"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@swc/core": {
|
||||
"optional": true
|
||||
},
|
||||
"@swc/wasm": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/ts-node/node_modules/acorn": {
|
||||
"version": "8.5.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz",
|
||||
"integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/tsconfig-paths": {
|
||||
"version": "3.11.0",
|
||||
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz",
|
||||
@ -11763,6 +11917,15 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/yn": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/yocto-queue": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
|
||||
@ -12906,6 +13069,21 @@
|
||||
"minimist": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"@cspotcode/source-map-consumer": {
|
||||
"version": "0.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz",
|
||||
"integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==",
|
||||
"dev": true
|
||||
},
|
||||
"@cspotcode/source-map-support": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.6.1.tgz",
|
||||
"integrity": "sha512-DX3Z+T5dt1ockmPdobJS/FAsQPW4V4SrWEhD2iYQT2Cb2tQsiMnYxrcUH9By/Z3B+v0S5LMBkQtV/XOBbpLEOg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@cspotcode/source-map-consumer": "0.8.0"
|
||||
}
|
||||
},
|
||||
"@cto.af/textdecoder": {
|
||||
"version": "0.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@cto.af/textdecoder/-/textdecoder-0.0.0.tgz",
|
||||
@ -13841,6 +14019,30 @@
|
||||
"optional": true,
|
||||
"peer": true
|
||||
},
|
||||
"@tsconfig/node10": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz",
|
||||
"integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==",
|
||||
"dev": true
|
||||
},
|
||||
"@tsconfig/node12": {
|
||||
"version": "1.0.9",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz",
|
||||
"integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==",
|
||||
"dev": true
|
||||
},
|
||||
"@tsconfig/node14": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz",
|
||||
"integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==",
|
||||
"dev": true
|
||||
},
|
||||
"@tsconfig/node16": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz",
|
||||
"integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/asn1js": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/asn1js/-/asn1js-2.0.2.tgz",
|
||||
@ -13937,6 +14139,12 @@
|
||||
"integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=",
|
||||
"dev": true
|
||||
},
|
||||
"@types/jsrsasign": {
|
||||
"version": "8.0.13",
|
||||
"resolved": "https://registry.npmjs.org/@types/jsrsasign/-/jsrsasign-8.0.13.tgz",
|
||||
"integrity": "sha512-+0Ij59D6NXP48KkeLhPXeQKOyLjvA9CD7zacc0Svy2IWHdl62BmDeTvGSIwKaGZSoamLJOo+on1AG/wPRLsd7A==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/mime": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz",
|
||||
@ -14190,6 +14398,12 @@
|
||||
"dev": true,
|
||||
"requires": {}
|
||||
},
|
||||
"acorn-walk": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
|
||||
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
|
||||
"dev": true
|
||||
},
|
||||
"aes-cbc-mac": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/aes-cbc-mac/-/aes-cbc-mac-1.0.1.tgz",
|
||||
@ -14347,6 +14561,12 @@
|
||||
"optional": true,
|
||||
"peer": true
|
||||
},
|
||||
"arg": {
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
|
||||
"integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==",
|
||||
"dev": true
|
||||
},
|
||||
"argparse": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
|
||||
@ -15329,6 +15549,12 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"create-require": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
||||
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
|
||||
"dev": true
|
||||
},
|
||||
"cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
@ -15448,6 +15674,12 @@
|
||||
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
|
||||
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
|
||||
},
|
||||
"diff": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
||||
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
|
||||
"dev": true
|
||||
},
|
||||
"dir-glob": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
|
||||
@ -17443,6 +17675,11 @@
|
||||
"resolved": "https://registry.npmjs.org/jsqr/-/jsqr-1.4.0.tgz",
|
||||
"integrity": "sha512-dxLob7q65Xg2DvstYkRpkYtmKm2sPJ9oFhrhmudT1dZvNFFTlroai3AWSpLey/w5vMcLBXRgOJsbXpdN9HzU/A=="
|
||||
},
|
||||
"jsrsasign": {
|
||||
"version": "10.4.0",
|
||||
"resolved": "https://registry.npmjs.org/jsrsasign/-/jsrsasign-10.4.0.tgz",
|
||||
"integrity": "sha512-C8qLhiAssh/b74KJpGhWuFGG9cFhJqMCVuuHXRibb3Z5vPuAW0ue0jUirpoExCdpdhv4nD3sZ1DAwJURYJTm9g=="
|
||||
},
|
||||
"kind-of": {
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
|
||||
@ -17692,6 +17929,12 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"make-error": {
|
||||
"version": "1.3.6",
|
||||
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
||||
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
|
||||
"dev": true
|
||||
},
|
||||
"makeerror": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz",
|
||||
@ -20492,6 +20735,34 @@
|
||||
"optional": true,
|
||||
"peer": true
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "10.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.2.1.tgz",
|
||||
"integrity": "sha512-hCnyOyuGmD5wHleOQX6NIjJtYVIO8bPP8F2acWkB4W06wdlkgyvJtubO/I9NkI88hCFECbsEgoLc0VNkYmcSfw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@cspotcode/source-map-support": "0.6.1",
|
||||
"@tsconfig/node10": "^1.0.7",
|
||||
"@tsconfig/node12": "^1.0.7",
|
||||
"@tsconfig/node14": "^1.0.0",
|
||||
"@tsconfig/node16": "^1.0.2",
|
||||
"acorn": "^8.4.1",
|
||||
"acorn-walk": "^8.1.1",
|
||||
"arg": "^4.1.0",
|
||||
"create-require": "^1.1.0",
|
||||
"diff": "^4.0.1",
|
||||
"make-error": "^1.1.1",
|
||||
"yn": "3.1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"acorn": {
|
||||
"version": "8.5.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz",
|
||||
"integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"tsconfig-paths": {
|
||||
"version": "3.11.0",
|
||||
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz",
|
||||
@ -21106,6 +21377,12 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"yn": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||
"integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
|
||||
"dev": true
|
||||
},
|
||||
"yocto-queue": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
|
||||
|
@ -12,15 +12,18 @@
|
||||
"body-parser": "^1.19.0",
|
||||
"dcc-utils": "^0.2.0",
|
||||
"express": "^4.17.1",
|
||||
"jsrsasign": "^10.4.0",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/express": "^4.17.13",
|
||||
"@types/jsrsasign": "^8.0.13",
|
||||
"@types/node": "^16.9.6",
|
||||
"@typescript-eslint/eslint-plugin": "^4.31.2",
|
||||
"@typescript-eslint/parser": "^4.31.2",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-airbnb-base": "^14.2.1",
|
||||
"eslint-plugin-import": "^2.24.2"
|
||||
"eslint-plugin-import": "^2.24.2",
|
||||
"ts-node": "^10.2.1"
|
||||
}
|
||||
}
|
||||
|
10
src/api/green/controller.ts
Normal file
10
src/api/green/controller.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { Request, Response } from 'express';
|
||||
import Verifier from '../../../utils/dgcVerifier/Verifier';
|
||||
let verifier:Verifier;
|
||||
Verifier.instanceVerifier().then((ver)=>verifier=ver).catch(console.error);
|
||||
|
||||
export const get = (req: Request, res: Response):void => {
|
||||
const cert = req.body;
|
||||
const result = verifier.checkCertificate(cert);
|
||||
res.status(200).send({'data':result});
|
||||
};
|
@ -1,6 +1,6 @@
|
||||
import { Router } from 'express';
|
||||
import * as exampleMW from './middleware';
|
||||
import * as exampleCtrl from './controller';
|
||||
import * as middleware from './middleware';
|
||||
import * as controller from './controller';
|
||||
import { API } from '../index';
|
||||
|
||||
export default class GreenApi implements API {
|
||||
@ -11,6 +11,6 @@ export default class GreenApi implements API {
|
||||
}
|
||||
|
||||
setupApi():void {
|
||||
this.router.get('/example',exampleMW.canGet,exampleCtrl.get);
|
||||
this.router.post('/green',middleware.canGet,controller.get);
|
||||
}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
import { Request, Response } from 'express';
|
||||
|
||||
export const get = (req: Request, res: Response):void => {
|
||||
res.status(200).send({});
|
||||
};
|
@ -1,45 +1,78 @@
|
||||
// import crypto from 'crypto';
|
||||
import fs from 'fs/promises';
|
||||
export class CertificateDownloader{
|
||||
static instance: CertificateDownloader;
|
||||
// private readonly baseUrl = 'https://get.dgc.gov.it';
|
||||
private readonly keyStorage = 'cerificate_collection';
|
||||
// static instance: CertificateDownloader;
|
||||
private readonly baseUrl = 'https://get.dgc.gov.it';
|
||||
private readonly updateApi = '/v1/dgc/signercertificate/update'
|
||||
private readonly statusApi = '/v1/dgc/signercertificate/status'
|
||||
private readonly keyStorage = './cerificate_collection.json';
|
||||
private readonly timeSpan = 86400000;
|
||||
// private readonly timeSpan = 1000;
|
||||
private cerficateCollection = {}
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
private constructor(){}
|
||||
private cerficateCollection:string[] = [];
|
||||
private currentValidKids = [];
|
||||
|
||||
public getCertificates(): unknown {
|
||||
const savedData = JSON.parse(localStorage.getItem(this.keyStorage) || '{}');
|
||||
public constructor(){
|
||||
this.getCertificates();
|
||||
}
|
||||
|
||||
public async getCertificates(): Promise<string[]> {
|
||||
const file = await fs.open(this.keyStorage,'r');
|
||||
const data = await file.readFile();
|
||||
const savedData = JSON.parse( data.toString() || '{}');
|
||||
if(savedData.lastupdateDate == null || Date.now() - savedData?.lastupdateDate > this.timeSpan){
|
||||
this.getAllCertificate()
|
||||
.then(() => { console.log('could not read the certificates from the local file'); return this.cerficateCollection; })
|
||||
.catch(console.error);
|
||||
}
|
||||
console.log('cerficates collection is valid loading from local source');
|
||||
// console.log(dataRead.certificates);
|
||||
this.cerficateCollection = savedData.certificates;
|
||||
return this.cerficateCollection;
|
||||
}
|
||||
|
||||
public static getCertificateDownloader():CertificateDownloader{
|
||||
if(CertificateDownloader.instance == undefined){
|
||||
CertificateDownloader.instance = new CertificateDownloader();
|
||||
}
|
||||
return CertificateDownloader.instance;
|
||||
}
|
||||
// public static getCertificateDownloader():CertificateDownloader{
|
||||
// if(CertificateDownloader.instance == undefined){
|
||||
// CertificateDownloader.instance = new CertificateDownloader();
|
||||
// }
|
||||
// return CertificateDownloader.instance;
|
||||
// }
|
||||
|
||||
// async getAllCertificate(): Promise<void> {
|
||||
// this.cerficateCollection = {};
|
||||
// const response = (await fetch('https://raw.githubusercontent.com/lovasoa/sanipasse/master/src/assets/Digital_Green_Certificate_Signing_Keys.json'));
|
||||
// if(response.ok){
|
||||
// this.cerficateCollection = await response.json();
|
||||
// console.log(response);
|
||||
// const lastupdateDate = Date.now();
|
||||
// const file = await fs.open(this.keyStorage,'rw');
|
||||
// file.writeFile(JSON.stringify({'certificates':this.cerficateCollection, lastupdateDate}));
|
||||
// }else{
|
||||
// throw new Error(response.statusText);
|
||||
// }
|
||||
// }
|
||||
|
||||
async getAllCertificate(): Promise<void> {
|
||||
this.cerficateCollection = {};
|
||||
const response = (await fetch('https://raw.githubusercontent.com/lovasoa/sanipasse/master/src/assets/Digital_Green_Certificate_Signing_Keys.json'));
|
||||
if(response.ok){
|
||||
this.cerficateCollection = await response.json();
|
||||
console.log(response);
|
||||
const lastupdateDate = Date.now();
|
||||
localStorage.setItem(this.keyStorage, JSON.stringify({'certificates':this.cerficateCollection, lastupdateDate}));
|
||||
// fs.writeFile('./cerificate_collection.json', JSON.stringify({'certificates':this.cerficateCollection, lastupdateDate}),'utf8',console.error);
|
||||
}else{
|
||||
throw new Error(response.statusText);
|
||||
let exit = false;
|
||||
let headers = {};
|
||||
this.cerficateCollection = [];
|
||||
while(!exit){
|
||||
const response = await fetch(this.baseUrl+this.updateApi,{headers});
|
||||
headers = {'X-RESUME-TOKEN': response.headers.get('X-RESUME-TOKEN')};
|
||||
const currentKid:string = response.headers.get('X-KID') || '';
|
||||
if(this.currentValidKids.includes(currentKid as never)){
|
||||
const cert = await response.text();
|
||||
this.cerficateCollection.push('-----BEGIN CERTIFICATE-----\n' + cert + '-----END CERTIFICATE-----');
|
||||
}
|
||||
exit = (response.status !== 200);
|
||||
}
|
||||
const lastupdateDate = Date.now();
|
||||
const file = await fs.open(this.keyStorage,'rw');
|
||||
file.writeFile(JSON.stringify({'certificates':this.cerficateCollection, lastupdateDate}));
|
||||
}
|
||||
|
||||
async updateKids(): Promise<void> {
|
||||
try {
|
||||
const resp = await fetch(this.baseUrl+this.statusApi);
|
||||
this.currentValidKids = await resp.json();
|
||||
} catch (error) {
|
||||
console.log('could not get keyChild ', error);
|
||||
}
|
||||
}
|
||||
}
|
@ -6,7 +6,7 @@ export class RuleDownloader {
|
||||
// private readonly timeSpan = 1000;
|
||||
public rules:unknown = {}
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
private constructor(){
|
||||
constructor(){
|
||||
this.getRules();
|
||||
}
|
||||
|
||||
@ -23,13 +23,6 @@ export class RuleDownloader {
|
||||
return this.rules;
|
||||
}
|
||||
|
||||
static getRuleDownloader(): RuleDownloader{
|
||||
if(this.instance == undefined){
|
||||
RuleDownloader.instance = new RuleDownloader();
|
||||
}
|
||||
return RuleDownloader.instance;
|
||||
}
|
||||
|
||||
private async getSettings(): Promise<unknown>{
|
||||
const response = await fetch(`${this.baseUrl}/v1/dgc/settings`);
|
||||
const jsonData = await response.json();
|
||||
|
@ -1,21 +1,38 @@
|
||||
import { CertificateDownloader } from './CertificateDownloader';
|
||||
import { RuleDownloader } from './RuleDownloader';
|
||||
import {DCC} from 'dcc-utils';
|
||||
import jsrsasign from 'jsrsasign';
|
||||
|
||||
export default class Verifier {
|
||||
static certDownloader: CertificateDownloader;
|
||||
static ruleDownloader: RuleDownloader;
|
||||
static certificateList: unknown;
|
||||
static instance: Verifier|undefined = undefined;
|
||||
private certDownloader: CertificateDownloader;
|
||||
private ruleDownloader: RuleDownloader;
|
||||
private certificateList: string[] = [];
|
||||
|
||||
static async setup():Promise<void> {
|
||||
Verifier.certDownloader = CertificateDownloader.getCertificateDownloader();
|
||||
Verifier.ruleDownloader = RuleDownloader.getRuleDownloader();
|
||||
Verifier.certificateList = await Verifier.certDownloader.getCertificates();
|
||||
private constructor(){
|
||||
this.certDownloader = new CertificateDownloader();
|
||||
this.ruleDownloader = new RuleDownloader();
|
||||
}
|
||||
|
||||
static async checkCertificate(certificate:string): Promise<unknown>{
|
||||
public static async instanceVerifier(): Promise<Verifier>{
|
||||
if (Verifier.instance == undefined){
|
||||
Verifier.instance = new Verifier();
|
||||
Verifier.instance.certificateList = await Verifier.instance.certDownloader.getCertificates();
|
||||
}
|
||||
return Verifier.instance;
|
||||
}
|
||||
|
||||
async checkCertificate(certificate:string): Promise<unknown>{
|
||||
const dcc = await DCC.fromRaw(certificate);
|
||||
const certCheck = await dcc.checkSignatureWithKeysList(Verifier.certificateList);
|
||||
return certCheck;
|
||||
let result: unknown;
|
||||
this.certificateList.forEach(async (cert: string) => {
|
||||
const verifier = jsrsasign.KEYUTIL.getKey(cert);
|
||||
if (typeof verifier == typeof jsrsasign.KJUR.crypto.ECDSA ){
|
||||
const xyCoord = (verifier as jsrsasign.KJUR.crypto.ECDSA).getPublicKeyXYHex();
|
||||
result = await dcc.checkSignature(xyCoord);
|
||||
}
|
||||
});
|
||||
console.log(result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user