From 82b226eec26e4fb8cbd63b96f1a6c9310541ef9a Mon Sep 17 00:00:00 2001 From: nanov Date: Fri, 11 Oct 2019 10:46:37 +0300 Subject: [PATCH] wip: monorepro --- .env | 4 -- .eslintrc | 35 ----------- .eslintrc.js | 4 ++ lerna.json | 8 +++ package.json | 58 ++++--------------- .../ebics-client/examples}/bankLetter.js | 0 .../ebics-client/examples}/initialize.js | 0 .../ebics-client/examples}/save-bank-kesy.js | 0 .../ebics-client/examples}/send-hbt-order.js | 0 index.js => packages/ebics-client/index.js | 0 .../ebics-client/lib}/BankLetter.js | 0 {lib => packages/ebics-client/lib}/Client.js | 0 {lib => packages/ebics-client/lib}/consts.js | 0 .../ebics-client/lib}/crypto/Crypto.js | 0 .../ebics-client/lib}/crypto/MGF1.js | 0 .../ebics-client/lib}/keymanagers/Keys.js | 0 .../lib}/keymanagers/KeysManager.js | 0 .../lib}/keymanagers/defaultKeyEncryptor.js | 0 .../ebics-client/lib}/keymanagers/keyRSA.js | 0 .../ebics-client/lib}/middleware/response.js | 0 .../lib}/middleware/serializer.js | 0 .../ebics-client/lib}/middleware/signer.js | 0 .../ebics-client/lib}/orders/H004/errors.js | 0 .../ebics-client/lib}/orders/H004/response.js | 0 .../lib}/orders/H004/serializer.js | 0 .../lib}/orders/H004/serializers/download.js | 0 .../lib}/orders/H004/serializers/generic.js | 0 .../lib}/orders/H004/serializers/ini.js | 0 .../lib}/orders/H004/serializers/upload.js | 0 .../ebics-client/lib}/orders/H004/signer.js | 0 .../ebics-client/lib}/predefinedOrders/AZV.js | 0 .../ebics-client/lib}/predefinedOrders/CCS.js | 0 .../ebics-client/lib}/predefinedOrders/CCT.js | 0 .../ebics-client/lib}/predefinedOrders/CD1.js | 0 .../ebics-client/lib}/predefinedOrders/CDB.js | 0 .../ebics-client/lib}/predefinedOrders/CDD.js | 0 .../ebics-client/lib}/predefinedOrders/CDS.js | 0 .../ebics-client/lib}/predefinedOrders/HAA.js | 0 .../ebics-client/lib}/predefinedOrders/HAC.js | 0 .../ebics-client/lib}/predefinedOrders/HIA.js | 0 .../ebics-client/lib}/predefinedOrders/HKD.js | 0 .../ebics-client/lib}/predefinedOrders/HPB.js | 0 .../ebics-client/lib}/predefinedOrders/HPD.js | 0 .../ebics-client/lib}/predefinedOrders/HTD.js | 0 .../ebics-client/lib}/predefinedOrders/INI.js | 0 .../ebics-client/lib}/predefinedOrders/PTK.js | 0 .../ebics-client/lib}/predefinedOrders/STA.js | 0 .../ebics-client/lib}/predefinedOrders/VMK.js | 0 .../ebics-client/lib}/predefinedOrders/XCT.js | 0 .../ebics-client/lib}/predefinedOrders/XE3.js | 0 .../ebics-client/lib}/predefinedOrders/Z53.js | 0 .../lib}/predefinedOrders/index.js | 0 .../lib}/storages/fsKeysStorage.js | 0 .../lib}/storages/tracesStorage.js | 0 {lib => packages/ebics-client/lib}/utils.js | 0 packages/ebics-client/package.json | 43 ++++++++++++++ .../ebics-client/test}/responseParser.js | 0 57 files changed, 66 insertions(+), 86 deletions(-) delete mode 100644 .env delete mode 100644 .eslintrc create mode 100644 .eslintrc.js create mode 100644 lerna.json rename {examples => packages/ebics-client/examples}/bankLetter.js (100%) rename {examples => packages/ebics-client/examples}/initialize.js (100%) rename {examples => packages/ebics-client/examples}/save-bank-kesy.js (100%) rename {examples => packages/ebics-client/examples}/send-hbt-order.js (100%) rename index.js => packages/ebics-client/index.js (100%) rename {lib => packages/ebics-client/lib}/BankLetter.js (100%) rename {lib => packages/ebics-client/lib}/Client.js (100%) rename {lib => packages/ebics-client/lib}/consts.js (100%) rename {lib => packages/ebics-client/lib}/crypto/Crypto.js (100%) rename {lib => packages/ebics-client/lib}/crypto/MGF1.js (100%) rename {lib => packages/ebics-client/lib}/keymanagers/Keys.js (100%) rename {lib => packages/ebics-client/lib}/keymanagers/KeysManager.js (100%) rename {lib => packages/ebics-client/lib}/keymanagers/defaultKeyEncryptor.js (100%) rename {lib => packages/ebics-client/lib}/keymanagers/keyRSA.js (100%) rename {lib => packages/ebics-client/lib}/middleware/response.js (100%) rename {lib => packages/ebics-client/lib}/middleware/serializer.js (100%) rename {lib => packages/ebics-client/lib}/middleware/signer.js (100%) rename {lib => packages/ebics-client/lib}/orders/H004/errors.js (100%) rename {lib => packages/ebics-client/lib}/orders/H004/response.js (100%) rename {lib => packages/ebics-client/lib}/orders/H004/serializer.js (100%) rename {lib => packages/ebics-client/lib}/orders/H004/serializers/download.js (100%) rename {lib => packages/ebics-client/lib}/orders/H004/serializers/generic.js (100%) rename {lib => packages/ebics-client/lib}/orders/H004/serializers/ini.js (100%) rename {lib => packages/ebics-client/lib}/orders/H004/serializers/upload.js (100%) rename {lib => packages/ebics-client/lib}/orders/H004/signer.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/AZV.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/CCS.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/CCT.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/CD1.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/CDB.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/CDD.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/CDS.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/HAA.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/HAC.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/HIA.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/HKD.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/HPB.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/HPD.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/HTD.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/INI.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/PTK.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/STA.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/VMK.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/XCT.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/XE3.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/Z53.js (100%) rename {lib => packages/ebics-client/lib}/predefinedOrders/index.js (100%) rename {lib => packages/ebics-client/lib}/storages/fsKeysStorage.js (100%) rename {lib => packages/ebics-client/lib}/storages/tracesStorage.js (100%) rename {lib => packages/ebics-client/lib}/utils.js (100%) create mode 100644 packages/ebics-client/package.json rename {test => packages/ebics-client/test}/responseParser.js (100%) diff --git a/.env b/.env deleted file mode 100644 index 26f0ea1..0000000 --- a/.env +++ /dev/null @@ -1,4 +0,0 @@ -SERVER_PORT=3003 - -LOG_LEVEL=info -LOG_ENABLED=true \ No newline at end of file diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index c3147b5..0000000 --- a/.eslintrc +++ /dev/null @@ -1,35 +0,0 @@ -{ - "extends": "airbnb-base", - "env": { - "node": true, - "mocha": true - }, - "parserOptions": { - "ecmaVersion": 8, - "sourceType": "script", - "ecmaFeatures": { - "modules": false - } - }, - "rules": { - "max-len": 0, - "linebreak-style": 0, - "no-plusplus": [ - 2, - { - "allowForLoopAfterthoughts": true - } - ], - "no-continue": 0, - "indent": [2, "tab"], - "no-tabs": 0, - "strict": [2, "safe"], - "curly": [2, "multi", "consistent"], - "import/no-extraneous-dependencies": 0, - "import/no-unresolved": 0, - "no-underscore-dangle": 0, - "no-param-reassign": 0, - "generator-star-spacing": 0, - "jsx-a11y/href-no-hash": "off" - } -} diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..e41c7a4 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: "ecollect-base" +} diff --git a/lerna.json b/lerna.json new file mode 100644 index 0000000..3a60d40 --- /dev/null +++ b/lerna.json @@ -0,0 +1,8 @@ +{ + "packages": [ + "packages/*" + ], + "npmClient": "yarn", + "useWorkspaces": true, + "version": "independent" +} diff --git a/package.json b/package.json index a763ced..8c35d3f 100644 --- a/package.json +++ b/package.json @@ -1,50 +1,14 @@ { - "name": "ebics-client", - "version": "0.0.7", - "description": "Node.js ISO 20022 Compliant EBICS Client", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "https://github.com/eCollect/node-ebics-client" - }, - "keywords": [ - "EBICS", - "ISO20022", - "nodejs", - "api" - ], - "author": "eCollect Sofia Tech Team", - "contributors": [ - { - "name": "Vasyl Stashuk", - "url": "https://github.com/vasyas" - }, - { - "name": "Yago", - "url": "https://github.com/yagop" - } - ], - "license": "MIT", - "dependencies": { - "bn.js": "^4.11.8", - "handlebars": "^4.0.11", - "js2xmlparser": "^3.0.0", - "moment": "^2.22.1", - "node-rsa": "^0.4.2", - "request": "^2.87.0", - "uuid": "^3.3.2", - "xml-crypto": "^0.10.1", - "xmldom": "^0.1.27", - "xpath": "0.0.27" - }, - "devDependencies": { + "name": "ebics-client-root", + "private": true, + "workspaces": [ + "packages/*" + ], + "devDependencies": { "chai": "^4.2.0", - "eslint": "^4.19.1", - "eslint-config-airbnb-base": "^12.1.0", - "eslint-plugin-import": "^2.12.0", - "mocha": "^6.1.4" - } + "lerna": "^3.16.4", + "eslint": "^6.5.1", + "eslint-config-ecollect-base": "^0.1.2", + "eslint-plugin-import": "^2.18.2" + } } diff --git a/examples/bankLetter.js b/packages/ebics-client/examples/bankLetter.js similarity index 100% rename from examples/bankLetter.js rename to packages/ebics-client/examples/bankLetter.js diff --git a/examples/initialize.js b/packages/ebics-client/examples/initialize.js similarity index 100% rename from examples/initialize.js rename to packages/ebics-client/examples/initialize.js diff --git a/examples/save-bank-kesy.js b/packages/ebics-client/examples/save-bank-kesy.js similarity index 100% rename from examples/save-bank-kesy.js rename to packages/ebics-client/examples/save-bank-kesy.js diff --git a/examples/send-hbt-order.js b/packages/ebics-client/examples/send-hbt-order.js similarity index 100% rename from examples/send-hbt-order.js rename to packages/ebics-client/examples/send-hbt-order.js diff --git a/index.js b/packages/ebics-client/index.js similarity index 100% rename from index.js rename to packages/ebics-client/index.js diff --git a/lib/BankLetter.js b/packages/ebics-client/lib/BankLetter.js similarity index 100% rename from lib/BankLetter.js rename to packages/ebics-client/lib/BankLetter.js diff --git a/lib/Client.js b/packages/ebics-client/lib/Client.js similarity index 100% rename from lib/Client.js rename to packages/ebics-client/lib/Client.js diff --git a/lib/consts.js b/packages/ebics-client/lib/consts.js similarity index 100% rename from lib/consts.js rename to packages/ebics-client/lib/consts.js diff --git a/lib/crypto/Crypto.js b/packages/ebics-client/lib/crypto/Crypto.js similarity index 100% rename from lib/crypto/Crypto.js rename to packages/ebics-client/lib/crypto/Crypto.js diff --git a/lib/crypto/MGF1.js b/packages/ebics-client/lib/crypto/MGF1.js similarity index 100% rename from lib/crypto/MGF1.js rename to packages/ebics-client/lib/crypto/MGF1.js diff --git a/lib/keymanagers/Keys.js b/packages/ebics-client/lib/keymanagers/Keys.js similarity index 100% rename from lib/keymanagers/Keys.js rename to packages/ebics-client/lib/keymanagers/Keys.js diff --git a/lib/keymanagers/KeysManager.js b/packages/ebics-client/lib/keymanagers/KeysManager.js similarity index 100% rename from lib/keymanagers/KeysManager.js rename to packages/ebics-client/lib/keymanagers/KeysManager.js diff --git a/lib/keymanagers/defaultKeyEncryptor.js b/packages/ebics-client/lib/keymanagers/defaultKeyEncryptor.js similarity index 100% rename from lib/keymanagers/defaultKeyEncryptor.js rename to packages/ebics-client/lib/keymanagers/defaultKeyEncryptor.js diff --git a/lib/keymanagers/keyRSA.js b/packages/ebics-client/lib/keymanagers/keyRSA.js similarity index 100% rename from lib/keymanagers/keyRSA.js rename to packages/ebics-client/lib/keymanagers/keyRSA.js diff --git a/lib/middleware/response.js b/packages/ebics-client/lib/middleware/response.js similarity index 100% rename from lib/middleware/response.js rename to packages/ebics-client/lib/middleware/response.js diff --git a/lib/middleware/serializer.js b/packages/ebics-client/lib/middleware/serializer.js similarity index 100% rename from lib/middleware/serializer.js rename to packages/ebics-client/lib/middleware/serializer.js diff --git a/lib/middleware/signer.js b/packages/ebics-client/lib/middleware/signer.js similarity index 100% rename from lib/middleware/signer.js rename to packages/ebics-client/lib/middleware/signer.js diff --git a/lib/orders/H004/errors.js b/packages/ebics-client/lib/orders/H004/errors.js similarity index 100% rename from lib/orders/H004/errors.js rename to packages/ebics-client/lib/orders/H004/errors.js diff --git a/lib/orders/H004/response.js b/packages/ebics-client/lib/orders/H004/response.js similarity index 100% rename from lib/orders/H004/response.js rename to packages/ebics-client/lib/orders/H004/response.js diff --git a/lib/orders/H004/serializer.js b/packages/ebics-client/lib/orders/H004/serializer.js similarity index 100% rename from lib/orders/H004/serializer.js rename to packages/ebics-client/lib/orders/H004/serializer.js diff --git a/lib/orders/H004/serializers/download.js b/packages/ebics-client/lib/orders/H004/serializers/download.js similarity index 100% rename from lib/orders/H004/serializers/download.js rename to packages/ebics-client/lib/orders/H004/serializers/download.js diff --git a/lib/orders/H004/serializers/generic.js b/packages/ebics-client/lib/orders/H004/serializers/generic.js similarity index 100% rename from lib/orders/H004/serializers/generic.js rename to packages/ebics-client/lib/orders/H004/serializers/generic.js diff --git a/lib/orders/H004/serializers/ini.js b/packages/ebics-client/lib/orders/H004/serializers/ini.js similarity index 100% rename from lib/orders/H004/serializers/ini.js rename to packages/ebics-client/lib/orders/H004/serializers/ini.js diff --git a/lib/orders/H004/serializers/upload.js b/packages/ebics-client/lib/orders/H004/serializers/upload.js similarity index 100% rename from lib/orders/H004/serializers/upload.js rename to packages/ebics-client/lib/orders/H004/serializers/upload.js diff --git a/lib/orders/H004/signer.js b/packages/ebics-client/lib/orders/H004/signer.js similarity index 100% rename from lib/orders/H004/signer.js rename to packages/ebics-client/lib/orders/H004/signer.js diff --git a/lib/predefinedOrders/AZV.js b/packages/ebics-client/lib/predefinedOrders/AZV.js similarity index 100% rename from lib/predefinedOrders/AZV.js rename to packages/ebics-client/lib/predefinedOrders/AZV.js diff --git a/lib/predefinedOrders/CCS.js b/packages/ebics-client/lib/predefinedOrders/CCS.js similarity index 100% rename from lib/predefinedOrders/CCS.js rename to packages/ebics-client/lib/predefinedOrders/CCS.js diff --git a/lib/predefinedOrders/CCT.js b/packages/ebics-client/lib/predefinedOrders/CCT.js similarity index 100% rename from lib/predefinedOrders/CCT.js rename to packages/ebics-client/lib/predefinedOrders/CCT.js diff --git a/lib/predefinedOrders/CD1.js b/packages/ebics-client/lib/predefinedOrders/CD1.js similarity index 100% rename from lib/predefinedOrders/CD1.js rename to packages/ebics-client/lib/predefinedOrders/CD1.js diff --git a/lib/predefinedOrders/CDB.js b/packages/ebics-client/lib/predefinedOrders/CDB.js similarity index 100% rename from lib/predefinedOrders/CDB.js rename to packages/ebics-client/lib/predefinedOrders/CDB.js diff --git a/lib/predefinedOrders/CDD.js b/packages/ebics-client/lib/predefinedOrders/CDD.js similarity index 100% rename from lib/predefinedOrders/CDD.js rename to packages/ebics-client/lib/predefinedOrders/CDD.js diff --git a/lib/predefinedOrders/CDS.js b/packages/ebics-client/lib/predefinedOrders/CDS.js similarity index 100% rename from lib/predefinedOrders/CDS.js rename to packages/ebics-client/lib/predefinedOrders/CDS.js diff --git a/lib/predefinedOrders/HAA.js b/packages/ebics-client/lib/predefinedOrders/HAA.js similarity index 100% rename from lib/predefinedOrders/HAA.js rename to packages/ebics-client/lib/predefinedOrders/HAA.js diff --git a/lib/predefinedOrders/HAC.js b/packages/ebics-client/lib/predefinedOrders/HAC.js similarity index 100% rename from lib/predefinedOrders/HAC.js rename to packages/ebics-client/lib/predefinedOrders/HAC.js diff --git a/lib/predefinedOrders/HIA.js b/packages/ebics-client/lib/predefinedOrders/HIA.js similarity index 100% rename from lib/predefinedOrders/HIA.js rename to packages/ebics-client/lib/predefinedOrders/HIA.js diff --git a/lib/predefinedOrders/HKD.js b/packages/ebics-client/lib/predefinedOrders/HKD.js similarity index 100% rename from lib/predefinedOrders/HKD.js rename to packages/ebics-client/lib/predefinedOrders/HKD.js diff --git a/lib/predefinedOrders/HPB.js b/packages/ebics-client/lib/predefinedOrders/HPB.js similarity index 100% rename from lib/predefinedOrders/HPB.js rename to packages/ebics-client/lib/predefinedOrders/HPB.js diff --git a/lib/predefinedOrders/HPD.js b/packages/ebics-client/lib/predefinedOrders/HPD.js similarity index 100% rename from lib/predefinedOrders/HPD.js rename to packages/ebics-client/lib/predefinedOrders/HPD.js diff --git a/lib/predefinedOrders/HTD.js b/packages/ebics-client/lib/predefinedOrders/HTD.js similarity index 100% rename from lib/predefinedOrders/HTD.js rename to packages/ebics-client/lib/predefinedOrders/HTD.js diff --git a/lib/predefinedOrders/INI.js b/packages/ebics-client/lib/predefinedOrders/INI.js similarity index 100% rename from lib/predefinedOrders/INI.js rename to packages/ebics-client/lib/predefinedOrders/INI.js diff --git a/lib/predefinedOrders/PTK.js b/packages/ebics-client/lib/predefinedOrders/PTK.js similarity index 100% rename from lib/predefinedOrders/PTK.js rename to packages/ebics-client/lib/predefinedOrders/PTK.js diff --git a/lib/predefinedOrders/STA.js b/packages/ebics-client/lib/predefinedOrders/STA.js similarity index 100% rename from lib/predefinedOrders/STA.js rename to packages/ebics-client/lib/predefinedOrders/STA.js diff --git a/lib/predefinedOrders/VMK.js b/packages/ebics-client/lib/predefinedOrders/VMK.js similarity index 100% rename from lib/predefinedOrders/VMK.js rename to packages/ebics-client/lib/predefinedOrders/VMK.js diff --git a/lib/predefinedOrders/XCT.js b/packages/ebics-client/lib/predefinedOrders/XCT.js similarity index 100% rename from lib/predefinedOrders/XCT.js rename to packages/ebics-client/lib/predefinedOrders/XCT.js diff --git a/lib/predefinedOrders/XE3.js b/packages/ebics-client/lib/predefinedOrders/XE3.js similarity index 100% rename from lib/predefinedOrders/XE3.js rename to packages/ebics-client/lib/predefinedOrders/XE3.js diff --git a/lib/predefinedOrders/Z53.js b/packages/ebics-client/lib/predefinedOrders/Z53.js similarity index 100% rename from lib/predefinedOrders/Z53.js rename to packages/ebics-client/lib/predefinedOrders/Z53.js diff --git a/lib/predefinedOrders/index.js b/packages/ebics-client/lib/predefinedOrders/index.js similarity index 100% rename from lib/predefinedOrders/index.js rename to packages/ebics-client/lib/predefinedOrders/index.js diff --git a/lib/storages/fsKeysStorage.js b/packages/ebics-client/lib/storages/fsKeysStorage.js similarity index 100% rename from lib/storages/fsKeysStorage.js rename to packages/ebics-client/lib/storages/fsKeysStorage.js diff --git a/lib/storages/tracesStorage.js b/packages/ebics-client/lib/storages/tracesStorage.js similarity index 100% rename from lib/storages/tracesStorage.js rename to packages/ebics-client/lib/storages/tracesStorage.js diff --git a/lib/utils.js b/packages/ebics-client/lib/utils.js similarity index 100% rename from lib/utils.js rename to packages/ebics-client/lib/utils.js diff --git a/packages/ebics-client/package.json b/packages/ebics-client/package.json new file mode 100644 index 0000000..21edbf9 --- /dev/null +++ b/packages/ebics-client/package.json @@ -0,0 +1,43 @@ +{ + "name": "ebics-client", + "version": "0.0.7", + "description": "Node.js ISO 20022 Compliant EBICS Client", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://github.com/eCollect/node-ebics-client" + }, + "keywords": [ + "EBICS", + "ISO20022", + "nodejs", + "api" + ], + "author": "eCollect Sofia Tech Team", + "contributors": [ + { + "name": "Vasyl Stashuk", + "url": "https://github.com/vasyas" + }, + { + "name": "Yago", + "url": "https://github.com/yagop" + } + ], + "license": "MIT", + "dependencies": { + "bn.js": "^4.11.8", + "handlebars": "^4.0.11", + "js2xmlparser": "^3.0.0", + "moment": "^2.22.1", + "node-rsa": "^0.4.2", + "request": "^2.87.0", + "uuid": "^3.3.2", + "xml-crypto": "^0.10.1", + "xmldom": "^0.1.27", + "xpath": "0.0.27" + } +} diff --git a/test/responseParser.js b/packages/ebics-client/test/responseParser.js similarity index 100% rename from test/responseParser.js rename to packages/ebics-client/test/responseParser.js