Browse Source

working plugin import

master
peter 2 years ago
parent
commit
0035b7463a

+ 148
- 72
package-lock.json View File

@@ -2074,15 +2074,16 @@
2074 2074
       }
2075 2075
     },
2076 2076
     "frontblock-generic": {
2077
-      "version": "0.34.1",
2078
-      "resolved": "https://registry.npmjs.org/frontblock-generic/-/frontblock-generic-0.34.1.tgz",
2079
-      "integrity": "sha512-BiVUzpJSFV3FbnpdP3mxQTi1ivzlA9BXNrVp6rjuvNuxJYK1JIcd7Lhfaw1xR5v9XRPCBVVgksH37zfMUAPMjg==",
2077
+      "version": "0.34.8",
2078
+      "resolved": "https://registry.npmjs.org/frontblock-generic/-/frontblock-generic-0.34.8.tgz",
2079
+      "integrity": "sha512-3Nx+muI2qz3PS/5372EtNd0nTyrQaflJk3qCpG4gSppDW6zb+BVACe2RNyF2IfoFVBwJByQ2yVVhN18Gcrl2dQ==",
2080 2080
       "requires": {
2081 2081
         "@types/lowdb": "^1.0.9",
2082 2082
         "@types/node": "^12.7.1",
2083 2083
         "bsock": "^0.1.9",
2084 2084
         "express": "^4.17.1",
2085 2085
         "fs": "0.0.1-security",
2086
+        "git-describe": "^4.0.4",
2086 2087
         "http": "0.0.0",
2087 2088
         "key-file-storage": "^2.2.4",
2088 2089
         "knex": "^0.19.2",
@@ -2090,6 +2091,7 @@
2090 2091
         "lowdb": "^1.0.0",
2091 2092
         "minimist": "^1.2.0",
2092 2093
         "path": "^0.12.7",
2094
+        "simple-git": "^1.126.0",
2093 2095
         "uuid": "^3.3.2"
2094 2096
       },
2095 2097
       "dependencies": {
@@ -2097,6 +2099,14 @@
2097 2099
           "version": "12.7.5",
2098 2100
           "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.5.tgz",
2099 2101
           "integrity": "sha512-9fq4jZVhPNW8r+UYKnxF1e2HkDWOWKM5bC2/7c9wPV835I0aOrVbS/Hw/pWPk2uKrNXQqg9Z959Kz+IYDd5p3w=="
2102
+        },
2103
+        "simple-git": {
2104
+          "version": "1.126.0",
2105
+          "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-1.126.0.tgz",
2106
+          "integrity": "sha512-47mqHxgZnN8XRa9HbpWprzUv3Ooqz9RY/LSZgvA7jCkW8jcwLahMz7LKugY91KZehfG0sCVPtgXiU72hd6b1Bw==",
2107
+          "requires": {
2108
+            "debug": "^4.0.1"
2109
+          }
2100 2110
         }
2101 2111
       }
2102 2112
     },
