working plugin import
This commit is contained in:
Generated
+148
-72
@@ -2074,15 +2074,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"frontblock-generic": {
|
"frontblock-generic": {
|
||||||
"version": "0.34.1",
|
"version": "0.34.8",
|
||||||
"resolved": "https://registry.npmjs.org/frontblock-generic/-/frontblock-generic-0.34.1.tgz",
|
"resolved": "https://registry.npmjs.org/frontblock-generic/-/frontblock-generic-0.34.8.tgz",
|
||||||
"integrity": "sha512-BiVUzpJSFV3FbnpdP3mxQTi1ivzlA9BXNrVp6rjuvNuxJYK1JIcd7Lhfaw1xR5v9XRPCBVVgksH37zfMUAPMjg==",
|
"integrity": "sha512-3Nx+muI2qz3PS/5372EtNd0nTyrQaflJk3qCpG4gSppDW6zb+BVACe2RNyF2IfoFVBwJByQ2yVVhN18Gcrl2dQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/lowdb": "^1.0.9",
|
"@types/lowdb": "^1.0.9",
|
||||||
"@types/node": "^12.7.1",
|
"@types/node": "^12.7.1",
|
||||||
"bsock": "^0.1.9",
|
"bsock": "^0.1.9",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"fs": "0.0.1-security",
|
"fs": "0.0.1-security",
|
||||||
|
"git-describe": "^4.0.4",
|
||||||
"http": "0.0.0",
|
"http": "0.0.0",
|
||||||
"key-file-storage": "^2.2.4",
|
"key-file-storage": "^2.2.4",
|
||||||
"knex": "^0.19.2",
|
"knex": "^0.19.2",
|
||||||
@@ -2090,6 +2091,7 @@
|
|||||||
"lowdb": "^1.0.0",
|
"lowdb": "^1.0.0",
|
||||||
"minimist": "^1.2.0",
|
"minimist": "^1.2.0",
|
||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
|
"simple-git": "^1.126.0",
|
||||||
"uuid": "^3.3.2"
|
"uuid": "^3.3.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -2097,6 +2099,14 @@
|
|||||||
"version": "12.7.5",
|
"version": "12.7.5",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.5.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.5.tgz",
|
||||||
"integrity": "sha512-9fq4jZVhPNW8r+UYKnxF1e2HkDWOWKM5bC2/7c9wPV835I0aOrVbS/Hw/pWPk2uKrNXQqg9Z959Kz+IYDd5p3w=="
|
"integrity": "sha512-9fq4jZVhPNW8r+UYKnxF1e2HkDWOWKM5bC2/7c9wPV835I0aOrVbS/Hw/pWPk2uKrNXQqg9Z959Kz+IYDd5p3w=="
|
||||||
|
},
|
||||||
|
"simple-git": {
|
||||||
|
"version": "1.126.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/simple-git/-/simple-git-1.126.0.tgz",
|
||||||
|
"integrity": "sha512-47mqHxgZnN8XRa9HbpWprzUv3Ooqz9RY/LSZgvA7jCkW8jcwLahMz7LKugY91KZehfG0sCVPtgXiU72hd6b1Bw==",
|
||||||
|
"requires": {
|
||||||
|
"debug": "^4.0.1"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -2153,25 +2163,29 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"abbrev": {
|
"abbrev": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"ansi-regex": {
|
"ansi-regex": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"aproba": {
|
"aproba": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"are-we-there-yet": {
|
"are-we-there-yet": {
|
||||||
"version": "1.1.5",
|
"version": "1.1.5",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2181,13 +2195,15 @@
|
|||||||
},
|
},
|
||||||
"balanced-match": {
|
"balanced-match": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"brace-expansion": {
|
"brace-expansion": {
|
||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2197,37 +2213,43 @@
|
|||||||
},
|
},
|
||||||
"chownr": {
|
"chownr": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"code-point-at": {
|
"code-point-at": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"concat-map": {
|
"concat-map": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"console-control-strings": {
|
"console-control-strings": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"core-util-is": {
|
"core-util-is": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"debug": {
|
"debug": {
|
||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2236,25 +2258,29 @@
|
|||||||
},
|
},
|
||||||
"deep-extend": {
|
"deep-extend": {
|
||||||
"version": "0.6.0",
|
"version": "0.6.0",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"delegates": {
|
"delegates": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"detect-libc": {
|
"detect-libc": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"fs-minipass": {
|
"fs-minipass": {
|
||||||
"version": "1.2.5",
|
"version": "1.2.5",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2263,13 +2289,15 @@
|
|||||||
},
|
},
|
||||||
"fs.realpath": {
|
"fs.realpath": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"gauge": {
|
"gauge": {
|
||||||
"version": "2.7.4",
|
"version": "2.7.4",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2285,7 +2313,8 @@
|
|||||||
},
|
},
|
||||||
"glob": {
|
"glob": {
|
||||||
"version": "7.1.3",
|
"version": "7.1.3",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2299,13 +2328,15 @@
|
|||||||
},
|
},
|
||||||
"has-unicode": {
|
"has-unicode": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"iconv-lite": {
|
"iconv-lite": {
|
||||||
"version": "0.4.24",
|
"version": "0.4.24",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2314,7 +2345,8 @@
|
|||||||
},
|
},
|
||||||
"ignore-walk": {
|
"ignore-walk": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2323,7 +2355,8 @@
|
|||||||
},
|
},
|
||||||
"inflight": {
|
"inflight": {
|
||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2333,19 +2366,22 @@
|
|||||||
},
|
},
|
||||||
"inherits": {
|
"inherits": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"ini": {
|
"ini": {
|
||||||
"version": "1.3.5",
|
"version": "1.3.5",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"is-fullwidth-code-point": {
|
"is-fullwidth-code-point": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2354,13 +2390,15 @@
|
|||||||
},
|
},
|
||||||
"isarray": {
|
"isarray": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"minimatch": {
|
"minimatch": {
|
||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2369,13 +2407,15 @@
|
|||||||
},
|
},
|
||||||
"minimist": {
|
"minimist": {
|
||||||
"version": "0.0.8",
|
"version": "0.0.8",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"minipass": {
|
"minipass": {
|
||||||
"version": "2.3.5",
|
"version": "2.3.5",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2385,7 +2425,8 @@
|
|||||||
},
|
},
|
||||||
"minizlib": {
|
"minizlib": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.1",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2394,7 +2435,8 @@
|
|||||||
},
|
},
|
||||||
"mkdirp": {
|
"mkdirp": {
|
||||||
"version": "0.5.1",
|
"version": "0.5.1",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2403,13 +2445,15 @@
|
|||||||
},
|
},
|
||||||
"ms": {
|
"ms": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"needle": {
|
"needle": {
|
||||||
"version": "2.3.0",
|
"version": "2.3.0",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2420,7 +2464,8 @@
|
|||||||
},
|
},
|
||||||
"node-pre-gyp": {
|
"node-pre-gyp": {
|
||||||
"version": "0.12.0",
|
"version": "0.12.0",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2438,7 +2483,8 @@
|
|||||||
},
|
},
|
||||||
"nopt": {
|
"nopt": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.1",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2448,13 +2494,15 @@
|
|||||||
},
|
},
|
||||||
"npm-bundled": {
|
"npm-bundled": {
|
||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"npm-packlist": {
|
"npm-packlist": {
|
||||||
"version": "1.4.1",
|
"version": "1.4.1",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2464,7 +2512,8 @@
|
|||||||
},
|
},
|
||||||
"npmlog": {
|
"npmlog": {
|
||||||
"version": "4.1.2",
|
"version": "4.1.2",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2476,19 +2525,22 @@
|
|||||||
},
|
},
|
||||||
"number-is-nan": {
|
"number-is-nan": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"object-assign": {
|
"object-assign": {
|
||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"once": {
|
"once": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2497,19 +2549,22 @@
|
|||||||
},
|
},
|
||||||
"os-homedir": {
|
"os-homedir": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"os-tmpdir": {
|
"os-tmpdir": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"osenv": {
|
"osenv": {
|
||||||
"version": "0.1.5",
|
"version": "0.1.5",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2519,19 +2574,22 @@
|
|||||||
},
|
},
|
||||||
"path-is-absolute": {
|
"path-is-absolute": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"process-nextick-args": {
|
"process-nextick-args": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"rc": {
|
"rc": {
|
||||||
"version": "1.2.8",
|
"version": "1.2.8",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2543,7 +2601,8 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minimist": {
|
"minimist": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
}
|
}
|
||||||
@@ -2551,7 +2610,8 @@
|
|||||||
},
|
},
|
||||||
"readable-stream": {
|
"readable-stream": {
|
||||||
"version": "2.3.6",
|
"version": "2.3.6",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2566,7 +2626,8 @@
|
|||||||
},
|
},
|
||||||
"rimraf": {
|
"rimraf": {
|
||||||
"version": "2.6.3",
|
"version": "2.6.3",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2575,43 +2636,50 @@
|
|||||||
},
|
},
|
||||||
"safe-buffer": {
|
"safe-buffer": {
|
||||||
"version": "5.1.2",
|
"version": "5.1.2",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"safer-buffer": {
|
"safer-buffer": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"sax": {
|
"sax": {
|
||||||
"version": "1.2.4",
|
"version": "1.2.4",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"semver": {
|
"semver": {
|
||||||
"version": "5.7.0",
|
"version": "5.7.0",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"set-blocking": {
|
"set-blocking": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"signal-exit": {
|
"signal-exit": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"string-width": {
|
"string-width": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2622,7 +2690,8 @@
|
|||||||
},
|
},
|
||||||
"string_decoder": {
|
"string_decoder": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2631,7 +2700,8 @@
|
|||||||
},
|
},
|
||||||
"strip-ansi": {
|
"strip-ansi": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2640,13 +2710,15 @@
|
|||||||
},
|
},
|
||||||
"strip-json-comments": {
|
"strip-json-comments": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"tar": {
|
"tar": {
|
||||||
"version": "4.4.8",
|
"version": "4.4.8",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2661,13 +2733,15 @@
|
|||||||
},
|
},
|
||||||
"util-deprecate": {
|
"util-deprecate": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"wide-align": {
|
"wide-align": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.3",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -2676,13 +2750,15 @@
|
|||||||
},
|
},
|
||||||
"wrappy": {
|
"wrappy": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"yallist": {
|
"yallist": {
|
||||||
"version": "3.0.3",
|
"version": "3.0.3",
|
||||||
"bundled": true,
|
"resolved": false,
|
||||||
|
"integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
}
|
}
|
||||||
@@ -3698,9 +3774,9 @@
|
|||||||
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
|
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
|
||||||
},
|
},
|
||||||
"minipass": {
|
"minipass": {
|
||||||
"version": "2.6.2",
|
"version": "2.6.4",
|
||||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-2.6.2.tgz",
|
"resolved": "https://registry.npmjs.org/minipass/-/minipass-2.6.4.tgz",
|
||||||
"integrity": "sha512-38Jwdc8AttUDaQAIRX8Iaw3QoCDWjAwKMGeGDF9JUi9QCPMjH5qAQg/hdO8o1nC7Nmh1/CqzMg5FQPEKuKwznQ==",
|
"integrity": "sha512-D/+wBy2YykFsCcWvaIslCKKus5tqGQZ8MhEzNx4mujLNgHhXWaaUOZkok6/kztAlTt0QkYLEyIShrybNmzoeTA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"safe-buffer": "^5.1.2",
|
"safe-buffer": "^5.1.2",
|
||||||
"yallist": "^3.0.0"
|
"yallist": "^3.0.0"
|
||||||
|
|||||||
+2
-2
@@ -10,7 +10,7 @@
|
|||||||
"build-frontend": "npm run build-dashboard; cp ./dist/FrontblockLib.js ./dist/static",
|
"build-frontend": "npm run build-dashboard; cp ./dist/FrontblockLib.js ./dist/static",
|
||||||
"build-dashboard": "git submodule init && git submodule update --merge; cd src/frontend; npm i && npm run build; mkdir ../../dist/static; cp -r dist/* ../../dist/static",
|
"build-dashboard": "git submodule init && git submodule update --merge; cd src/frontend; npm i && npm run build; mkdir ../../dist/static; cp -r dist/* ../../dist/static",
|
||||||
"clean": "rm -rf lib static plugins conf dist widget .rpt2_cache *.js *.ts src/frontend/dist data",
|
"clean": "rm -rf lib static plugins conf dist widget .rpt2_cache *.js *.ts src/frontend/dist data",
|
||||||
"update-frontblock": " npm install frontblock-generic@latest frontblock@latest",
|
"update-frontblock": "npm remove frontblock frontblock-generic; npm install frontblock-generic@latest frontblock@latest",
|
||||||
"webpack": "webpack --config src/backend/webpack.prod.js --progress --colors"
|
"webpack": "webpack --config src/backend/webpack.prod.js --progress --colors"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
"debug": "^4.1.1",
|
"debug": "^4.1.1",
|
||||||
"express": "^4.16.4",
|
"express": "^4.16.4",
|
||||||
"frontblock": "^0.15.1",
|
"frontblock": "^0.15.1",
|
||||||
"frontblock-generic": "^0.34.1",
|
"frontblock-generic": "^0.34.8",
|
||||||
"git-cherrypicker": "0.0.3",
|
"git-cherrypicker": "0.0.3",
|
||||||
"git-describe": "^4.0.4",
|
"git-describe": "^4.0.4",
|
||||||
"http": "0.0.0",
|
"http": "0.0.0",
|
||||||
|
|||||||
+162
-133
@@ -3,28 +3,25 @@ import * as Logger from 'log4js'
|
|||||||
import * as Knex from 'knex'
|
import * as Knex from 'knex'
|
||||||
import * as Path from 'path'
|
import * as Path from 'path'
|
||||||
import { FrontblockApiClient, FrontblockApiConf } from 'frontblock';
|
import { FrontblockApiClient, FrontblockApiConf } from 'frontblock';
|
||||||
import { getLogger } from 'frontblock-generic/Types';
|
import { getLogger, SubscriptionResponse, Coin, AccountMap, TransactionMap } from 'frontblock-generic/Types';
|
||||||
import { AdminBase, NotificationSeverity } from 'frontblock-generic/Admin';
|
import { AdminBase, NotificationSeverity, TableDefiniton } from 'frontblock-generic/Admin';
|
||||||
import { IFrontblockApiClient } from 'frontblock-generic/Api';
|
import { IFrontblockApiClient, FrontblockApi } from 'frontblock-generic/Api';
|
||||||
import { Plugin } from 'frontblock-generic/Plugin';
|
import { Plugin, RPCExporter } from 'frontblock-generic/Plugin';
|
||||||
import { socketioRPC } from 'frontblock-generic/RPC';
|
|
||||||
import { GitUpdater, RepoFolderStatus } from './GitUpdater';
|
|
||||||
|
|
||||||
const logger:Logger.Logger = getLogger("admin", 'debug')
|
const logger:Logger.Logger = getLogger("admin", 'debug')
|
||||||
|
|
||||||
|
export type AdminConf = {
|
||||||
export type AdminConf = { httpPort: number}
|
httpPort: number,
|
||||||
|
apiConf: FrontblockApiConf
|
||||||
|
dbConf:Knex.Config,
|
||||||
|
eventBusConf: { [topic in string]: NotificationSeverity}
|
||||||
|
}
|
||||||
|
|
||||||
export class FrontblockAdmin extends AdminBase<AdminConf>{
|
export class FrontblockAdmin extends AdminBase<AdminConf>{
|
||||||
|
|
||||||
private pluginUpdaters:{[name in string]:GitUpdater} = {}
|
public apiClient: IFrontblockApiClient = this.makeApiClient(this.getConfigKey("apiConf"))
|
||||||
|
|
||||||
constructor(runningPlugins: Plugin[] = []){
|
getDefaultConfig(): AdminConf {
|
||||||
super(runningPlugins)
|
|
||||||
this.initialize().then(() => this.makeKnex(this.getConfigKey('dbConf'))).then(() => logger.debug("Admin initialization finished"))
|
|
||||||
}
|
|
||||||
|
|
||||||
getDefaultConfig(): { apiConf: FrontblockApiConf; } & AdminConf & { dbConf:Knex.Config; eventBusConf: { [topic in string]: NotificationSeverity}} {
|
|
||||||
return {
|
return {
|
||||||
httpPort: 8080,
|
httpPort: 8080,
|
||||||
eventBusConf: {
|
eventBusConf: {
|
||||||
@@ -46,130 +43,162 @@ export class FrontblockAdmin extends AdminBase<AdminConf>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constructor(runningPlugins: Plugin[] = []){
|
||||||
|
super(runningPlugins)
|
||||||
|
this.initialize().then(() => this.makeKnex(this.getConfigKey('dbConf'))).then(() => logger.debug("Admin initialization finished"))
|
||||||
|
}
|
||||||
|
|
||||||
|
initApis(socket){
|
||||||
|
const quit = async(uid:string) => {return await this.quit(this.getConfigKey('apiConf').apiKey, uid) }
|
||||||
|
const exporter:RPCExporter = {
|
||||||
|
name: 'ApiClient',
|
||||||
|
exportRPCs: () => {
|
||||||
|
return [{
|
||||||
|
name: "subscribe",
|
||||||
|
func: async <C extends Coin>(coin: C, account: AccountMap[C]) => { return await this.subscribe(this.getConfigKey('apiConf').apiKey, coin, account)},
|
||||||
|
type: 'call',
|
||||||
|
visibility: 'private'
|
||||||
|
},{
|
||||||
|
name: "subsume",
|
||||||
|
func: async <C extends Coin>(coin: C, account: AccountMap[C], callback: (tx: TransactionMap[C]) => void) => { return await this.subsume(this.getConfigKey('apiConf').apiKey, coin, account, callback)},
|
||||||
|
type: 'hook',
|
||||||
|
unhook: quit,
|
||||||
|
visibility: 'private'
|
||||||
|
},{
|
||||||
|
name: 'unsubscribe',
|
||||||
|
func: async(uid:string) => { return await this.unsubscribe(this.getConfigKey('apiConf').apiKey, uid) },
|
||||||
|
type: 'call',
|
||||||
|
visibility: 'private'
|
||||||
|
},{
|
||||||
|
name: 'consume',
|
||||||
|
func: async<C extends Coin>(uid: string, callback: (tx: TransactionMap[C]) => void) => {return await this.consume(this.getConfigKey('apiConf').apiKey, uid, callback)},
|
||||||
|
type: 'hook',
|
||||||
|
unhook: quit,
|
||||||
|
visibility: 'private'
|
||||||
|
},{
|
||||||
|
name: 'quit',
|
||||||
|
func: quit,
|
||||||
|
type: 'call',
|
||||||
|
visibility: 'private'
|
||||||
|
},{
|
||||||
|
name: "getSubscriptions",
|
||||||
|
func: async() => { return await this.getSubscriptions() },
|
||||||
|
type: "call",
|
||||||
|
visibility: "private"
|
||||||
|
},{
|
||||||
|
name: "getConsumers",
|
||||||
|
func: async() => { return await this.getConsumers() },
|
||||||
|
type: "call",
|
||||||
|
visibility: "private"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.initApis(socket, [exporter])
|
||||||
|
}
|
||||||
|
|
||||||
|
async getConsumers(): Promise<SubscriptionResponse[]> {
|
||||||
|
const records = await this.knex.select('*').from('consumers')
|
||||||
|
return records.map(r => JSON.parse(r.JSON))
|
||||||
|
}
|
||||||
|
|
||||||
|
async getSubscriptions(): Promise<SubscriptionResponse[]> {
|
||||||
|
const records = await this.knex.select('*').from('subscriptions')
|
||||||
|
return records.map(r => JSON.parse(r.JSON))
|
||||||
|
}
|
||||||
|
|
||||||
|
private subscribe:FrontblockApi['subscribe'] = async (apiKey, coin, account) => {
|
||||||
|
const res = await this.apiClient.subscribe(apiKey, coin, account)
|
||||||
|
if(res instanceof SubscriptionResponse){
|
||||||
|
await this.insert('subscriptions', [{uuid: res.uid, coin:coin, JSON: JSON.stringify(res)}], "apiclient", "Info")
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
|
private consume:FrontblockApi['consume'] = async (apikey, uuid, callback) => {
|
||||||
|
const res = await this.apiClient.consume(apikey, uuid, callback)
|
||||||
|
if(res instanceof SubscriptionResponse){
|
||||||
|
await this.insert('consumers', [{uuid: res.uid, coin:undefined, JSON: JSON.stringify(res)}], "apiclient", "Info")
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
|
private unsubscribe:FrontblockApi['unsubscribe'] = async (apikey, uuid) => {
|
||||||
|
const res = await this.apiClient.unsubscribe(apikey, uuid)
|
||||||
|
await this.knex('subscriptions')
|
||||||
|
.where('uuid', uuid)
|
||||||
|
.del()
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
|
private quit:FrontblockApi['quit'] = async (apikey, uuid) => {
|
||||||
|
const res = await this.apiClient.quit(apikey, uuid)
|
||||||
|
await this.knex('consumers')
|
||||||
|
.where('uuid', uuid)
|
||||||
|
.del()
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
|
private subsume:FrontblockApi['subsume'] = async (apikey, coin, account, callback) => {
|
||||||
|
const res = await this.apiClient.subsume(apikey, coin, account, callback)
|
||||||
|
if(res instanceof SubscriptionResponse){
|
||||||
|
await Promise.all([
|
||||||
|
this.insert('consumers', [{
|
||||||
|
uuid: res.uid,
|
||||||
|
coin:coin,
|
||||||
|
JSON: JSON.stringify(res)
|
||||||
|
}], "apiclient", "Info"),
|
||||||
|
|
||||||
|
this.insert('subscriptions', [{
|
||||||
|
uuid: res.uid,
|
||||||
|
coin:coin,
|
||||||
|
JSON: JSON.stringify(new SubscriptionResponse(res.message!))
|
||||||
|
}], "apiclient", "Info")
|
||||||
|
])
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
|
setConfig(conf:AdminConf & { dbConf: Knex.Config; eventBusConf: {[x in string]:NotificationSeverity} }):AdminConf & { dbConf: Knex.Config; eventBusConf: {[x in string]:NotificationSeverity} }{
|
||||||
|
const currConf = this.getConfig()
|
||||||
|
if(JSON.stringify(currConf.apiConf) !== JSON.stringify(conf.apiConf)){
|
||||||
|
this.makeApiClient(conf.apiConf)
|
||||||
|
}
|
||||||
|
return super.setConfig(conf)
|
||||||
|
}
|
||||||
|
|
||||||
|
setConfigKey(key: string, value: any):AdminConf & { dbConf: Knex.Config; eventBusConf: {[x in string]:NotificationSeverity} }{
|
||||||
|
if(key === 'apiConf'){
|
||||||
|
this.makeApiClient(value)
|
||||||
|
}
|
||||||
|
return super.setConfigKey(key, value)
|
||||||
|
}
|
||||||
|
|
||||||
|
getTableDefinitions(): TableDefiniton[] {
|
||||||
|
return [
|
||||||
|
...super.getTableDefinitions(),
|
||||||
|
{
|
||||||
|
name: 'subscriptions',
|
||||||
|
tableBuilder: function (table) {
|
||||||
|
table.string('uuid').primary();
|
||||||
|
table.string('coin');
|
||||||
|
table.string('JSON');
|
||||||
|
}
|
||||||
|
},{
|
||||||
|
name: 'consumers',
|
||||||
|
tableBuilder: function (table) {
|
||||||
|
table.string('uuid').primary();
|
||||||
|
table.string('coin');
|
||||||
|
table.string('JSON');
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
protected makeApiClient(conf: FrontblockApiConf): IFrontblockApiClient {
|
protected makeApiClient(conf: FrontblockApiConf): IFrontblockApiClient {
|
||||||
if(this.apiClient) this.apiClient.disconnect()
|
if(this.apiClient) this.apiClient.disconnect()
|
||||||
this.apiClient = new FrontblockApiClient(conf)
|
this.apiClient = new FrontblockApiClient(conf)
|
||||||
this.apiClient.connect()
|
this.apiClient.connect()
|
||||||
return this.apiClient
|
return this.apiClient
|
||||||
}
|
}
|
||||||
|
|
||||||
exportRPCs():socketioRPC[]{
|
|
||||||
return [
|
|
||||||
...super.exportRPCs(),
|
|
||||||
{
|
|
||||||
name: 'installPlugin',
|
|
||||||
func: async (name:string, force = false) => {return await this.installPlugin(name, force)},
|
|
||||||
type: 'call',
|
|
||||||
visibility: 'private'
|
|
||||||
},{
|
|
||||||
name: 'startPlugin',
|
|
||||||
func: async (name:string) => {return await this.startPlugin(name)},
|
|
||||||
type: 'call',
|
|
||||||
visibility: 'private'
|
|
||||||
},{
|
|
||||||
name: 'updatePlugin',
|
|
||||||
func: async (name) => {return await this.updatePlugin(name)},
|
|
||||||
type: 'call',
|
|
||||||
visibility: 'private'
|
|
||||||
},{
|
|
||||||
name: 'setPluginVersion',
|
|
||||||
func: async (name, tag) => {return await this.setPluginVersion(name, tag)},
|
|
||||||
type: 'call',
|
|
||||||
visibility: 'private'
|
|
||||||
},{
|
|
||||||
name: 'getLoadedPluginNames',
|
|
||||||
func: async () => {return await this.getPlugins().map(p => p.name)},
|
|
||||||
type: 'call',
|
|
||||||
visibility: 'private'
|
|
||||||
},{
|
|
||||||
name: 'selfUpdate',
|
|
||||||
type:'call',
|
|
||||||
func: async (force: boolean) => {return await this.selfUpdate(force)},
|
|
||||||
visibility: 'private'
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
private async selfUpdate(force:boolean = false){
|
|
||||||
const updater = new GitUpdater("./dist")
|
|
||||||
let status = await updater.getStatus()
|
|
||||||
if(force || !status.remote || !status.remote.includes("fb-dist/admin") || !status.exists || status.empty || !status.currentTag){
|
|
||||||
logger.warn("Cloning fb-dist/admin into ./dist ..."+(force?" USING FORCE!":""))
|
|
||||||
status = await updater.cloneRepo("https://gitea.frontblock.me/fb-dist/admin.git", force)
|
|
||||||
|
|
||||||
this.destroy()
|
|
||||||
const installer = require("./Installer").installAdmin
|
|
||||||
installer(this.getPlugins())
|
|
||||||
}
|
|
||||||
return status
|
|
||||||
}
|
|
||||||
|
|
||||||
async installPlugin(name: string, force:boolean = false):Promise<RepoFolderStatus>{
|
|
||||||
logger.warn("Cloning fb-dist/"+name+".git into ./plugins/"+name+" ..."+(force?" USING FORCE!":""))
|
|
||||||
this.pluginUpdaters[name] = new GitUpdater("./plugins/"+name)
|
|
||||||
const status = await this.pluginUpdaters[name].cloneRepo("https://gitea.frontblock.me/fb-dist/"+name.toLowerCase()+".git", force)
|
|
||||||
return status
|
|
||||||
}
|
|
||||||
|
|
||||||
async startPlugin(name:string):Promise<boolean>{
|
|
||||||
if(!this.pluginUpdaters[name]) return false
|
|
||||||
const status = await this.pluginUpdaters[name].getStatus()
|
|
||||||
if(!status.exists || status.empty || !status.tags || status.tags.length === 0){
|
|
||||||
if(status.currentTag && !status.latestTag){
|
|
||||||
//git glitches sometimes if you check immediately after clone
|
|
||||||
logger.warn("re-fetching tag for "+name+"...")
|
|
||||||
return await this.startPlugin(name)
|
|
||||||
}
|
|
||||||
logger.error("Bad repo status", name, status)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
/* if(this.loadedPlugins[name]){
|
|
||||||
logger.error("Plugin", name, "is already started")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
let str = "../plugins/"+name+"/Plugin"
|
|
||||||
const pluginClass = await eval('require')(str)
|
|
||||||
const pluginObj = new pluginClass.default()
|
|
||||||
await pluginObj.start()
|
|
||||||
this.addPlugin(pluginObj)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
async updatePlugin(name:string):Promise<boolean>{
|
|
||||||
if(!this.pluginUpdaters[name]) return false
|
|
||||||
const status = await this.pluginUpdaters[name].getStatus()
|
|
||||||
if(!status.exists || status.empty || !status.tags || status.tags.length === 0){
|
|
||||||
logger.error("Bad repo status", name, status)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if(status.currentTag == status.latestTag){
|
|
||||||
logger.warn(name, "already at latest tag")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
if(this.loadedPlugins[name]){
|
|
||||||
logger.error("Plugin", name, "is running. Stop it first")
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
this.pluginUpdaters[name].checkoutTag(status.latestTag!)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
async setPluginVersion(pluginName:string, tag:string):Promise<RepoFolderStatus>{
|
|
||||||
const status = await this.pluginUpdaters[pluginName].getStatus()
|
|
||||||
if(!status.exists || !status.tags || status.tags.length === 0 || !status.tags.includes(tag)){
|
|
||||||
logger.error("Bad repo status", pluginName, status)
|
|
||||||
return status
|
|
||||||
}
|
|
||||||
|
|
||||||
return await this.pluginUpdaters[pluginName].checkoutTag(tag)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
process.on( 'SIGINT', function() {
|
process.on( 'SIGINT', function() {
|
||||||
|
|||||||
@@ -68,9 +68,7 @@ module.exports = [{
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
externals:{
|
externals:["./Installer"],
|
||||||
"./Installer": "./Installer"
|
|
||||||
},
|
|
||||||
optimization: {
|
optimization: {
|
||||||
minimize: false
|
minimize: false
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -15,8 +15,10 @@
|
|||||||
"prefix": "app",
|
"prefix": "app",
|
||||||
"architect": {
|
"architect": {
|
||||||
"build": {
|
"build": {
|
||||||
"builder": "@angular-devkit/build-angular:browser",
|
"builder": "@angular-builders/custom-webpack:browser",
|
||||||
"options": {
|
"options": {
|
||||||
|
"customWebpackConfig": {"path": "./custom-webpack.config.js"},
|
||||||
|
|
||||||
"outputPath": "dist",
|
"outputPath": "dist",
|
||||||
"index": "src/index.html",
|
"index": "src/index.html",
|
||||||
"main": "src/main.ts",
|
"main": "src/main.ts",
|
||||||
@@ -78,7 +80,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"serve": {
|
"serve": {
|
||||||
"builder": "@angular-devkit/build-angular:dev-server",
|
"builder": "@angular-builders/custom-webpack:dev-server",
|
||||||
"tsConfig": "tsconfig.app.json",
|
"tsConfig": "tsconfig.app.json",
|
||||||
"options": {
|
"options": {
|
||||||
"browserTarget": "dashboard:build"
|
"browserTarget": "dashboard:build"
|
||||||
@@ -99,7 +101,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"builder": "@angular-devkit/build-angular:karma",
|
"builder": "@angular-builders/custom-webpack:karma",
|
||||||
"options": {
|
"options": {
|
||||||
"main": "src/test.ts",
|
"main": "src/test.ts",
|
||||||
"polyfills": "src/polyfills.ts",
|
"polyfills": "src/polyfills.ts",
|
||||||
@@ -116,7 +118,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"builder": "@angular-devkit/build-angular:tslint",
|
"builder": "@angular-builders/custom-webpack:tslint",
|
||||||
"options": {
|
"options": {
|
||||||
"tsConfig": [
|
"tsConfig": [
|
||||||
"tsconfig.app.json",
|
"tsconfig.app.json",
|
||||||
@@ -130,7 +132,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"e2e": {
|
"e2e": {
|
||||||
"builder": "@angular-devkit/build-angular:protractor",
|
"builder": "@angular-builders/custom-webpack:protractor",
|
||||||
"options": {
|
"options": {
|
||||||
"protractorConfig": "e2e/protractor.conf.js",
|
"protractorConfig": "e2e/protractor.conf.js",
|
||||||
"devServerTarget": "dashboard:serve"
|
"devServerTarget": "dashboard:serve"
|
||||||
|
|||||||
Generated
+13
-39
@@ -4795,9 +4795,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"frontblock": {
|
"frontblock": {
|
||||||
"version": "0.14.9",
|
"version": "0.15.1",
|
||||||
"resolved": "https://registry.npmjs.org/frontblock/-/frontblock-0.14.9.tgz",
|
"resolved": "https://registry.npmjs.org/frontblock/-/frontblock-0.15.1.tgz",
|
||||||
"integrity": "sha512-iEjOdJ92pxg18Y9mVfjfRYzuAfxXElREoDfz8FFPaNvbO3mPv+8Y2m3jtTo8FoOpFGgA+jwOw40nT1iWKRS72A==",
|
"integrity": "sha512-nRSoAT5HZhJmYkCdX8YGya+YTnvzw0W7eG0ISr+HBUO5u4hjmnHwwA1U7VewbTNokan9JvA7TF6/QijLeSCCVA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@angular/common": "^8.2.1",
|
"@angular/common": "^8.2.1",
|
||||||
"@angular/core": "^8.2.1",
|
"@angular/core": "^8.2.1",
|
||||||
@@ -4806,7 +4806,7 @@
|
|||||||
"@angular/router": "^8.2.1",
|
"@angular/router": "^8.2.1",
|
||||||
"@clr/angular": "^2.1.1",
|
"@clr/angular": "^2.1.1",
|
||||||
"@types/node": "^11.13.10",
|
"@types/node": "^11.13.10",
|
||||||
"frontblock-generic": "^0.33.7",
|
"frontblock-generic": "^0.34.0",
|
||||||
"fs": "0.0.1-security",
|
"fs": "0.0.1-security",
|
||||||
"knex": "^0.19.2",
|
"knex": "^0.19.2",
|
||||||
"log4js": "^4.3.1",
|
"log4js": "^4.3.1",
|
||||||
@@ -4820,52 +4820,26 @@
|
|||||||
"version": "11.13.20",
|
"version": "11.13.20",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-11.13.20.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-11.13.20.tgz",
|
||||||
"integrity": "sha512-JE0UpLWZTV1sGcaj0hN+Q0760OEjpgyFJ06DOMVW6qKBducKdJQaIw0TGL6ccj7VXRduIOHLWQi+tHwulZJHVQ=="
|
"integrity": "sha512-JE0UpLWZTV1sGcaj0hN+Q0760OEjpgyFJ06DOMVW6qKBducKdJQaIw0TGL6ccj7VXRduIOHLWQi+tHwulZJHVQ=="
|
||||||
},
|
|
||||||
"frontblock-generic": {
|
|
||||||
"version": "0.33.12",
|
|
||||||
"resolved": "https://registry.npmjs.org/frontblock-generic/-/frontblock-generic-0.33.12.tgz",
|
|
||||||
"integrity": "sha512-6tQIIdqzsJxqPefxWXBfGs02ux3zKCAqyruFThlUiMxBnPPaqS13R6m74yH/lgpIDom1aPf+vwASiRUI3+5dXw==",
|
|
||||||
"requires": {
|
|
||||||
"@types/lowdb": "^1.0.9",
|
|
||||||
"@types/node": "^12.7.1",
|
|
||||||
"bsock": "^0.1.9",
|
|
||||||
"express": "^4.17.1",
|
|
||||||
"fs": "0.0.1-security",
|
|
||||||
"http": "0.0.0",
|
|
||||||
"key-file-storage": "^2.2.4",
|
|
||||||
"knex": "^0.19.2",
|
|
||||||
"log4js": "^4.2.0",
|
|
||||||
"lowdb": "^1.0.0",
|
|
||||||
"minimist": "^1.2.0",
|
|
||||||
"path": "^0.12.7",
|
|
||||||
"uuid": "^3.3.2"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@types/node": {
|
|
||||||
"version": "12.7.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.5.tgz",
|
|
||||||
"integrity": "sha512-9fq4jZVhPNW8r+UYKnxF1e2HkDWOWKM5bC2/7c9wPV835I0aOrVbS/Hw/pWPk2uKrNXQqg9Z959Kz+IYDd5p3w=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"minimist": {
|
|
||||||
"version": "1.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
|
||||||
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"frontblock-generic": {
|
"frontblock-generic": {
|
||||||
"version": "0.23.0",
|
"version": "0.34.1",
|
||||||
"resolved": "https://registry.npmjs.org/frontblock-generic/-/frontblock-generic-0.23.0.tgz",
|
"resolved": "https://registry.npmjs.org/frontblock-generic/-/frontblock-generic-0.34.1.tgz",
|
||||||
"integrity": "sha512-5KukScUCAsomGP9xMp6gQjA5xKBMfctTSQhIoaoxEkXpXoX9F2pjlYIkfP11NYNSsk2gVf3xg7VIhhSzhizy/A==",
|
"integrity": "sha512-BiVUzpJSFV3FbnpdP3mxQTi1ivzlA9BXNrVp6rjuvNuxJYK1JIcd7Lhfaw1xR5v9XRPCBVVgksH37zfMUAPMjg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
|
"@types/lowdb": "^1.0.9",
|
||||||
"@types/node": "^12.7.1",
|
"@types/node": "^12.7.1",
|
||||||
"bsock": "^0.1.9",
|
"bsock": "^0.1.9",
|
||||||
|
"express": "^4.17.1",
|
||||||
|
"fs": "0.0.1-security",
|
||||||
"http": "0.0.0",
|
"http": "0.0.0",
|
||||||
"key-file-storage": "^2.2.4",
|
"key-file-storage": "^2.2.4",
|
||||||
|
"knex": "^0.19.2",
|
||||||
"log4js": "^4.2.0",
|
"log4js": "^4.2.0",
|
||||||
|
"lowdb": "^1.0.0",
|
||||||
"minimist": "^1.2.0",
|
"minimist": "^1.2.0",
|
||||||
|
"path": "^0.12.7",
|
||||||
"uuid": "^3.3.2"
|
"uuid": "^3.3.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -7,13 +7,13 @@
|
|||||||
"start-prodlike": "npm run build-assets && ng serve --aot=false --optimization=false --proxy-config proxy.conf.json --configuration=prodlike",
|
"start-prodlike": "npm run build-assets && ng serve --aot=false --optimization=false --proxy-config proxy.conf.json --configuration=prodlike",
|
||||||
"build": "rm -f src/assets/*.js; ng build --prod --aot=false --optimization=false --build-optimizer=false",
|
"build": "rm -f src/assets/*.js; ng build --prod --aot=false --optimization=false --build-optimizer=false",
|
||||||
"build-assets": "npm run copy-frontends; npm run deep-clean-plugins",
|
"build-assets": "npm run copy-frontends; npm run deep-clean-plugins",
|
||||||
"update-frontblock": "rm -rf node_modules/frontblock*; npm install",
|
|
||||||
"get-submodules": "git submodule update --init && git submodule foreach git checkout master",
|
"get-submodules": "git submodule update --init && git submodule foreach git checkout master",
|
||||||
"copy-frontends": "for module in $(git config --file .gitmodules --get-regexp path | awk '{ print $2 }'); do npm i --prefix $module && npm run --prefix $module build && cp $module/dist/FrontendPlugin.js ./src/assets/$(basename $module).js; done",
|
"copy-frontends": "for module in $(git config --file .gitmodules --get-regexp path | awk '{ print $2 }'); do npm i --prefix $module && npm run --prefix $module build && cp $module/dist/FrontendPlugin.js ./src/assets/$(basename $module).js; done",
|
||||||
"deep-clean-plugins": "for module in $(git config --file .gitmodules --get-regexp path | awk '{ print $2 }'); do rm -rf $module/node_modules; done",
|
"deep-clean-plugins": "for module in $(git config --file .gitmodules --get-regexp path | awk '{ print $2 }'); do rm -rf $module/node_modules; done",
|
||||||
"test": "ng test",
|
"test": "ng test",
|
||||||
"lint": "ng lint",
|
"lint": "ng lint",
|
||||||
"e2e": "ng e2e"
|
"e2e": "ng e2e",
|
||||||
|
"update-frontblock": "npm remove frontblock frontblock-generic; npm install frontblock-generic@latest frontblock@latest"
|
||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -32,8 +32,8 @@
|
|||||||
"@webcomponents/custom-elements": "^1.0.0",
|
"@webcomponents/custom-elements": "^1.0.0",
|
||||||
"btc-hdkey": "0.0.17",
|
"btc-hdkey": "0.0.17",
|
||||||
"coinselect": "^3.1.11",
|
"coinselect": "^3.1.11",
|
||||||
"frontblock": "latest",
|
"frontblock": "^0.15.1",
|
||||||
"frontblock-generic": "^0.23.0",
|
"frontblock-generic": "^0.34.1",
|
||||||
"key-file-storage": "^2.2.4",
|
"key-file-storage": "^2.2.4",
|
||||||
"node-fetch": "^2.6.0",
|
"node-fetch": "^2.6.0",
|
||||||
"rxjs": "~6.5.2",
|
"rxjs": "~6.5.2",
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { ClarityModule } from '@clr/angular';
|
|||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
import {FrontendPlugin, SidebarEntries, SidebarEntry} from 'frontblock-generic/Plugin'
|
import {FrontendPlugin, SidebarEntries, SidebarEntry} from 'frontblock-generic/Plugin'
|
||||||
|
import { ApiclientWidgetComponent } from './apiclient-widget.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -27,14 +28,14 @@ import {FrontendPlugin, SidebarEntries, SidebarEntry} from 'frontblock-generic/P
|
|||||||
ApiclientConsumptionComponent,
|
ApiclientConsumptionComponent,
|
||||||
ApiclientSubscriptionComponent,
|
ApiclientSubscriptionComponent,
|
||||||
ApiclientFormComponent,
|
ApiclientFormComponent,
|
||||||
|
ApiclientWidgetComponent
|
||||||
],
|
],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
ApiclientFormComponent,
|
ApiclientFormComponent,
|
||||||
|
ApiclientWidgetComponent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class ApiclientModule implements FrontendPlugin{
|
export class ApiclientModule implements FrontendPlugin<typeof ApiclientFormComponent, typeof ApiclientWidgetComponent>{
|
||||||
getSidebarEntry(): SidebarEntry | SidebarEntries {
|
getSidebarEntry(): SidebarEntry | SidebarEntries {
|
||||||
return {
|
return {
|
||||||
icon: "terminal",
|
icon: "terminal",
|
||||||
@@ -50,7 +51,11 @@ export class ApiclientModule implements FrontendPlugin{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getSettingsComponentClassName(): any{
|
getSettingsComponent(): typeof ApiclientFormComponent{
|
||||||
return ApiclientFormComponent
|
return ApiclientFormComponent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getWidget(): typeof ApiclientWidgetComponent{
|
||||||
|
return ApiclientWidgetComponent
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ import { ErrorDisplayComponent } from './error-display/error-display.component';
|
|||||||
import { SettingsComponent } from './settings/settings.component';
|
import { SettingsComponent } from './settings/settings.component';
|
||||||
|
|
||||||
const routes: Routes = [{
|
const routes: Routes = [{
|
||||||
|
path: "apiclient",
|
||||||
|
loadChildren: () => import('./apiclient/module').then(mod => mod.ApiclientModule)
|
||||||
|
},{
|
||||||
path: "pluginmanager",
|
path: "pluginmanager",
|
||||||
loadChildren: () => import('./pluginmanager/module').then(mod => mod.PluginmanagerModule)
|
loadChildren: () => import('./pluginmanager/module').then(mod => mod.PluginmanagerModule)
|
||||||
},{
|
},{
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ export class DynamicLoaderComponent implements AfterViewInit {
|
|||||||
private async installWidget(pluginName: string) {
|
private async installWidget(pluginName: string) {
|
||||||
let module;
|
let module;
|
||||||
if (!angularCore.isDevMode()){
|
if (!angularCore.isDevMode()){
|
||||||
|
console.log("Loading "+pluginName+" from backend")
|
||||||
module = await SystemJS.import("plugins/" + pluginName + ".js");
|
module = await SystemJS.import("plugins/" + pluginName + ".js");
|
||||||
}else{
|
}else{
|
||||||
if(environment.loadLocal){
|
if(environment.loadLocal){
|
||||||
@@ -97,16 +98,18 @@ export class DynamicLoaderComponent implements AfterViewInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const plugin:FrontendPlugin = new module['PluginModule']()
|
this.injectPlugin(module)
|
||||||
this.injectPlugin(plugin)
|
this.compileModule(module)
|
||||||
this.compileModule(plugin)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
compileModule(module:any){
|
compileModule(module:any){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
injectPlugin(plugin:FrontendPlugin):void{
|
injectPlugin(module:any):void{
|
||||||
|
const plugin:FrontendPlugin = new module['PluginModule']()
|
||||||
|
if(!plugin.getSidebarEntry) return
|
||||||
|
|
||||||
const entry: SidebarEntries | SidebarEntry = plugin.getSidebarEntry()
|
const entry: SidebarEntries | SidebarEntry = plugin.getSidebarEntry()
|
||||||
const rc = this.router.config
|
const rc = this.router.config
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
<clr-header class="header header-1">
|
<clr-header class="header header-7">
|
||||||
<div class="branding">
|
<div class="branding">
|
||||||
<span class="title">Frontblock</span>
|
<a class="nav-link" [routerLink]="'home'">
|
||||||
|
<img src="assets/logo_real.png" class="clr-icon" />
|
||||||
|
<span class="title"> Frontblock</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="header-actions">
|
<div class="header-actions" style="z-index:2">
|
||||||
<a class="nav-link nav-icon-text">
|
<a class="nav-link nav-icon" aria-label="bell" routerLinkActive="active" [routerLink]="'notifications'">
|
||||||
<clr-icon shape="bug"></clr-icon>
|
<clr-icon class="has-badge" shape="bell"> </clr-icon>
|
||||||
<span class="nav-text">ALPHA {{devmode}}</span>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
<a class="nav-link nav-icon" routerLinkActive="active" [routerLink]="'settings'">
|
||||||
<div class="header-actions">
|
<clr-icon class="" shape="cog" ></clr-icon>
|
||||||
<a [routerLink]="'settings'" class="nav-link nav-icon" aria-label="settings">
|
|
||||||
<clr-icon shape="cog"></clr-icon>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</clr-header>
|
</clr-header>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<p>home works!</p>
|
<ng-container #dynamicWidgets></ng-container>
|
||||||
|
|||||||
@@ -1,15 +1,35 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit, ViewChild, ViewContainerRef, Injector, ComponentFactoryResolver, AfterViewInit } from '@angular/core';
|
||||||
|
import { FrontendPlugin } from 'frontblock-generic/Plugin';
|
||||||
|
import { ApiclientModule } from '../apiclient/module';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-home',
|
selector: 'app-home',
|
||||||
templateUrl: './home.component.html',
|
templateUrl: './home.component.html',
|
||||||
styleUrls: ['./home.component.scss']
|
styleUrls: ['./home.component.scss']
|
||||||
})
|
})
|
||||||
export class HomeComponent implements OnInit {
|
export class HomeComponent implements AfterViewInit {
|
||||||
|
|
||||||
constructor() { }
|
@ViewChild('dynamicWidgets', {read: ViewContainerRef, static: false})
|
||||||
|
settingsContainer: ViewContainerRef
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private componentFactoryResolver: ComponentFactoryResolver,
|
||||||
|
private injector: Injector
|
||||||
|
) { }
|
||||||
|
|
||||||
|
ngAfterViewInit() {
|
||||||
|
this.injectModule(new ApiclientModule())
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
injectModule(module:FrontendPlugin<any>) {
|
||||||
|
if(!module.getSettingsComponent) return
|
||||||
|
|
||||||
|
//@ts-ignore
|
||||||
|
const factory = this.componentFactoryResolver.resolveComponentFactory(module.getWidget())
|
||||||
|
const component = factory.create(this.injector)
|
||||||
|
setTimeout(() => this.settingsContainer.insert(component.hostView), 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,6 +136,16 @@ export class KnexConfigComponent implements OnInit{
|
|||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit(){
|
async ngOnInit(){
|
||||||
|
await new Promise((resolve, reject)=>{
|
||||||
|
let awaitAdmin: { (): void; (...args: any[]): void; }
|
||||||
|
(awaitAdmin = () => {
|
||||||
|
if(fb.Admin != null){
|
||||||
|
resolve()
|
||||||
|
}
|
||||||
|
setTimeout(awaitAdmin,25)
|
||||||
|
})()
|
||||||
|
})
|
||||||
|
|
||||||
const c = await fb.Admin.getConfig()
|
const c = await fb.Admin.getConfig()
|
||||||
this.conf = c.dbConf
|
this.conf = c.dbConf
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Component, ViewChild, ViewContainerRef, ComponentFactoryResolver, Injector, AfterViewInit } from '@angular/core';
|
import { Component, ViewChild, ViewContainerRef, ComponentFactoryResolver, Injector, AfterViewInit } from '@angular/core';
|
||||||
import { ApiclientModule } from '../apiclient/module'
|
import { ApiclientModule } from '../apiclient/module'
|
||||||
|
import { FrontendPlugin } from 'frontblock-generic/Plugin';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-settings',
|
selector: 'app-settings',
|
||||||
@@ -9,7 +10,7 @@ import { ApiclientModule } from '../apiclient/module'
|
|||||||
export class SettingsComponent implements AfterViewInit {
|
export class SettingsComponent implements AfterViewInit {
|
||||||
ngAfterViewInit(): void {
|
ngAfterViewInit(): void {
|
||||||
this.injectModule(new ApiclientModule())
|
this.injectModule(new ApiclientModule())
|
||||||
this.injectModule(new ApiclientModule())
|
// this.injectModule(new ApiclientModule())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ViewChild('dynamicSettings', {read: ViewContainerRef, static: false})
|
@ViewChild('dynamicSettings', {read: ViewContainerRef, static: false})
|
||||||
@@ -21,10 +22,11 @@ export class SettingsComponent implements AfterViewInit {
|
|||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
injectModule(module:any) {
|
injectModule(module:FrontendPlugin<any>) {
|
||||||
const factory = this.componentFactoryResolver.resolveComponentFactory(module.getSettingsComponentClassName())
|
if(!module.getSettingsComponent) return
|
||||||
|
|
||||||
|
const factory = this.componentFactoryResolver.resolveComponentFactory(module.getSettingsComponent())
|
||||||
const component = factory.create(this.injector)
|
const component = factory.create(this.injector)
|
||||||
setTimeout(() => this.settingsContainer.insert(component.hostView), 1)
|
setTimeout(() => this.settingsContainer.insert(component.hostView), 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { SidebarEntries, SidebarEntry } from 'frontblock-generic/Plugin';
|
import { SidebarEntries, SidebarEntry } from 'frontblock-generic/Plugin';
|
||||||
|
import { ApiclientModule } from '../apiclient/module';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'sidebar',
|
selector: 'sidebar',
|
||||||
@@ -12,7 +13,9 @@ export class SidebarComponent implements OnInit {
|
|||||||
|
|
||||||
entries:SidebarEntry[] = []
|
entries:SidebarEntry[] = []
|
||||||
|
|
||||||
multientires:SidebarEntries[] = [{
|
multientires:SidebarEntries[] = [
|
||||||
|
<SidebarEntries> new ApiclientModule().getSidebarEntry(),
|
||||||
|
{
|
||||||
icon: "bundle",
|
icon: "bundle",
|
||||||
text: "Update Manager",
|
text: "Update Manager",
|
||||||
parentRoute: "pluginmanager",
|
parentRoute: "pluginmanager",
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
|
<!--
|
||||||
<nav class="subnav">
|
<nav class="subnav">
|
||||||
<ul class="nav">
|
<ul class="nav">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" routerLinkActive="active" [routerLink]="'home'">Dashboard</a>
|
<a class="header-nav" routerLinkActive="active" [routerLink]="'home'">
|
||||||
|
<clr-icon class="is-solid" shape="home" size="24"></clr-icon>
|
||||||
<a class="nav-link" routerLinkActive="active" [routerLink]="'notifications'">Notifications</a>
|
</a>
|
||||||
|
<a class="header-nav" routerLinkActive="active" [routerLink]="'settings'">
|
||||||
<a class="nav-link" routerLinkActive="active" [routerLink]="'settings'">Settings</a>
|
<clr-icon class="is-solid" shape="cog" size="24"></clr-icon>
|
||||||
|
</a>
|
||||||
|
<a class="header-nav" routerLinkActive="active" [routerLink]="'notifications'">
|
||||||
|
<clr-icon class="is-solid has-badge" shape="bell" size="24"></clr-icon>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
-->
|
||||||
Reference in New Issue
Block a user