@@ -2153,25 +2163,29 @@
2153 2163
       "dependencies": {
2154 2164
         "abbrev": {
2155 2165
           "version": "1.1.1",
2156
-          "bundled": true,
2166
+          "resolved": false,
2167
+          "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
2157 2168
           "dev": true,
2158 2169
           "optional": true
2159 2170
         },
2160 2171
         "ansi-regex": {
2161 2172
           "version": "2.1.1",
2162
-          "bundled": true,
2173
+          "resolved": false,
2174
+          "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
2163 2175
           "dev": true,
2164 2176
           "optional": true
2165 2177
         },
2166 2178
         "aproba": {
2167 2179
           "version": "1.2.0",
2168
-          "bundled": true,
2180
+          "resolved": false,
2181
+          "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
2169 2182
           "dev": true,
2170 2183
           "optional": true
2171 2184
         },
2172 2185
         "are-we-there-yet": {
2173 2186
           "version": "1.1.5",
2174
-          "bundled": true,
2187
+          "resolved": false,
2188
+          "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==",
2175 2189
           "dev": true,
2176 2190
           "optional": true,
2177 2191
           "requires": {
@@ -2181,13 +2195,15 @@
2181 2195
         },
2182 2196
         "balanced-match": {
2183 2197
           "version": "1.0.0",
2184
-          "bundled": true,
2198
+          "resolved": false,
2199
+          "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
2185 2200
           "dev": true,
2186 2201
           "optional": true
2187 2202
         },
2188 2203
         "brace-expansion": {
2189 2204
           "version": "1.1.11",
2190
-          "bundled": true,
2205
+          "resolved": false,
2206
+          "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
2191 2207
           "dev": true,
2192 2208
           "optional": true,
2193 2209
           "requires": {
@@ -2197,37 +2213,43 @@
2197 2213
         },
2198 2214
         "chownr": {
2199 2215
           "version": "1.1.1",
2200
-          "bundled": true,
2216
+          "resolved": false,
2217
+          "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==",
2201 2218
           "dev": true,
2202 2219
           "optional": true
2203 2220
         },
2204 2221
         "code-point-at": {
2205 2222
           "version": "1.1.0",
2206
-          "bundled": true,
2223
+          "resolved": false,
2224
+          "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
2207 2225
           "dev": true,
2208 2226
           "optional": true
2209 2227
         },
2210 2228
         "concat-map": {
2211 2229
           "version": "0.0.1",
2212
-          "bundled": true,
2230
+          "resolved": false,
2231
+          "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
2213 2232
           "dev": true,
2214 2233
           "optional": true
2215 2234
         },
2216 2235
         "console-control-strings": {
2217 2236
           "version": "1.1.0",
2218
-          "bundled": true,
2237
+          "resolved": false,
2238
+          "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
2219 2239
           "dev": true,
2220 2240
           "optional": true
2221 2241
         },
2222 2242
         "core-util-is": {
2223 2243
           "version": "1.0.2",
2224
-          "bundled": true,
2244
+          "resolved": false,
2245
+          "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
2225 2246
           "dev": true,
2226 2247
           "optional": true
2227 2248
         },
2228 2249
         "debug": {
2229 2250
           "version": "4.1.1",
2230
-          "bundled": true,
2251
+          "resolved": false,
2252
+          "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
2231 2253
           "dev": true,
2232 2254
           "optional": true,
2233 2255
           "requires": {
@@ -2236,25 +2258,29 @@
2236 2258
         },
2237 2259
         "deep-extend": {
2238 2260
           "version": "0.6.0",
2239
-          "bundled": true,
2261
+          "resolved": false,
2262
+          "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
2240 2263
           "dev": true,
2241 2264
           "optional": true
2242 2265
         },
2243 2266
         "delegates": {
2244 2267
           "version": "1.0.0",
2245
-          "bundled": true,
2268
+          "resolved": false,
2269
+          "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=",
2246 2270
           "dev": true,
2247 2271
           "optional": true
2248 2272
         },
2249 2273
         "detect-libc": {
2250 2274
           "version": "1.0.3",
2251
-          "bundled": true,
2275
+          "resolved": false,
2276
+          "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=",
2252 2277
           "dev": true,
2253 2278
           "optional": true
2254 2279
         },
2255 2280
         "fs-minipass": {
2256 2281
           "version": "1.2.5",
2257
-          "bundled": true,
2282
+          "resolved": false,
2283
+          "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==",
2258 2284
           "dev": true,
2259 2285
           "optional": true,
2260 2286
           "requires": {
@@ -2263,13 +2289,15 @@
2263 2289
         },
2264 2290
         "fs.realpath": {
2265 2291
           "version": "1.0.0",
2266
-          "bundled": true,
2292
+          "resolved": false,
2293
+          "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
2267 2294
           "dev": true,
2268 2295
           "optional": true
2269 2296
         },
2270 2297
         "gauge": {
2271 2298
           "version": "2.7.4",
2272
-          "bundled": true,
2299
+          "resolved": false,
2300
+          "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
2273 2301
           "dev": true,
2274 2302
           "optional": true,
2275 2303
           "requires": {
@@ -2285,7 +2313,8 @@
2285 2313
         },
2286 2314
         "glob": {
2287 2315
           "version": "7.1.3",
2288
-          "bundled": true,
2316
+          "resolved": false,
2317
+          "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
2289 2318
           "dev": true,
2290 2319
           "optional": true,
2291 2320
           "requires": {
@@ -2299,13 +2328,15 @@
2299 2328
         },
2300 2329
         "has-unicode": {
2301 2330
           "version": "2.0.1",
2302
-          "bundled": true,
2331
+          "resolved": false,
2332
+          "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=",
2303 2333
           "dev": true,
2304 2334
           "optional": true
2305 2335
         },
2306 2336
         "iconv-lite": {
2307 2337
           "version": "0.4.24",
2308
-          "bundled": true,
2338
+          "resolved": false,
2339
+          "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
2309 2340
           "dev": true,
2310 2341
           "optional": true,
2311 2342
           "requires": {
@@ -2314,7 +2345,8 @@
2314 2345
         },
2315 2346
         "ignore-walk": {
2316 2347
           "version": "3.0.1",
2317
-          "bundled": true,
2348
+          "resolved": false,
2349
+          "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==",
2318 2350
           "dev": true,
2319 2351
           "optional": true,
2320 2352
           "requires": {
@@ -2323,7 +2355,8 @@
2323 2355
         },
2324 2356
         "inflight": {
2325 2357
           "version": "1.0.6",
2326
-          "bundled": true,
2358
+          "resolved": false,
2359
+          "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
2327 2360
           "dev": true,
2328 2361
           "optional": true,
2329 2362
           "requires": {
@@ -2333,19 +2366,22 @@
2333 2366
         },
2334 2367
         "inherits": {
2335 2368
           "version": "2.0.3",
2336
-          "bundled": true,
2369
+          "resolved": false,
2370
+          "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
2337 2371
           "dev": true,
2338 2372
           "optional": true
2339 2373
         },
2340 2374
         "ini": {
2341 2375
           "version": "1.3.5",
2342
-          "bundled": true,
2376
+          "resolved": false,
2377
+          "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
2343 2378
           "dev": true,
2344 2379
           "optional": true
2345 2380
         },
2346 2381
         "is-fullwidth-code-point": {
2347 2382
           "version": "1.0.0",
2348
-          "bundled": true,
2383
+          "resolved": false,
2384
+          "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
2349 2385
           "dev": true,
2350 2386
           "optional": true,
2351 2387
           "requires": {
@@ -2354,13 +2390,15 @@
2354 2390
         },
2355 2391
         "isarray": {
2356 2392
           "version": "1.0.0",
2357
-          "bundled": true,
2393
+          "resolved": false,
2394
+          "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
2358 2395
           "dev": true,
2359 2396
           "optional": true
2360 2397
         },
2361 2398
         "minimatch": {
2362 2399
           "version": "3.0.4",
2363
-          "bundled": true,
2400
+          "resolved": false,
2401
+          "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
2364 2402
           "dev": true,
2365 2403
           "optional": true,
2366 2404
           "requires": {
@@ -2369,13 +2407,15 @@
2369 2407
         },
2370 2408
         "minimist": {
2371 2409
           "version": "0.0.8",
2372
-          "bundled": true,
2410
+          "resolved": false,
2411
+          "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
2373 2412
           "dev": true,
2374 2413
           "optional": true
2375 2414
         },
2376 2415
         "minipass": {
2377 2416
           "version": "2.3.5",
2378
-          "bundled": true,
2417
+          "resolved": false,
2418
+          "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==",
2379 2419
           "dev": true,
2380 2420
           "optional": true,
2381 2421
           "requires": {
@@ -2385,7 +2425,8 @@
2385 2425
         },
2386 2426
         "minizlib": {
2387 2427
           "version": "1.2.1",
2388
-          "bundled": true,
2428
+          "resolved": false,
2429
+          "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==",
2389 2430
           "dev": true,
2390 2431
           "optional": true,
2391 2432
           "requires": {
@@ -2394,7 +2435,8 @@
2394 2435
         },
2395 2436
         "mkdirp": {
2396 2437
           "version": "0.5.1",
2397
-          "bundled": true,
2438
+          "resolved": false,
2439
+          "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
2398 2440
           "dev": true,
2399 2441
           "optional": true,
2400 2442
           "requires": {
@@ -2403,13 +2445,15 @@
2403 2445
         },
2404 2446
         "ms": {
2405 2447
           "version": "2.1.1",
2406
-          "bundled": true,
2448
+          "resolved": false,
2449
+          "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
2407 2450
           "dev": true,
2408 2451
           "optional": true
2409 2452
         },
2410 2453
         "needle": {
2411 2454
           "version": "2.3.0",
2412
-          "bundled": true,
2455
+          "resolved": false,
2456
+          "integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==",
2413 2457
           "dev": true,
2414 2458
           "optional": true,
2415 2459
           "requires": {
@@ -2420,7 +2464,8 @@
2420 2464
         },
2421 2465
         "node-pre-gyp": {
2422 2466
           "version": "0.12.0",
2423
-          "bundled": true,
2467
+          "resolved": false,
2468
+          "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==",
2424 2469
           "dev": true,
2425 2470
           "optional": true,
2426 2471
           "requires": {
@@ -2438,7 +2483,8 @@
2438 2483
         },
2439 2484
         "nopt": {
2440 2485
           "version": "4.0.1",
2441
-          "bundled": true,
2486
+          "resolved": false,
2487
+          "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=",
2442 2488
           "dev": true,
2443 2489
           "optional": true,
2444 2490
           "requires": {
@@ -2448,13 +2494,15 @@
2448 2494
         },
2449 2495
         "npm-bundled": {
2450 2496
           "version": "1.0.6",
2451
-          "bundled": true,
2497
+          "resolved": false,
2498
+          "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==",
2452 2499
           "dev": true,
2453 2500
           "optional": true
2454 2501
         },
2455 2502
         "npm-packlist": {
2456 2503
           "version": "1.4.1",
2457
-          "bundled": true,
2504
+          "resolved": false,
2505
+          "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==",
2458 2506
           "dev": true,
2459 2507
           "optional": true,
2460 2508
           "requires": {
@@ -2464,7 +2512,8 @@
2464 2512
         },
2465 2513
         "npmlog": {
2466 2514
           "version": "4.1.2",
2467
-          "bundled": true,
2515
+          "resolved": false,
2516
+          "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
2468 2517
           "dev": true,
2469 2518
           "optional": true,
2470 2519
           "requires": {
@@ -2476,19 +2525,22 @@
2476 2525
         },
2477 2526
         "number-is-nan": {
2478 2527
           "version": "1.0.1",
2479
-          "bundled": true,
2528
+          "resolved": false,
2529
+          "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
2480 2530
           "dev": true,
2481 2531
           "optional": true
2482 2532
         },
2483 2533
         "object-assign": {
2484 2534
           "version": "4.1.1",
2485
-          "bundled": true,
2535
+          "resolved": false,
2536
+          "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
2486 2537
           "dev": true,
2487 2538
           "optional": true
2488 2539
         },
2489 2540
         "once": {
2490 2541
           "version": "1.4.0",
2491
-          "bundled": true,
2542
+          "resolved": false,
2543
+          "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
2492 2544
           "dev": true,
2493 2545
           "optional": true,
2494 2546
           "requires": {
@@ -2497,19 +2549,22 @@
2497 2549
         },
2498 2550
         "os-homedir": {
2499 2551
           "version": "1.0.2",
2500
-          "bundled": true,
2552
+          "resolved": false,
2553
+          "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
2501 2554
           "dev": true,
2502 2555
           "optional": true
2503 2556
         },
2504 2557
         "os-tmpdir": {
2505 2558
           "version": "1.0.2",
2506
-          "bundled": true,
2559
+          "resolved": false,
2560
+          "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
2507 2561
           "dev": true,
2508 2562
           "optional": true
2509 2563
         },
2510 2564
         "osenv": {
2511 2565
           "version": "0.1.5",
2512
-          "bundled": true,
2566
+          "resolved": false,
2567
+          "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
2513 2568
           "dev": true,
2514 2569
           "optional": true,
2515 2570
           "requires": {
@@ -2519,19 +2574,22 @@
2519 2574
         },
2520 2575
         "path-is-absolute": {
2521 2576
           "version": "1.0.1",
2522
-          "bundled": true,
2577
+          "resolved": false,
2578
+          "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
2523 2579
           "dev": true,
2524 2580
           "optional": true
2525 2581
         },
2526 2582
         "process-nextick-args": {
2527 2583
           "version": "2.0.0",
2528
-          "bundled": true,
2584
+          "resolved": false,
2585
+          "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==",
2529 2586
           "dev": true,
2530 2587
           "optional": true
2531 2588
         },
2532 2589
         "rc": {
2533 2590
           "version": "1.2.8",
2534
-          "bundled": true,
2591
+          "resolved": false,
2592
+          "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
2535 2593
           "dev": true,
2536 2594
           "optional": true,
2537 2595
           "requires": {
@@ -2543,7 +2601,8 @@
2543 2601
           "dependencies": {
2544 2602
             "minimist": {
2545 2603
               "version": "1.2.0",
2546
-              "bundled": true,
2604
+              "resolved": false,
2605
+              "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
2547 2606
               "dev": true,
2548 2607
               "optional": true
2549 2608
             }
@@ -2551,7 +2610,8 @@
2551 2610
         },
2552 2611
         "readable-stream": {
2553 2612
           "version": "2.3.6",
2554
-          "bundled": true,
2613
+          "resolved": false,
2614
+          "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
2555 2615
           "dev": true,
2556 2616
           "optional": true,
2557 2617
           "requires": {
@@ -2566,7 +2626,8 @@
2566 2626
         },
2567 2627
         "rimraf": {
2568 2628
           "version": "2.6.3",
2569
-          "bundled": true,
2629
+          "resolved": false,
2630
+          "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
2570 2631
           "dev": true,
2571 2632
           "optional": true,
2572 2633
           "requires": {
@@ -2575,43 +2636,50 @@
2575 2636
         },
2576 2637
         "safe-buffer": {
2577 2638
           "version": "5.1.2",
2578
-          "bundled": true,
2639
+          "resolved": false,
2640
+          "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
2579 2641
           "dev": true,
2580 2642
           "optional": true
2581 2643
         },
2582 2644
         "safer-buffer": {
2583 2645
           "version": "2.1.2",
2584
-          "bundled": true,
2646
+          "resolved": false,
2647
+          "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
2585 2648
           "dev": true,
2586 2649
           "optional": true
2587 2650
         },
2588 2651
         "sax": {
2589 2652
           "version": "1.2.4",
2590
-          "bundled": true,
2653
+          "resolved": false,
2654
+          "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
2591 2655
           "dev": true,
2592 2656
           "optional": true
2593 2657
         },
2594 2658
         "semver": {
2595 2659
           "version": "5.7.0",
2596
-          "bundled": true,
2660
+          "resolved": false,
2661
+          "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==",
2597 2662
           "dev": true,
2598 2663
           "optional": true
2599 2664
         },
2600 2665
         "set-blocking": {
2601 2666
           "version": "2.0.0",
2602
-          "bundled": true,
2667
+          "resolved": false,
2668
+          "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
2603 2669
           "dev": true,
2604 2670
           "optional": true
2605 2671
         },
2606 2672
         "signal-exit": {
2607 2673
           "version": "3.0.2",
2608
-          "bundled": true,
2674
+          "resolved": false,
2675
+          "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
2609 2676
           "dev": true,
2610 2677
           "optional": true
2611 2678
         },
2612 2679
         "string-width": {
2613 2680
           "version": "1.0.2",
2614
-          "bundled": true,
2681
+          "resolved": false,
2682
+          "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
2615 2683
           "dev": true,
2616 2684
           "optional": true,
2617 2685
           "requires": {
@@ -2622,7 +2690,8 @@
2622 2690
         },
2623 2691
         "string_decoder": {
2624 2692
           "version": "1.1.1",
2625
-          "bundled": true,
2693
+          "resolved": false,
2694
+          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
2626 2695
           "dev": true,
2627 2696
           "optional": true,
2628 2697
           "requires": {
@@ -2631,7 +2700,8 @@
2631 2700
         },
2632 2701
         "strip-ansi": {
2633 2702
           "version": "3.0.1",
2634
-          "bundled": true,
2703
+          "resolved": false,
2704
+          "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
2635 2705
           "dev": true,
2636 2706
           "optional": true,
2637 2707
           "requires": {
@@ -2640,13 +2710,15 @@
2640 2710
         },
2641 2711
         "strip-json-comments": {
2642 2712
           "version": "2.0.1",
2643
-          "bundled": true,
2713
+          "resolved": false,
2714
+          "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
2644 2715
           "dev": true,
2645 2716
           "optional": true
2646 2717
         },
2647 2718
         "tar": {
2648 2719
           "version": "4.4.8",
2649
-          "bundled": true,
2720
+          "resolved": false,
2721
+          "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==",
2650 2722
           "dev": true,
2651 2723
           "optional": true,
2652 2724
           "requires": {
@@ -2661,13 +2733,15 @@
2661 2733
         },
2662 2734
         "util-deprecate": {
2663 2735
           "version": "1.0.2",
2664
-          "bundled": true,
2736
+          "resolved": false,
2737
+          "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
2665 2738
           "dev": true,
2666 2739
           "optional": true
2667 2740
         },
2668 2741
         "wide-align": {
2669 2742
           "version": "1.1.3",
2670
-          "bundled": true,
2743
+          "resolved": false,
2744
+          "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==",
2671 2745
           "dev": true,
2672 2746
           "optional": true,
2673 2747
           "requires": {
@@ -2676,13 +2750,15 @@
2676 2750
         },
2677 2751
         "wrappy": {
2678 2752
           "version": "1.0.2",
2679
-          "bundled": true,
2753
+          "resolved": false,
2754
+          "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
2680 2755
           "dev": true,
2681 2756
           "optional": true
2682 2757
         },
2683 2758
         "yallist": {
2684 2759
           "version": "3.0.3",
2685
-          "bundled": true,
2760
+          "resolved": false,
2761
+          "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==",
2686 2762
           "dev": true,
2687 2763
           "optional": true
2688 2764
         }
@@ -3698,9 +3774,9 @@
3698 3774
       "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
3699 3775
     },
3700 3776
     "minipass": {
3701
-      "version": "2.6.2",
3702
-      "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.6.2.tgz",
3703
-      "integrity": "sha512-38Jwdc8AttUDaQAIRX8Iaw3QoCDWjAwKMGeGDF9JUi9QCPMjH5qAQg/hdO8o1nC7Nmh1/CqzMg5FQPEKuKwznQ==",
3777
+      "version": "2.6.4",
3778
+      "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.6.4.tgz",
3779
+      "integrity": "sha512-D/+wBy2YykFsCcWvaIslCKKus5tqGQZ8MhEzNx4mujLNgHhXWaaUOZkok6/kztAlTt0QkYLEyIShrybNmzoeTA==",
3704 3780
       "requires": {
3705 3781
         "safe-buffer": "^5.1.2",
3706 3782
         "yallist": "^3.0.0"

+ 2
- 2
package.json View File

@@ -10,7 +10,7 @@
10 10
     "build-frontend": "npm run build-dashboard; cp ./dist/FrontblockLib.js ./dist/static",
11 11
     "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",
12 12
     "clean": "rm -rf lib static plugins conf dist widget .rpt2_cache *.js *.ts src/frontend/dist data",
13
-    "update-frontblock": " npm install frontblock-generic@latest frontblock@latest",
13
+    "update-frontblock": "npm remove frontblock frontblock-generic; npm install frontblock-generic@latest frontblock@latest",
14 14
     "webpack": "webpack  --config src/backend/webpack.prod.js --progress --colors"
15 15
   },
16 16
   "repository": {
@@ -26,7 +26,7 @@
26 26
     "debug": "^4.1.1",
27 27
     "express": "^4.16.4",
28 28
     "frontblock": "^0.15.1",
29
-    "frontblock-generic": "^0.34.1",
29
+    "frontblock-generic": "^0.34.8",
30 30
     "git-cherrypicker": "0.0.3",
31 31
     "git-describe": "^4.0.4",
32 32
     "http": "0.0.0",

+ 149
- 120
src/backend/Admin.ts View File

@@ -3,28 +3,25 @@ import * as Logger from 'log4js'
3 3
 import * as Knex from 'knex'
4 4
 import * as Path from 'path'
5 5
 import { FrontblockApiClient, FrontblockApiConf } from 'frontblock';
6
-import { getLogger } from 'frontblock-generic/Types';
7
-import { AdminBase, NotificationSeverity } from 'frontblock-generic/Admin';
8
-import { IFrontblockApiClient } from 'frontblock-generic/Api';
9
-import { Plugin } from 'frontblock-generic/Plugin';
10
-import { socketioRPC } from 'frontblock-generic/RPC';
11
-import { GitUpdater, RepoFolderStatus } from './GitUpdater';
6
+import { getLogger, SubscriptionResponse, Coin, AccountMap, TransactionMap } from 'frontblock-generic/Types';
7
+import { AdminBase, NotificationSeverity, TableDefiniton } from 'frontblock-generic/Admin';
8
+import { IFrontblockApiClient, FrontblockApi } from 'frontblock-generic/Api';
9
+import { Plugin, RPCExporter } from 'frontblock-generic/Plugin';
12 10
 
13 11
 const logger:Logger.Logger = getLogger("admin", 'debug') 
14 12
 
15
-
16
-export type AdminConf = { httpPort: number}
13
+export type AdminConf = { 
14
+    httpPort: number,
15
+    apiConf: FrontblockApiConf
16
+    dbConf:Knex.Config, 
17
+    eventBusConf: { [topic in string]: NotificationSeverity}
18
+}
17 19
 
18 20
 export class FrontblockAdmin extends AdminBase<AdminConf>{
19
-   
20
-    private pluginUpdaters:{[name in string]:GitUpdater} = {}
21
-    
22
-    constructor(runningPlugins: Plugin[] = []){
23
-        super(runningPlugins)
24
-        this.initialize().then(() => this.makeKnex(this.getConfigKey('dbConf'))).then(() => logger.debug("Admin initialization finished"))
25
-    }
26 21
 
27
-    getDefaultConfig(): { apiConf: FrontblockApiConf; } & AdminConf & { dbConf:Knex.Config; eventBusConf: { [topic in string]: NotificationSeverity}} {
22
+    public apiClient: IFrontblockApiClient = this.makeApiClient(this.getConfigKey("apiConf"))
23
+
24
+    getDefaultConfig(): AdminConf {
28 25
         return {
29 26
             httpPort: 8080,
30 27
             eventBusConf: {
@@ -45,130 +42,162 @@ export class FrontblockAdmin extends AdminBase<AdminConf>{
45 42
             }
46 43
         }    
47 44
     }
48
-
49
-    protected makeApiClient(conf: FrontblockApiConf): IFrontblockApiClient {
50
-        if(this.apiClient) this.apiClient.disconnect()
51
-        this.apiClient = new FrontblockApiClient(conf)
52
-        this.apiClient.connect()
53
-        return this.apiClient    
45
+   
46
+    constructor(runningPlugins: Plugin[] = []){
47
+        super(runningPlugins)
48
+        this.initialize().then(() => this.makeKnex(this.getConfigKey('dbConf'))).then(() => logger.debug("Admin initialization finished"))
54 49
     }
55 50
 
56
-    exportRPCs():socketioRPC[]{
57
-        return [
58
-            ...super.exportRPCs(),
59
-            {
60
-                name: 'installPlugin',
61
-                func: async (name:string, force = false) => {return await this.installPlugin(name, force)},
62
-                type: 'call',
63
-                visibility: 'private'
64
-            },{
65
-                name: 'startPlugin',
66
-                func: async (name:string) => {return await this.startPlugin(name)},
67
-                type: 'call',
68
-                visibility: 'private'
69
-            },{
70
-                name: 'updatePlugin',
71
-                func: async (name) => {return await this.updatePlugin(name)},
72
-                type: 'call',
73
-                visibility: 'private'
74
-            },{
75
-                name: 'setPluginVersion',
76
-                func: async (name, tag) => {return await this.setPluginVersion(name, tag)},
77
-                type: 'call',
78
-                visibility: 'private'
79
-            },{
80
-                name: 'getLoadedPluginNames',
81
-                func: async () => {return await this.getPlugins().map(p => p.name)},
82
-                type: 'call',
83
-                visibility: 'private'
84
-            },{
85
-                name: 'selfUpdate',
86
-                type:'call',
87
-                func: async (force: boolean) => {return await this.selfUpdate(force)},
88
-                visibility: 'private'
89
-            },
90
-        ]
51
+    initApis(socket){
52
+        const quit = async(uid:string) => {return await this.quit(this.getConfigKey('apiConf').apiKey, uid) }
53
+        const exporter:RPCExporter = {
54
+            name: 'ApiClient',
55
+            exportRPCs: () => { 
56
+                return [{
57
+                    name: "subscribe",
58
+                    func: async <C extends Coin>(coin: C, account: AccountMap[C]) => { return await this.subscribe(this.getConfigKey('apiConf').apiKey, coin, account)},
59
+                    type: 'call',
60
+                    visibility: 'private'
61
+                },{
62
+                    name: "subsume",
63
+                    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)},
64
+                    type: 'hook',
65
+                    unhook: quit,
66
+                    visibility: 'private'
67
+                },{
68
+                    name: 'unsubscribe',
69
+                    func: async(uid:string) => { return await this.unsubscribe(this.getConfigKey('apiConf').apiKey, uid) },
70
+                    type: 'call',
71
+                    visibility: 'private'
72
+                },{
73
+                    name: 'consume',
74
+                    func: async<C extends Coin>(uid: string, callback: (tx: TransactionMap[C]) => void) => {return await this.consume(this.getConfigKey('apiConf').apiKey, uid, callback)},
75
+                    type: 'hook',
76
+                    unhook: quit,
77
+                    visibility: 'private'
78
+                },{
79
+                    name: 'quit',
80
+                    func: quit,
81
+                    type: 'call',
82
+                    visibility: 'private'
83
+                },{
84
+                    name: "getSubscriptions",
85
+                    func: async() => { return await this.getSubscriptions() },
86
+                    type: "call",
87
+                    visibility: "private"
88
+                },{
89
+                    name: "getConsumers",
90
+                    func: async() => { return await this.getConsumers() },
91
+                    type: "call",
92
+                    visibility: "private"
93
+                }]
94
+            }
95
+        }
96
+        super.initApis(socket, [exporter])
91 97
     }
92 98
 
93
-    private async selfUpdate(force:boolean = false){
94
-        const updater = new GitUpdater("./dist")
95
-        let status = await updater.getStatus()
96
-        if(force || !status.remote || !status.remote.includes("fb-dist/admin") || !status.exists || status.empty || !status.currentTag){
97
-            logger.warn("Cloning fb-dist/admin into ./dist ..."+(force?" USING FORCE!":""))
98
-            status = await updater.cloneRepo("https://gitea.frontblock.me/fb-dist/admin.git", force)
99
+    async getConsumers(): Promise<SubscriptionResponse[]> {
100
+        const records = await this.knex.select('*').from('consumers')
101
+        return records.map(r => JSON.parse(r.JSON))
102
+    }
99 103
 
100
-            this.destroy()
101
-            const installer = require("./Installer").installAdmin
102
-            installer(this.getPlugins())
104
+    async getSubscriptions(): Promise<SubscriptionResponse[]> {
105
+        const records = await this.knex.select('*').from('subscriptions')
106
+        return records.map(r => JSON.parse(r.JSON))
107
+    }
108
+    
109
+    private subscribe:FrontblockApi['subscribe'] = async (apiKey, coin, account) => {
110
+        const res = await this.apiClient.subscribe(apiKey, coin, account)
111
+        if(res instanceof SubscriptionResponse){
112
+            await this.insert('subscriptions', [{uuid: res.uid, coin:coin, JSON: JSON.stringify(res)}], "apiclient", "Info")
103 113
         }
104
-        return status
114
+        return res
105 115
     }
106 116
 
107
-    async installPlugin(name: string, force:boolean = false):Promise<RepoFolderStatus>{
108
-        logger.warn("Cloning fb-dist/"+name+".git into ./plugins/"+name+" ..."+(force?" USING FORCE!":""))
109
-        this.pluginUpdaters[name] = new GitUpdater("./plugins/"+name)
110
-        const status = await this.pluginUpdaters[name].cloneRepo("https://gitea.frontblock.me/fb-dist/"+name.toLowerCase()+".git", force)
111
-        return status
117
+    private consume:FrontblockApi['consume'] = async (apikey, uuid, callback) => {
118
+        const res = await this.apiClient.consume(apikey, uuid, callback)
119
+        if(res instanceof SubscriptionResponse){
120
+            await this.insert('consumers', [{uuid: res.uid, coin:undefined, JSON: JSON.stringify(res)}], "apiclient", "Info")
121
+        }
122
+        return res
112 123
     }
113 124
 
114
-    async startPlugin(name:string):Promise<boolean>{
115
-        if(!this.pluginUpdaters[name]) return false
116
-        const status = await this.pluginUpdaters[name].getStatus()
117
-        if(!status.exists || status.empty || !status.tags || status.tags.length === 0){
118
-            if(status.currentTag && !status.latestTag){
119
-                //git glitches sometimes if you check immediately after clone
120
-                logger.warn("re-fetching tag for "+name+"...")
121
-                return await this.startPlugin(name)
122
-            }
123
-            logger.error("Bad repo status", name, status)
124
-            return false
125
-        }
125
+    private unsubscribe:FrontblockApi['unsubscribe'] = async (apikey, uuid) => {
126
+        const res = await this.apiClient.unsubscribe(apikey, uuid)
127
+        await this.knex('subscriptions')
128
+        .where('uuid', uuid)
129
+        .del()
130
+        return res
131
+    }
126 132
 
127
-/*        if(this.loadedPlugins[name]){
128
-            logger.error("Plugin", name, "is already started")
129
-            return false
130
-        }
131
-*/
132
-
133
-        let str = "../plugins/"+name+"/Plugin"
134
-        const pluginClass = await eval('require')(str)
135
-        const pluginObj = new pluginClass.default()
136
-        await pluginObj.start()
137
-        this.addPlugin(pluginObj)
138
-        return true
133
+    private quit:FrontblockApi['quit'] = async (apikey, uuid) => {
134
+        const res = await this.apiClient.quit(apikey, uuid)
135
+        await this.knex('consumers')
136
+        .where('uuid', uuid)
137
+        .del()
138
+        return res    
139 139
     }
140 140
 
141
-    async updatePlugin(name:string):Promise<boolean>{
142
-        if(!this.pluginUpdaters[name]) return false
143
-        const status = await this.pluginUpdaters[name].getStatus()
144
-        if(!status.exists || status.empty || !status.tags || status.tags.length === 0){
145
-            logger.error("Bad repo status", name, status)
146
-            return false
147
-        }
148
-        if(status.currentTag == status.latestTag){
149
-            logger.warn(name, "already at latest tag")
150
-            return false
141
+    private subsume:FrontblockApi['subsume'] = async (apikey, coin, account, callback) => {
142
+        const res = await this.apiClient.subsume(apikey, coin, account, callback)
143
+        if(res instanceof SubscriptionResponse){
144
+            await Promise.all([
145
+                this.insert('consumers', [{
146
+                    uuid: res.uid, 
147
+                    coin:coin, 
148
+                    JSON: JSON.stringify(res)
149
+                }], "apiclient", "Info"),
150
+
151
+                this.insert('subscriptions', [{
152
+                    uuid: res.uid, 
153
+                    coin:coin, 
154
+                    JSON: JSON.stringify(new SubscriptionResponse(res.message!))
155
+                }], "apiclient", "Info")
156
+            ])
151 157
         }
158
+        return res
159
+    }
152 160
 
153
-        /*
154
-        if(this.loadedPlugins[name]){
155
-            logger.error("Plugin", name, "is running. Stop it first")
156
-            return false
161
+    setConfig(conf:AdminConf & { dbConf: Knex.Config; eventBusConf: {[x in string]:NotificationSeverity} }):AdminConf & { dbConf: Knex.Config; eventBusConf: {[x in string]:NotificationSeverity} }{
162
+        const currConf = this.getConfig()
163
+        if(JSON.stringify(currConf.apiConf) !== JSON.stringify(conf.apiConf)){
164
+            this.makeApiClient(conf.apiConf)
157 165
         }
158
-        */
159
-
160
-        this.pluginUpdaters[name].checkoutTag(status.latestTag!)
161
-        return true
166
+        return super.setConfig(conf)
162 167
     }
163 168
 
164
-    async setPluginVersion(pluginName:string, tag:string):Promise<RepoFolderStatus>{
165
-        const status = await this.pluginUpdaters[pluginName].getStatus()
166
-        if(!status.exists || !status.tags || status.tags.length === 0 || !status.tags.includes(tag)){
167
-            logger.error("Bad repo status", pluginName, status)
168
-            return status
169
+    setConfigKey(key: string, value: any):AdminConf & { dbConf: Knex.Config; eventBusConf: {[x in string]:NotificationSeverity} }{
170
+        if(key === 'apiConf'){
171
+            this.makeApiClient(value)
169 172
         }
173
+        return super.setConfigKey(key, value)
174
+    }
170 175
 
171
-        return await this.pluginUpdaters[pluginName].checkoutTag(tag)
176
+    getTableDefinitions(): TableDefiniton[] {
177
+        return [
178
+        ...super.getTableDefinitions(),
179
+        {
180
+            name: 'subscriptions', 
181
+            tableBuilder: function (table) {
182
+                table.string('uuid').primary();
183
+                table.string('coin');
184
+                table.string('JSON');
185
+            }
186
+        },{
187
+            name: 'consumers', 
188
+            tableBuilder: function (table) {
189
+                table.string('uuid').primary();
190
+                table.string('coin');
191
+                table.string('JSON');
192
+            }
193
+        }]
194
+    }
195
+   
196
+    protected makeApiClient(conf: FrontblockApiConf): IFrontblockApiClient {
197
+        if(this.apiClient) this.apiClient.disconnect()
198
+        this.apiClient = new FrontblockApiClient(conf)
199
+        this.apiClient.connect()
200
+        return this.apiClient    
172 201
     }
173 202
 }
174 203
 

+ 1
- 3
src/backend/webpack.prod.js View File

@@ -68,9 +68,7 @@ module.exports = [{
68 68
     ]
69 69
   },
70 70
 
71
-  externals:{
72
-    "./Installer": "./Installer"
73
-  },
71
+  externals:["./Installer"],
74 72
   optimization: {
75 73
     minimize: false
76 74
   },

+ 7
- 5
src/frontend/angular.json View File

@@ -15,8 +15,10 @@
15 15
       "prefix": "app",
16 16
       "architect": {
17 17
         "build": {
18
-          "builder": "@angular-devkit/build-angular:browser",
18
+          "builder": "@angular-builders/custom-webpack:browser",
19 19
           "options": {
20
+            "customWebpackConfig": {"path": "./custom-webpack.config.js"},
21
+
20 22
             "outputPath": "dist",
21 23
             "index": "src/index.html",
22 24
             "main": "src/main.ts",
@@ -78,7 +80,7 @@
78 80
           }
79 81
         },
80 82
         "serve": {
81
-          "builder": "@angular-devkit/build-angular:dev-server",
83
+          "builder": "@angular-builders/custom-webpack:dev-server",
82 84
           "tsConfig": "tsconfig.app.json",
83 85
           "options": {
84 86
             "browserTarget": "dashboard:build"
@@ -99,7 +101,7 @@
99 101
           }
100 102
         },
101 103
         "test": {
102
-          "builder": "@angular-devkit/build-angular:karma",
104
+          "builder": "@angular-builders/custom-webpack:karma",
103 105
           "options": {
104 106
             "main": "src/test.ts",
105 107
             "polyfills": "src/polyfills.ts",
@@ -116,7 +118,7 @@
116 118
           }
117 119
         },
118 120
         "lint": {
119
-          "builder": "@angular-devkit/build-angular:tslint",
121
+          "builder": "@angular-builders/custom-webpack:tslint",
120 122
           "options": {
121 123
             "tsConfig": [
122 124
               "tsconfig.app.json",
@@ -130,7 +132,7 @@
130 132
           }
131 133
         },
132 134
         "e2e": {
133
-          "builder": "@angular-devkit/build-angular:protractor",
135
+          "builder": "@angular-builders/custom-webpack:protractor",
134 136
           "options": {
135 137
             "protractorConfig": "e2e/protractor.conf.js",
136 138
             "devServerTarget": "dashboard:serve"

+ 13
- 39
src/frontend/package-lock.json View File

@@ -4795,9 +4795,9 @@
4795 4795
       }
4796 4796
     },
4797 4797
     "frontblock": {
4798
-      "version": "0.14.9",
4799
-      "resolved": "https://registry.npmjs.org/frontblock/-/frontblock-0.14.9.tgz",
4800
-      "integrity": "sha512-iEjOdJ92pxg18Y9mVfjfRYzuAfxXElREoDfz8FFPaNvbO3mPv+8Y2m3jtTo8FoOpFGgA+jwOw40nT1iWKRS72A==",
4798
+      "version": "0.15.1",
4799
+      "resolved": "https://registry.npmjs.org/frontblock/-/frontblock-0.15.1.tgz",
4800
+      "integrity": "sha512-nRSoAT5HZhJmYkCdX8YGya+YTnvzw0W7eG0ISr+HBUO5u4hjmnHwwA1U7VewbTNokan9JvA7TF6/QijLeSCCVA==",
4801 4801
       "requires": {
4802 4802
         "@angular/common": "^8.2.1",
4803 4803
         "@angular/core": "^8.2.1",
@@ -4806,7 +4806,7 @@
4806 4806
         "@angular/router": "^8.2.1",
4807 4807
         "@clr/angular": "^2.1.1",
4808 4808
         "@types/node": "^11.13.10",
4809
-        "frontblock-generic": "^0.33.7",
4809
+        "frontblock-generic": "^0.34.0",
4810 4810
         "fs": "0.0.1-security",
4811 4811
         "knex": "^0.19.2",
4812 4812
         "log4js": "^4.3.1",
@@ -4820,52 +4820,26 @@
4820 4820
           "version": "11.13.20",
4821 4821
           "resolved": "https://registry.npmjs.org/@types/node/-/node-11.13.20.tgz",
4822 4822
           "integrity": "sha512-JE0UpLWZTV1sGcaj0hN+Q0760OEjpgyFJ06DOMVW6qKBducKdJQaIw0TGL6ccj7VXRduIOHLWQi+tHwulZJHVQ=="
4823
-        },
4824
-        "frontblock-generic": {
4825
-          "version": "0.33.12",
4826
-          "resolved": "https://registry.npmjs.org/frontblock-generic/-/frontblock-generic-0.33.12.tgz",
4827
-          "integrity": "sha512-6tQIIdqzsJxqPefxWXBfGs02ux3zKCAqyruFThlUiMxBnPPaqS13R6m74yH/lgpIDom1aPf+vwASiRUI3+5dXw==",
4828
-          "requires": {
4829
-            "@types/lowdb": "^1.0.9",
4830
-            "@types/node": "^12.7.1",
4831
-            "bsock": "^0.1.9",
4832
-            "express": "^4.17.1",
4833
-            "fs": "0.0.1-security",
4834
-            "http": "0.0.0",
4835
-            "key-file-storage": "^2.2.4",
4836
-            "knex": "^0.19.2",
4837
-            "log4js": "^4.2.0",
4838
-            "lowdb": "^1.0.0",
4839
-            "minimist": "^1.2.0",
4840
-            "path": "^0.12.7",
4841
-            "uuid": "^3.3.2"
4842
-          },
4843
-          "dependencies": {
4844
-            "@types/node": {
4845
-              "version": "12.7.5",
4846
-              "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.5.tgz",
4847
-              "integrity": "sha512-9fq4jZVhPNW8r+UYKnxF1e2HkDWOWKM5bC2/7c9wPV835I0aOrVbS/Hw/pWPk2uKrNXQqg9Z959Kz+IYDd5p3w=="
4848
-            }
4849
-          }
4850
-        },
4851
-        "minimist": {
4852
-          "version": "1.2.0",
4853
-          "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
4854
-          "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
4855 4823
         }
4856 4824
       }
4857 4825
     },
4858 4826
     "frontblock-generic": {
4859
-      "version": "0.23.0",
4860
-      "resolved": "https://registry.npmjs.org/frontblock-generic/-/frontblock-generic-0.23.0.tgz",
4861
-      "integrity": "sha512-5KukScUCAsomGP9xMp6gQjA5xKBMfctTSQhIoaoxEkXpXoX9F2pjlYIkfP11NYNSsk2gVf3xg7VIhhSzhizy/A==",
4827
+      "version": "0.34.1",
4828
+      "resolved": "https://registry.npmjs.org/frontblock-generic/-/frontblock-generic-0.34.1.tgz",
4829
+      "integrity": "sha512-BiVUzpJSFV3FbnpdP3mxQTi1ivzlA9BXNrVp6rjuvNuxJYK1JIcd7Lhfaw1xR5v9XRPCBVVgksH37zfMUAPMjg==",
4862 4830
       "requires": {
4831
+        "@types/lowdb": "^1.0.9",
4863 4832
         "@types/node": "^12.7.1",
4864 4833
         "bsock": "^0.1.9",
4834
+        "express": "^4.17.1",
4835
+        "fs": "0.0.1-security",
4865 4836
         "http": "0.0.0",
4866 4837
         "key-file-storage": "^2.2.4",
4838
+        "knex": "^0.19.2",
4867 4839
         "log4js": "^4.2.0",
4840
+        "lowdb": "^1.0.0",
4868 4841
         "minimist": "^1.2.0",
4842
+        "path": "^0.12.7",
4869 4843
         "uuid": "^3.3.2"
4870 4844
       },
4871 4845
       "dependencies": {

+ 4
- 4
src/frontend/package.json View File

@@ -7,13 +7,13 @@
7 7
     "start-prodlike": "npm run build-assets && ng serve --aot=false --optimization=false --proxy-config proxy.conf.json --configuration=prodlike",
8 8
     "build": "rm -f src/assets/*.js; ng build --prod --aot=false --optimization=false --build-optimizer=false",
9 9
     "build-assets": "npm run copy-frontends; npm run deep-clean-plugins",
10
-    "update-frontblock": "rm -rf node_modules/frontblock*; npm install",
11 10
     "get-submodules": "git submodule update --init && git submodule foreach git checkout master",
12 11
     "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",
13 12
     "deep-clean-plugins": "for module in $(git config --file .gitmodules --get-regexp path | awk '{ print $2 }'); do rm -rf $module/node_modules; done",
14 13
     "test": "ng test",
15 14
     "lint": "ng lint",
16
-    "e2e": "ng e2e"
15
+    "e2e": "ng e2e",
16
+    "update-frontblock": "npm remove frontblock frontblock-generic; npm install frontblock-generic@latest frontblock@latest"
17 17
   },
18 18
   "private": true,
19 19
   "dependencies": {
@@ -32,8 +32,8 @@
32 32
     "@webcomponents/custom-elements": "^1.0.0",
33 33
     "btc-hdkey": "0.0.17",
34 34
     "coinselect": "^3.1.11",
35
-    "frontblock": "latest",
36
-    "frontblock-generic": "^0.23.0",
35
+    "frontblock": "^0.15.1",
36
+    "frontblock-generic": "^0.34.1",
37 37
     "key-file-storage": "^2.2.4",
38 38
     "node-fetch": "^2.6.0",
39 39
     "rxjs": "~6.5.2",

+ 9
- 4
src/frontend/src/app/apiclient/module.ts View File

@@ -10,6 +10,7 @@ import { ClarityModule } from '@clr/angular';
10 10
 import { FormsModule } from '@angular/forms';
11 11
 
12 12
 import {FrontendPlugin, SidebarEntries, SidebarEntry} from 'frontblock-generic/Plugin'
13
+import { ApiclientWidgetComponent } from './apiclient-widget.component';
13 14
 
14 15
 @NgModule({
15 16
   imports: [
@@ -27,14 +28,14 @@ import {FrontendPlugin, SidebarEntries, SidebarEntry} from 'frontblock-generic/P
27 28
     ApiclientConsumptionComponent,
28 29
     ApiclientSubscriptionComponent,
29 30
     ApiclientFormComponent,
30
-
31
+    ApiclientWidgetComponent
31 32
   ],
32 33
   entryComponents: [
33 34
     ApiclientFormComponent,
34
-
35
+    ApiclientWidgetComponent
35 36
   ]
36 37
 })
37
-export class ApiclientModule implements FrontendPlugin{
38
+export class ApiclientModule implements FrontendPlugin<typeof ApiclientFormComponent, typeof ApiclientWidgetComponent>{
38 39
   getSidebarEntry(): SidebarEntry | SidebarEntries {
39 40
     return {
40 41
       icon: "terminal",
@@ -50,7 +51,11 @@ export class ApiclientModule implements FrontendPlugin{
50 51
     }
51 52
   }
52 53
 
53
-  getSettingsComponentClassName(): any{
54
+  getSettingsComponent(): typeof ApiclientFormComponent{
54 55
     return ApiclientFormComponent
55 56
   }
57
+
58
+  getWidget(): typeof ApiclientWidgetComponent{
59
+    return ApiclientWidgetComponent
60
+  }
56 61
 }

+ 3
- 0
src/frontend/src/app/app-routing.module.ts View File

@@ -5,6 +5,9 @@ import { ErrorDisplayComponent } from './error-display/error-display.component';
5 5
 import { SettingsComponent } from './settings/settings.component';
6 6
 
7 7
 const routes: Routes = [{
8
+    path: "apiclient",
9
+    loadChildren: () => import('./apiclient/module').then(mod => mod.ApiclientModule)
10
+  },{
8 11
     path: "pluginmanager",
9 12
     loadChildren: () => import('./pluginmanager/module').then(mod => mod.PluginmanagerModule)
10 13
   },{

+ 7
- 4
src/frontend/src/app/dynamic-loader/dynamic-loader.component.ts View File

@@ -86,6 +86,7 @@ export class DynamicLoaderComponent implements AfterViewInit {
86 86
   private async installWidget(pluginName: string) {
87 87
     let module;
88 88
     if (!angularCore.isDevMode()){
89
+      console.log("Loading "+pluginName+" from backend")
89 90
       module = await SystemJS.import("plugins/" + pluginName + ".js");
90 91
     }else{
91 92
       if(environment.loadLocal){
@@ -97,16 +98,18 @@ export class DynamicLoaderComponent implements AfterViewInit {
97 98
       }
98 99
     }
99 100
 
100
-    const plugin:FrontendPlugin = new module['PluginModule']()
101
-    this.injectPlugin(plugin)
102
-    this.compileModule(plugin)
101
+    this.injectPlugin(module)
102
+    this.compileModule(module)
103 103
   }
104 104
 
105 105
   compileModule(module:any){
106 106
     
107 107
   }
108 108
 
109
-  injectPlugin(plugin:FrontendPlugin):void{
109
+  injectPlugin(module:any):void{
110
+    const plugin:FrontendPlugin = new module['PluginModule']()
111
+    if(!plugin.getSidebarEntry) return
112
+    
110 113
     const entry: SidebarEntries | SidebarEntry = plugin.getSidebarEntry()
111 114
     const rc = this.router.config
112 115
 

+ 11
- 11
src/frontend/src/app/header-bar/header-bar.component.html View File

@@ -1,17 +1,17 @@
1
-<clr-header class="header header-1">
1
+<clr-header class="header header-7">
2 2
     <div class="branding">
3
-        <span class="title">Frontblock</span>
3
+        <a class="nav-link" [routerLink]="'home'">
4
+                <img src="assets/logo_real.png" class="clr-icon" />
5
+                <span class="title">&nbsp;&nbsp;Frontblock</span>
6
+        </a> 
4 7
         
5 8
     </div>
6
-    <div class="header-actions">
7
-        <a class="nav-link nav-icon-text">
8
-            <clr-icon shape="bug"></clr-icon> 
9
-            <span class="nav-text">ALPHA {{devmode}}</span>
10
-        </a>
11
-    </div>
12
-    <div class="header-actions">
13
-        <a [routerLink]="'settings'" class="nav-link nav-icon" aria-label="settings">
14
-            <clr-icon shape="cog"></clr-icon>
9
+    <div class="header-actions" style="z-index:2">
10
+        <a class="nav-link nav-icon" aria-label="bell" routerLinkActive="active" [routerLink]="'notifications'">
11
+            <clr-icon class="has-badge" shape="bell">  </clr-icon>
12
+        </a> 
13
+        <a class="nav-link nav-icon" routerLinkActive="active" [routerLink]="'settings'">
14
+            <clr-icon class="" shape="cog" ></clr-icon> 
15 15
         </a>
16 16
     </div>
17 17
 </clr-header>

+ 1
- 1
src/frontend/src/app/home/home.component.html View File

@@ -1 +1 @@
1
-<p>home works!</p>
1
+<ng-container #dynamicWidgets></ng-container>

+ 24
- 4
src/frontend/src/app/home/home.component.ts View File

@@ -1,15 +1,35 @@
1
-import { Component, OnInit } from '@angular/core';
1
+import { Component, OnInit, ViewChild, ViewContainerRef, Injector, ComponentFactoryResolver, AfterViewInit } from '@angular/core';
2
+import { FrontendPlugin } from 'frontblock-generic/Plugin';
3
+import { ApiclientModule } from '../apiclient/module';
2 4
 
3 5
 @Component({
4 6
   selector: 'app-home',
5 7
   templateUrl: './home.component.html',
6 8
   styleUrls: ['./home.component.scss']
7 9
 })
8
-export class HomeComponent implements OnInit {
10
+export class HomeComponent implements AfterViewInit {
9 11
 
10
-  constructor() { }
12
+  @ViewChild('dynamicWidgets', {read: ViewContainerRef, static: false})
13
+  settingsContainer: ViewContainerRef
11 14
 
12
-  ngOnInit() {
15
+  constructor(
16
+    private componentFactoryResolver: ComponentFactoryResolver,
17
+    private injector: Injector
18
+  ) { }
19
+
20
+  ngAfterViewInit() {
21
+    this.injectModule(new ApiclientModule())
22
+
23
+  }
24
+
25
+  injectModule(module:FrontendPlugin<any>) {
26
+    if(!module.getSettingsComponent) return
27
+
28
+    //@ts-ignore
29
+    const factory = this.componentFactoryResolver.resolveComponentFactory(module.getWidget())
30
+    const component = factory.create(this.injector)
31
+    setTimeout(() => this.settingsContainer.insert(component.hostView), 1)
13 32
   }
14 33
 
34
+
15 35
 }

+ 10
- 0
src/frontend/src/app/knex-config/knex-config.component.ts View File

@@ -136,6 +136,16 @@ export class KnexConfigComponent implements OnInit{
136 136
   }
137 137
 
138 138
   async ngOnInit(){
139
+    await new Promise((resolve, reject)=>{
140
+        let awaitAdmin: { (): void; (...args: any[]): void; }
141
+        (awaitAdmin = () => {
142
+          if(fb.Admin != null){
143
+            resolve()
144
+          }
145
+          setTimeout(awaitAdmin,25)
146
+        })()
147
+    })
148
+
139 149
     const c = await fb.Admin.getConfig()
140 150
     this.conf = c.dbConf
141 151
 

+ 6
- 4
src/frontend/src/app/settings/settings.component.ts View File

@@ -1,5 +1,6 @@
1 1
 import { Component, ViewChild, ViewContainerRef, ComponentFactoryResolver, Injector, AfterViewInit } from '@angular/core';
2 2
 import { ApiclientModule } from '../apiclient/module'
3
+import { FrontendPlugin } from 'frontblock-generic/Plugin';
3 4
 
4 5
 @Component({
5 6
   selector: 'app-settings',
@@ -9,7 +10,7 @@ import { ApiclientModule } from '../apiclient/module'
9 10
 export class SettingsComponent implements AfterViewInit {
10 11
   ngAfterViewInit(): void {
11 12
     this.injectModule(new ApiclientModule())
12
-    this.injectModule(new ApiclientModule())
13
+//    this.injectModule(new ApiclientModule())
13 14
   }
14 15
 
15 16
   @ViewChild('dynamicSettings', {read: ViewContainerRef, static: false})
@@ -21,10 +22,11 @@ export class SettingsComponent implements AfterViewInit {
21 22
   ) {
22 23
   }
23 24
 
24
-  injectModule(module:any) {
25
-    const factory = this.componentFactoryResolver.resolveComponentFactory(module.getSettingsComponentClassName())
25
+  injectModule(module:FrontendPlugin<any>) {
26
+    if(!module.getSettingsComponent) return
27
+
28
+    const factory = this.componentFactoryResolver.resolveComponentFactory(module.getSettingsComponent())
26 29
     const component = factory.create(this.injector)
27 30
     setTimeout(() => this.settingsContainer.insert(component.hostView), 1)
28 31
   }
29
-
30 32
 }

+ 4
- 1
src/frontend/src/app/sidebar/sidebar.component.ts View File

@@ -1,5 +1,6 @@
1 1
 import { Component, OnInit } from '@angular/core';
2 2
 import { SidebarEntries, SidebarEntry } from 'frontblock-generic/Plugin';
3
+import { ApiclientModule } from '../apiclient/module';
3 4
 
4 5
 @Component({
5 6
   selector: 'sidebar',
@@ -12,7 +13,9 @@ export class SidebarComponent implements OnInit {
12 13
 
13 14
   entries:SidebarEntry[] = []
14 15
 
15
-  multientires:SidebarEntries[] = [{
16
+  multientires:SidebarEntries[] = [
17
+    <SidebarEntries> new ApiclientModule().getSidebarEntry(),
18
+    {
16 19
     icon: "bundle",
17 20
     text: "Update Manager",
18 21
     parentRoute: "pluginmanager",

+ 12
- 6
src/frontend/src/app/subnav/subnav.component.html View File

@@ -1,11 +1,17 @@
1
+<!--
1 2
 <nav class="subnav">
2 3
     <ul class="nav">
3 4
         <li class="nav-item">
4
-            <a class="nav-link" routerLinkActive="active" [routerLink]="'home'">Dashboard</a>
5
-            &nbsp;
6
-            <a class="nav-link" routerLinkActive="active" [routerLink]="'notifications'">Notifications</a>
7
-            &nbsp;
8
-            <a class="nav-link" routerLinkActive="active" [routerLink]="'settings'">Settings</a>
5
+            <a class="header-nav" routerLinkActive="active" [routerLink]="'home'">
6
+                <clr-icon class="is-solid" shape="home" size="24"></clr-icon> 
7
+            </a>
8
+            <a class="header-nav" routerLinkActive="active" [routerLink]="'settings'"> 
9
+                <clr-icon class="is-solid" shape="cog" size="24"></clr-icon> 
10
+            </a>
11
+            <a class="header-nav" routerLinkActive="active" [routerLink]="'notifications'">
12
+                <clr-icon class="is-solid has-badge" shape="bell" size="24"></clr-icon>
13
+            </a> 
9 14
         </li>
10 15
     </ul>
11
-</nav>
16
+</nav>
17
+-->

Loading…
Cancel
Save