├── .gitattributes ├── .github └── FUNDING.yml ├── .gitignore ├── README.md ├── assets ├── assassin.png ├── carbon(2).png └── diagram.png ├── demo ├── Format_1452.woff ├── assassin.js ├── index.html └── online.js ├── dist ├── assassin.js └── assassin.min.js └── server ├── Dockerfile ├── README.md ├── index.html ├── package-lock.json ├── package.json └── server.js /.gitattributes: -------------------------------------------------------------------------------- 1 | *.html linguist-language=JavaScript 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | ko_fi: assassindb 4 | 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ASSASSIN 2 | 3 | 4 | 5 | ![GitHub license](https://img.shields.io/github/license/Naereen/StrapDown.js.svg) 6 | ![GitHub license1](https://img.shields.io/github/languages/top/genderev/assassin) 7 | ![GitHub license](https://img.shields.io/github/issues-pr-closed-raw/genderev/assassin) 8 | ![GitHub license2](https://img.shields.io/github/languages/code-size/genderev/assassin) 9 | ![GitHub license31](https://img.shields.io/github/issues/genderev/assassin) 10 | ![GitHub license3](https://img.shields.io/github/issues-pr/genderev/assassin) 11 | ![GitHub license4](https://img.shields.io/github/contributors/genderev/assassin) 12 | ![GitHudk](https://img.shields.io/gitter/room/genderev/assassin) 13 | 14 | 34 | 35 | 36 | 37 | 38 | 39 |
40 |

Why do we need a new database?

41 | 42 |

What are web workers?

43 | 48 |

Can you explain web workers with a picture?

49 |

You can see in the diagram that without web workers (that's the "before" part of the picture), the main thread has to finish processing all JavaScript before responding to user input. With the use of web workers (that's the "after" part of the picture), the main thread can send JavaScript to web workers and then focus on updating the UI.

50 | web worker diagram 51 | 52 |

53 | Features 💥 54 |

55 | 56 |

💫  Lightweight: Shipped with less than 100 lines of client side code.

57 | 58 |

⚖️  Decentralized: Your database has no single point of failure. If the server goes down, your data is easy to retrieve.

59 | 60 |

✨  Works in private browsing: I researched databases like LevelDB, PouchDB, and Gun, which rely on IndexedDB for client-side storage. I wanted these databases to be effective, but I ended up creating this database partly because IndexedDB is disabled in private browsing, which means none of these databases work for me.

61 | 62 |

Methods:

63 | 64 | 75 | 76 |

Get Started: Server

77 | First, you need to make a fly.io account. If you haven't already installed Docker, install it and have the daemon running while you deploy your server. To deploy your server, type this in your terminal and hit "Enter" after the end of each line. 78 | shell 79 | 80 | 81 | You can copy and paste: 82 |
 83 | cd /path/to/where_you_want_this_to_be_stored
 84 | git clone https://github.com/genderev/assassin_server.git
 85 | cd assassin_server
 86 | flyctl init
 87 | flyctl deploy
 88 | 
89 | 90 | You can also deploy your server to buddy.works or begin.com on your own, if you want. 91 |

Get Started: Browser

92 | 93 | You can save this file or you can clone this repo and use assassin.js in the dist folder. assassin.js goes inside the web worker that the main thread posts messages to. You can see an example of how to do this in the source code for the demo. 94 | 95 |

Architecture:

96 | 97 | 108 | 109 |

Why is it called Assassin?

113 | 114 | 115 | 116 |

117 | Demo 🚀 118 |

119 | 120 |

https://assassin-demo.surge.sh

121 | 122 |

123 | Built with 🔧 124 |

125 | 126 | 135 | 136 |

Make sure to share your opinion in:

137 | 138 | 144 | 145 |

And if you really want to help make Assassin better, make a pull request! I really want to Assassin to have these things, so make a pull request showing how to add them:

146 | 149 | 150 | 151 |

Assassin is open source, and always will be.

152 | 153 |

154 | Support me on: 155 |

156 | 157 | 163 | 164 |

Star the repo, Tweet, and share among your friends, teams and contacts!

165 |
166 | -------------------------------------------------------------------------------- /assets/assassin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/genderev/assassin/5378c38ff0ac544e4f8688bf14520cca6f4518be/assets/assassin.png -------------------------------------------------------------------------------- /assets/carbon(2).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/genderev/assassin/5378c38ff0ac544e4f8688bf14520cca6f4518be/assets/carbon(2).png -------------------------------------------------------------------------------- /assets/diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/genderev/assassin/5378c38ff0ac544e4f8688bf14520cca6f4518be/assets/diagram.png -------------------------------------------------------------------------------- /demo/Format_1452.woff : -------------------------------------------------------------------------------- https://raw.githubusercontent.com/genderev/assassin/5378c38ff0ac544e4f8688bf14520cca6f4518be/demo/Format_1452.woff -------------------------------------------------------------------------------- /demo/assassin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * avl v1.4.4 3 | * Fast AVL tree for Node and browser 4 | * 5 | * @author Alexander Milevski 6 | * @license MIT 7 | * @preserve 8 | */ 9 | 10 | (function (global, factory) { 11 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 12 | typeof define === 'function' && define.amd ? define(factory) : 13 | (global.AVLTree = factory()); 14 | }(this, (function () { 'use strict'; 15 | 16 | /** 17 | * Prints tree horizontally 18 | * @param {Node} root 19 | * @param {Function(node:Node):String} [printNode] 20 | * @return {String} 21 | */ 22 | function print (root, printNode) { 23 | if ( printNode === void 0 ) printNode = function (n) { return n.key; }; 24 | 25 | var out = []; 26 | row(root, '', true, function (v) { return out.push(v); }, printNode); 27 | return out.join(''); 28 | } 29 | 30 | /** 31 | * Prints level of the tree 32 | * @param {Node} root 33 | * @param {String} prefix 34 | * @param {Boolean} isTail 35 | * @param {Function(in:string):void} out 36 | * @param {Function(node:Node):String} printNode 37 | */ 38 | function row (root, prefix, isTail, out, printNode) { 39 | if (root) { 40 | out(("" + prefix + (isTail ? '└── ' : '├── ') + (printNode(root)) + "\n")); 41 | var indent = prefix + (isTail ? ' ' : '│ '); 42 | if (root.left) { row(root.left, indent, false, out, printNode); } 43 | if (root.right) { row(root.right, indent, true, out, printNode); } 44 | } 45 | } 46 | 47 | 48 | /** 49 | * Is the tree balanced (none of the subtrees differ in height by more than 1) 50 | * @param {Node} root 51 | * @return {Boolean} 52 | */ 53 | function isBalanced(root) { 54 | if (root === null) { return true; } // If node is empty then return true 55 | 56 | // Get the height of left and right sub trees 57 | var lh = height(root.left); 58 | var rh = height(root.right); 59 | 60 | if (Math.abs(lh - rh) <= 1 && 61 | isBalanced(root.left) && 62 | isBalanced(root.right)) { return true; } 63 | 64 | // If we reach here then tree is not height-balanced 65 | return false; 66 | } 67 | 68 | /** 69 | * The function Compute the 'height' of a tree. 70 | * Height is the number of nodes along the longest path 71 | * from the root node down to the farthest leaf node. 72 | * 73 | * @param {Node} node 74 | * @return {Number} 75 | */ 76 | function height(node) { 77 | return node ? (1 + Math.max(height(node.left), height(node.right))) : 0; 78 | } 79 | 80 | 81 | function loadRecursive (parent, keys, values, start, end) { 82 | var size = end - start; 83 | if (size > 0) { 84 | var middle = start + Math.floor(size / 2); 85 | var key = keys[middle]; 86 | var data = values[middle]; 87 | var node = { key: key, data: data, parent: parent }; 88 | node.left = loadRecursive(node, keys, values, start, middle); 89 | node.right = loadRecursive(node, keys, values, middle + 1, end); 90 | return node; 91 | } 92 | return null; 93 | } 94 | 95 | 96 | function markBalance(node) { 97 | if (node === null) { return 0; } 98 | var lh = markBalance(node.left); 99 | var rh = markBalance(node.right); 100 | 101 | node.balanceFactor = lh - rh; 102 | return Math.max(lh, rh) + 1; 103 | } 104 | 105 | 106 | function sort(keys, values, left, right, compare) { 107 | if (left >= right) { return; } 108 | 109 | // eslint-disable-next-line no-bitwise 110 | var pivot = keys[(left + right) >> 1]; 111 | var i = left - 1; 112 | var j = right + 1; 113 | 114 | // eslint-disable-next-line no-constant-condition 115 | while (true) { 116 | do { i++; } while (compare(keys[i], pivot) < 0); 117 | do { j--; } while (compare(keys[j], pivot) > 0); 118 | if (i >= j) { break; } 119 | 120 | var tmp = keys[i]; 121 | keys[i] = keys[j]; 122 | keys[j] = tmp; 123 | 124 | tmp = values[i]; 125 | values[i] = values[j]; 126 | values[j] = tmp; 127 | } 128 | 129 | sort(keys, values, left, j, compare); 130 | sort(keys, values, j + 1, right, compare); 131 | } 132 | 133 | // function createNode (parent, left, right, height, key, data) { 134 | // return { parent, left, right, balanceFactor: height, key, data }; 135 | // } 136 | 137 | /** 138 | * @typedef {{ 139 | * parent: ?Node, 140 | * left: ?Node, 141 | * right: ?Node, 142 | * balanceFactor: number, 143 | * key: Key, 144 | * data: Value 145 | * }} Node 146 | */ 147 | 148 | /** 149 | * @typedef {*} Key 150 | */ 151 | 152 | /** 153 | * @typedef {*} Value 154 | */ 155 | 156 | /** 157 | * Default comparison function 158 | * @param {Key} a 159 | * @param {Key} b 160 | * @returns {number} 161 | */ 162 | function DEFAULT_COMPARE (a, b) { return a > b ? 1 : a < b ? -1 : 0; } 163 | 164 | 165 | /** 166 | * Single left rotation 167 | * @param {Node} node 168 | * @return {Node} 169 | */ 170 | function rotateLeft (node) { 171 | var rightNode = node.right; 172 | node.right = rightNode.left; 173 | 174 | if (rightNode.left) { rightNode.left.parent = node; } 175 | 176 | rightNode.parent = node.parent; 177 | if (rightNode.parent) { 178 | if (rightNode.parent.left === node) { 179 | rightNode.parent.left = rightNode; 180 | } else { 181 | rightNode.parent.right = rightNode; 182 | } 183 | } 184 | 185 | node.parent = rightNode; 186 | rightNode.left = node; 187 | 188 | node.balanceFactor += 1; 189 | if (rightNode.balanceFactor < 0) { 190 | node.balanceFactor -= rightNode.balanceFactor; 191 | } 192 | 193 | rightNode.balanceFactor += 1; 194 | if (node.balanceFactor > 0) { 195 | rightNode.balanceFactor += node.balanceFactor; 196 | } 197 | return rightNode; 198 | } 199 | 200 | 201 | function rotateRight (node) { 202 | var leftNode = node.left; 203 | node.left = leftNode.right; 204 | if (node.left) { node.left.parent = node; } 205 | 206 | leftNode.parent = node.parent; 207 | if (leftNode.parent) { 208 | if (leftNode.parent.left === node) { 209 | leftNode.parent.left = leftNode; 210 | } else { 211 | leftNode.parent.right = leftNode; 212 | } 213 | } 214 | 215 | node.parent = leftNode; 216 | leftNode.right = node; 217 | 218 | node.balanceFactor -= 1; 219 | if (leftNode.balanceFactor > 0) { 220 | node.balanceFactor -= leftNode.balanceFactor; 221 | } 222 | 223 | leftNode.balanceFactor -= 1; 224 | if (node.balanceFactor < 0) { 225 | leftNode.balanceFactor += node.balanceFactor; 226 | } 227 | 228 | return leftNode; 229 | } 230 | 231 | 232 | // function leftBalance (node) { 233 | // if (node.left.balanceFactor === -1) rotateLeft(node.left); 234 | // return rotateRight(node); 235 | // } 236 | 237 | 238 | // function rightBalance (node) { 239 | // if (node.right.balanceFactor === 1) rotateRight(node.right); 240 | // return rotateLeft(node); 241 | // } 242 | 243 | 244 | var AVLTree = function AVLTree (comparator, noDuplicates) { 245 | if ( noDuplicates === void 0 ) noDuplicates = false; 246 | 247 | this._comparator = comparator || DEFAULT_COMPARE; 248 | this._root = null; 249 | this._size = 0; 250 | this._noDuplicates = !!noDuplicates; 251 | }; 252 | 253 | var prototypeAccessors = { size: { configurable: true } }; 254 | 255 | 256 | /** 257 | * Clear the tree 258 | * @return {AVLTree} 259 | */ 260 | AVLTree.prototype.destroy = function destroy () { 261 | return this.clear(); 262 | }; 263 | 264 | 265 | /** 266 | * Clear the tree 267 | * @return {AVLTree} 268 | */ 269 | AVLTree.prototype.clear = function clear () { 270 | this._root = null; 271 | this._size = 0; 272 | return this; 273 | }; 274 | 275 | /** 276 | * Number of nodes 277 | * @return {number} 278 | */ 279 | prototypeAccessors.size.get = function () { 280 | return this._size; 281 | }; 282 | 283 | 284 | /** 285 | * Whether the tree contains a node with the given key 286 | * @param{Key} key 287 | * @return {boolean} true/false 288 | */ 289 | AVLTree.prototype.contains = function contains (key) { 290 | if (this._root){ 291 | var node = this._root; 292 | var comparator = this._comparator; 293 | while (node){ 294 | var cmp = comparator(key, node.key); 295 | if (cmp === 0) { return true; } 296 | else if (cmp < 0) { node = node.left; } 297 | else { node = node.right; } 298 | } 299 | } 300 | return false; 301 | }; 302 | 303 | 304 | /* eslint-disable class-methods-use-this */ 305 | 306 | /** 307 | * Successor node 308 | * @param{Node} node 309 | * @return {?Node} 310 | */ 311 | AVLTree.prototype.next = function next (node) { 312 | var successor = node; 313 | if (successor) { 314 | if (successor.right) { 315 | successor = successor.right; 316 | while (successor.left) { successor = successor.left; } 317 | } else { 318 | successor = node.parent; 319 | while (successor && successor.right === node) { 320 | node = successor; successor = successor.parent; 321 | } 322 | } 323 | } 324 | return successor; 325 | }; 326 | 327 | 328 | /** 329 | * Predecessor node 330 | * @param{Node} node 331 | * @return {?Node} 332 | */ 333 | AVLTree.prototype.prev = function prev (node) { 334 | var predecessor = node; 335 | if (predecessor) { 336 | if (predecessor.left) { 337 | predecessor = predecessor.left; 338 | while (predecessor.right) { predecessor = predecessor.right; } 339 | } else { 340 | predecessor = node.parent; 341 | while (predecessor && predecessor.left === node) { 342 | node = predecessor; 343 | predecessor = predecessor.parent; 344 | } 345 | } 346 | } 347 | return predecessor; 348 | }; 349 | /* eslint-enable class-methods-use-this */ 350 | 351 | 352 | /** 353 | * Callback for forEach 354 | * @callback forEachCallback 355 | * @param {Node} node 356 | * @param {number} index 357 | */ 358 | 359 | /** 360 | * @param{forEachCallback} callback 361 | * @return {AVLTree} 362 | */ 363 | AVLTree.prototype.forEach = function forEach (callback) { 364 | var current = this._root; 365 | var s = [], done = false, i = 0; 366 | 367 | while (!done) { 368 | // Reach the left most Node of the current Node 369 | if (current) { 370 | // Place pointer to a tree node on the stack 371 | // before traversing the node's left subtree 372 | s.push(current); 373 | current = current.left; 374 | } else { 375 | // BackTrack from the empty subtree and visit the Node 376 | // at the top of the stack; however, if the stack is 377 | // empty you are done 378 | if (s.length > 0) { 379 | current = s.pop(); 380 | callback(current, i++); 381 | 382 | // We have visited the node and its left 383 | // subtree. Now, it's right subtree's turn 384 | current = current.right; 385 | } else { done = true; } 386 | } 387 | } 388 | return this; 389 | }; 390 | 391 | 392 | /** 393 | * Walk key range from `low` to `high`. Stops if `fn` returns a value. 394 | * @param{Key} low 395 | * @param{Key} high 396 | * @param{Function} fn 397 | * @param{*?} ctx 398 | * @return {SplayTree} 399 | */ 400 | AVLTree.prototype.range = function range (low, high, fn, ctx) { 401 | var this$1 = this; 402 | 403 | var Q = []; 404 | var compare = this._comparator; 405 | var node = this._root, cmp; 406 | 407 | while (Q.length !== 0 || node) { 408 | if (node) { 409 | Q.push(node); 410 | node = node.left; 411 | } else { 412 | node = Q.pop(); 413 | cmp = compare(node.key, high); 414 | if (cmp > 0) { 415 | break; 416 | } else if (compare(node.key, low) >= 0) { 417 | if (fn.call(ctx, node)) { return this$1; } // stop if smth is returned 418 | } 419 | node = node.right; 420 | } 421 | } 422 | return this; 423 | }; 424 | 425 | 426 | /** 427 | * Returns all keys in order 428 | * @return {Array} 429 | */ 430 | AVLTree.prototype.keys = function keys () { 431 | var current = this._root; 432 | var s = [], r = [], done = false; 433 | 434 | while (!done) { 435 | if (current) { 436 | s.push(current); 437 | current = current.left; 438 | } else { 439 | if (s.length > 0) { 440 | current = s.pop(); 441 | r.push(current.key); 442 | current = current.right; 443 | } else { done = true; } 444 | } 445 | } 446 | return r; 447 | }; 448 | 449 | 450 | /** 451 | * Returns `data` fields of all nodes in order. 452 | * @return {Array} 453 | */ 454 | AVLTree.prototype.values = function values () { 455 | var current = this._root; 456 | var s = [], r = [], done = false; 457 | 458 | while (!done) { 459 | if (current) { 460 | s.push(current); 461 | current = current.left; 462 | } else { 463 | if (s.length > 0) { 464 | current = s.pop(); 465 | r.push(current.data); 466 | current = current.right; 467 | } else { done = true; } 468 | } 469 | } 470 | return r; 471 | }; 472 | 473 | 474 | /** 475 | * Returns node at given index 476 | * @param{number} index 477 | * @return {?Node} 478 | */ 479 | AVLTree.prototype.at = function at (index) { 480 | // removed after a consideration, more misleading than useful 481 | // index = index % this.size; 482 | // if (index < 0) index = this.size - index; 483 | 484 | var current = this._root; 485 | var s = [], done = false, i = 0; 486 | 487 | while (!done) { 488 | if (current) { 489 | s.push(current); 490 | current = current.left; 491 | } else { 492 | if (s.length > 0) { 493 | current = s.pop(); 494 | if (i === index) { return current; } 495 | i++; 496 | current = current.right; 497 | } else { done = true; } 498 | } 499 | } 500 | return null; 501 | }; 502 | 503 | 504 | /** 505 | * Returns node with the minimum key 506 | * @return {?Node} 507 | */ 508 | AVLTree.prototype.minNode = function minNode () { 509 | var node = this._root; 510 | if (!node) { return null; } 511 | while (node.left) { node = node.left; } 512 | return node; 513 | }; 514 | 515 | 516 | /** 517 | * Returns node with the max key 518 | * @return {?Node} 519 | */ 520 | AVLTree.prototype.maxNode = function maxNode () { 521 | var node = this._root; 522 | if (!node) { return null; } 523 | while (node.right) { node = node.right; } 524 | return node; 525 | }; 526 | 527 | 528 | /** 529 | * Min key 530 | * @return {?Key} 531 | */ 532 | AVLTree.prototype.min = function min () { 533 | var node = this._root; 534 | if (!node) { return null; } 535 | while (node.left) { node = node.left; } 536 | return node.key; 537 | }; 538 | 539 | 540 | /** 541 | * Max key 542 | * @return {?Key} 543 | */ 544 | AVLTree.prototype.max = function max () { 545 | var node = this._root; 546 | if (!node) { return null; } 547 | while (node.right) { node = node.right; } 548 | return node.key; 549 | }; 550 | 551 | 552 | /** 553 | * @return {boolean} true/false 554 | */ 555 | AVLTree.prototype.isEmpty = function isEmpty () { 556 | return !this._root; 557 | }; 558 | 559 | 560 | /** 561 | * Removes and returns the node with smallest key 562 | * @return {?Node} 563 | */ 564 | AVLTree.prototype.pop = function pop () { 565 | var node = this._root, returnValue = null; 566 | if (node) { 567 | while (node.left) { node = node.left; } 568 | returnValue = { key: node.key, data: node.data }; 569 | this.remove(node.key); 570 | } 571 | return returnValue; 572 | }; 573 | 574 | 575 | /** 576 | * Removes and returns the node with highest key 577 | * @return {?Node} 578 | */ 579 | AVLTree.prototype.popMax = function popMax () { 580 | var node = this._root, returnValue = null; 581 | if (node) { 582 | while (node.right) { node = node.right; } 583 | returnValue = { key: node.key, data: node.data }; 584 | this.remove(node.key); 585 | } 586 | return returnValue; 587 | }; 588 | 589 | 590 | /** 591 | * Find node by key 592 | * @param{Key} key 593 | * @return {?Node} 594 | */ 595 | AVLTree.prototype.find = function find (key) { 596 | var root = this._root; 597 | // if (root === null) return null; 598 | // if (key === root.key) return root; 599 | 600 | var subtree = root, cmp; 601 | var compare = this._comparator; 602 | while (subtree) { 603 | cmp = compare(key, subtree.key); 604 | if (cmp === 0) { return subtree; } 605 | else if (cmp < 0) { subtree = subtree.left; } 606 | else { subtree = subtree.right; } 607 | } 608 | 609 | return null; 610 | }; 611 | 612 | 613 | /** 614 | * Insert a node into the tree 615 | * @param{Key} key 616 | * @param{Value} [data] 617 | * @return {?Node} 618 | */ 619 | AVLTree.prototype.insert = function insert (key, data) { 620 | var this$1 = this; 621 | 622 | if (!this._root) { 623 | this._root = { 624 | parent: null, left: null, right: null, balanceFactor: 0, 625 | key: key, data: data 626 | }; 627 | this._size++; 628 | return this._root; 629 | } 630 | 631 | var compare = this._comparator; 632 | var node = this._root; 633 | var parent= null; 634 | var cmp = 0; 635 | 636 | if (this._noDuplicates) { 637 | while (node) { 638 | cmp = compare(key, node.key); 639 | parent = node; 640 | if (cmp === 0) { return null; } 641 | else if (cmp < 0) { node = node.left; } 642 | else { node = node.right; } 643 | } 644 | } else { 645 | while (node) { 646 | cmp = compare(key, node.key); 647 | parent = node; 648 | if (cmp <= 0){ node = node.left; } //return null; 649 | else { node = node.right; } 650 | } 651 | } 652 | 653 | var newNode = { 654 | left: null, 655 | right: null, 656 | balanceFactor: 0, 657 | parent: parent, key: key, data: data 658 | }; 659 | var newRoot; 660 | if (cmp <= 0) { parent.left= newNode; } 661 | else { parent.right = newNode; } 662 | 663 | while (parent) { 664 | cmp = compare(parent.key, key); 665 | if (cmp < 0) { parent.balanceFactor -= 1; } 666 | else { parent.balanceFactor += 1; } 667 | 668 | if (parent.balanceFactor === 0) { break; } 669 | else if (parent.balanceFactor < -1) { 670 | // inlined 671 | //var newRoot = rightBalance(parent); 672 | if (parent.right.balanceFactor === 1) { rotateRight(parent.right); } 673 | newRoot = rotateLeft(parent); 674 | 675 | if (parent === this$1._root) { this$1._root = newRoot; } 676 | break; 677 | } else if (parent.balanceFactor > 1) { 678 | // inlined 679 | // var newRoot = leftBalance(parent); 680 | if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); } 681 | newRoot = rotateRight(parent); 682 | 683 | if (parent === this$1._root) { this$1._root = newRoot; } 684 | break; 685 | } 686 | parent = parent.parent; 687 | } 688 | 689 | this._size++; 690 | return newNode; 691 | }; 692 | 693 | 694 | /** 695 | * Removes the node from the tree. If not found, returns null. 696 | * @param{Key} key 697 | * @return {?Node} 698 | */ 699 | AVLTree.prototype.remove = function remove (key) { 700 | var this$1 = this; 701 | 702 | if (!this._root) { return null; } 703 | 704 | var node = this._root; 705 | var compare = this._comparator; 706 | var cmp = 0; 707 | 708 | while (node) { 709 | cmp = compare(key, node.key); 710 | if (cmp === 0) { break; } 711 | else if (cmp < 0) { node = node.left; } 712 | else { node = node.right; } 713 | } 714 | if (!node) { return null; } 715 | 716 | var returnValue = node.key; 717 | var max, min; 718 | 719 | if (node.left) { 720 | max = node.left; 721 | 722 | while (max.left || max.right) { 723 | while (max.right) { max = max.right; } 724 | 725 | node.key = max.key; 726 | node.data = max.data; 727 | if (max.left) { 728 | node = max; 729 | max = max.left; 730 | } 731 | } 732 | 733 | node.key= max.key; 734 | node.data = max.data; 735 | node = max; 736 | } 737 | 738 | if (node.right) { 739 | min = node.right; 740 | 741 | while (min.left || min.right) { 742 | while (min.left) { min = min.left; } 743 | 744 | node.key= min.key; 745 | node.data = min.data; 746 | if (min.right) { 747 | node = min; 748 | min = min.right; 749 | } 750 | } 751 | 752 | node.key= min.key; 753 | node.data = min.data; 754 | node = min; 755 | } 756 | 757 | var parent = node.parent; 758 | var pp = node; 759 | var newRoot; 760 | 761 | while (parent) { 762 | if (parent.left === pp) { parent.balanceFactor -= 1; } 763 | else { parent.balanceFactor += 1; } 764 | 765 | if (parent.balanceFactor < -1) { 766 | // inlined 767 | //var newRoot = rightBalance(parent); 768 | if (parent.right.balanceFactor === 1) { rotateRight(parent.right); } 769 | newRoot = rotateLeft(parent); 770 | 771 | if (parent === this$1._root) { this$1._root = newRoot; } 772 | parent = newRoot; 773 | } else if (parent.balanceFactor > 1) { 774 | // inlined 775 | // var newRoot = leftBalance(parent); 776 | if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); } 777 | newRoot = rotateRight(parent); 778 | 779 | if (parent === this$1._root) { this$1._root = newRoot; } 780 | parent = newRoot; 781 | } 782 | 783 | if (parent.balanceFactor === -1 || parent.balanceFactor === 1) { break; } 784 | 785 | pp = parent; 786 | parent = parent.parent; 787 | } 788 | 789 | if (node.parent) { 790 | if (node.parent.left === node) { node.parent.left= null; } 791 | else { node.parent.right = null; } 792 | } 793 | 794 | if (node === this._root) { this._root = null; } 795 | 796 | this._size--; 797 | return returnValue; 798 | }; 799 | 800 | 801 | /** 802 | * Bulk-load items 803 | * @param{Array}keys 804 | * @param{Array}[values] 805 | * @return {AVLTree} 806 | */ 807 | AVLTree.prototype.load = function load (keys, values, presort) { 808 | if ( keys === void 0 ) keys = []; 809 | if ( values === void 0 ) values = []; 810 | 811 | if (this._size !== 0) { throw new Error('bulk-load: tree is not empty'); } 812 | var size = keys.length; 813 | if (presort) { sort(keys, values, 0, size - 1, this._comparator); } 814 | this._root = loadRecursive(null, keys, values, 0, size); 815 | markBalance(this._root); 816 | this._size = size; 817 | return this; 818 | }; 819 | 820 | 821 | /** 822 | * Returns true if the tree is balanced 823 | * @return {boolean} 824 | */ 825 | AVLTree.prototype.isBalanced = function isBalanced$1 () { 826 | return isBalanced(this._root); 827 | }; 828 | 829 | 830 | /** 831 | * String representation of the tree - primitive horizontal print-out 832 | * @param{Function(Node):string} [printNode] 833 | * @return {string} 834 | */ 835 | AVLTree.prototype.toString = function toString (printNode) { 836 | return print(this._root, printNode); 837 | }; 838 | 839 | Object.defineProperties( AVLTree.prototype, prototypeAccessors ); 840 | 841 | AVLTree.default = AVLTree; 842 | 843 | return AVLTree; 844 | 845 | }))); 846 | 847 | 848 | class Assassin { 849 | 850 | connect(url){ 851 | //connect to server 852 | self.addr = new URL(url) 853 | //connect to server route 854 | self.write = (addr + "write").toString() 855 | // xhr request 856 | var xhr = new XMLHttpRequest(); 857 | xhr.open("POST", url, false); xhr.send(null); 858 | //create tree 859 | self.tree = new AVLTree(); 860 | // let's parse the object into JSON within array 861 | const res = JSON.parse(xhr.responseText); 862 | //send complete object to main thread. deep clone the object 863 | self.postMessage(JSON.parse(JSON.stringify(res))) 864 | // add object keys and object values into tree to create tree 865 | tree.load(Object.keys(res),Object.values(res)) 866 | 867 | } 868 | 869 | 870 | update(k,val){ 871 | tree.remove(k) 872 | tree.insert(k,val) 873 | const base = {} 874 | tree.keys().forEach((key, i) => base[key] = tree.values()[i]); 875 | self.postMessage(base) 876 | var xhr = new XMLHttpRequest();xhr.open("POST", write, true); 877 | xhr.send(JSON.stringify(base)); 878 | } 879 | 880 | delete(key){ 881 | tree.remove(key) 882 | const base = {} 883 | tree.keys().forEach((key, i) => base[key] = tree.values()[i]); 884 | self.postMessage(base) 885 | const xhr = new XMLHttpRequest(); xhr.open("POST", write , true); 886 | xhr.send(JSON.stringify(base)); 887 | } 888 | 889 | create (k,val){ 890 | if (tree.contains(k)==false){ 891 | tree.insert(k,val); 892 | const base = {}; 893 | tree.keys().forEach((key, i) => base[key] = tree.values()[i]); 894 | self.postMessage(base); 895 | var xhr = new XMLHttpRequest(); xhr.open("POST", write, true); 896 | xhr.send(JSON.stringify(base)); 897 | } else if (tree.contains(k)==true){ 898 | console.log("Key already exists.") 899 | } 900 | } 901 | 902 | } 903 | killer = new Assassin(); 904 | -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Assassin Demo 8 | 65 | 68 | 69 | 70 |

Assassin

71 |

killer.create

72 |

killer.update
73 |
74 |

killer.delete
75 |


76 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /demo/online.js: -------------------------------------------------------------------------------- 1 | importScripts('assassin.js') 2 | 3 | killer.connect("https://your-server.fly.dev"); 4 | 5 | self.onmessage = function (e) { 6 | 7 | if (e.data[0] == "c"){ 8 | killer.create(e.data[1],e.data[2]) 9 | } else if (e.data[0] == "d"){ 10 | killer.delete(e.data[1]) 11 | } else if (e.data[0] == "u"){ 12 | killer.update(e.data[1],e.data[2]) 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /dist/assassin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * avl v1.4.4 3 | * Fast AVL tree for Node and browser 4 | * 5 | * @author Alexander Milevski 6 | * @license MIT 7 | * @preserve 8 | */ 9 | 10 | (function (global, factory) { 11 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 12 | typeof define === 'function' && define.amd ? define(factory) : 13 | (global.AVLTree = factory()); 14 | }(this, (function () { 'use strict'; 15 | 16 | /** 17 | * Prints tree horizontally 18 | * @param {Node} root 19 | * @param {Function(node:Node):String} [printNode] 20 | * @return {String} 21 | */ 22 | function print (root, printNode) { 23 | if ( printNode === void 0 ) printNode = function (n) { return n.key; }; 24 | 25 | var out = []; 26 | row(root, '', true, function (v) { return out.push(v); }, printNode); 27 | return out.join(''); 28 | } 29 | 30 | /** 31 | * Prints level of the tree 32 | * @param {Node} root 33 | * @param {String} prefix 34 | * @param {Boolean} isTail 35 | * @param {Function(in:string):void} out 36 | * @param {Function(node:Node):String} printNode 37 | */ 38 | function row (root, prefix, isTail, out, printNode) { 39 | if (root) { 40 | out(("" + prefix + (isTail ? '└── ' : '├── ') + (printNode(root)) + "\n")); 41 | var indent = prefix + (isTail ? ' ' : '│ '); 42 | if (root.left) { row(root.left, indent, false, out, printNode); } 43 | if (root.right) { row(root.right, indent, true, out, printNode); } 44 | } 45 | } 46 | 47 | 48 | /** 49 | * Is the tree balanced (none of the subtrees differ in height by more than 1) 50 | * @param {Node} root 51 | * @return {Boolean} 52 | */ 53 | function isBalanced(root) { 54 | if (root === null) { return true; } // If node is empty then return true 55 | 56 | // Get the height of left and right sub trees 57 | var lh = height(root.left); 58 | var rh = height(root.right); 59 | 60 | if (Math.abs(lh - rh) <= 1 && 61 | isBalanced(root.left) && 62 | isBalanced(root.right)) { return true; } 63 | 64 | // If we reach here then tree is not height-balanced 65 | return false; 66 | } 67 | 68 | /** 69 | * The function Compute the 'height' of a tree. 70 | * Height is the number of nodes along the longest path 71 | * from the root node down to the farthest leaf node. 72 | * 73 | * @param {Node} node 74 | * @return {Number} 75 | */ 76 | function height(node) { 77 | return node ? (1 + Math.max(height(node.left), height(node.right))) : 0; 78 | } 79 | 80 | 81 | function loadRecursive (parent, keys, values, start, end) { 82 | var size = end - start; 83 | if (size > 0) { 84 | var middle = start + Math.floor(size / 2); 85 | var key = keys[middle]; 86 | var data = values[middle]; 87 | var node = { key: key, data: data, parent: parent }; 88 | node.left = loadRecursive(node, keys, values, start, middle); 89 | node.right = loadRecursive(node, keys, values, middle + 1, end); 90 | return node; 91 | } 92 | return null; 93 | } 94 | 95 | 96 | function markBalance(node) { 97 | if (node === null) { return 0; } 98 | var lh = markBalance(node.left); 99 | var rh = markBalance(node.right); 100 | 101 | node.balanceFactor = lh - rh; 102 | return Math.max(lh, rh) + 1; 103 | } 104 | 105 | 106 | function sort(keys, values, left, right, compare) { 107 | if (left >= right) { return; } 108 | 109 | // eslint-disable-next-line no-bitwise 110 | var pivot = keys[(left + right) >> 1]; 111 | var i = left - 1; 112 | var j = right + 1; 113 | 114 | // eslint-disable-next-line no-constant-condition 115 | while (true) { 116 | do { i++; } while (compare(keys[i], pivot) < 0); 117 | do { j--; } while (compare(keys[j], pivot) > 0); 118 | if (i >= j) { break; } 119 | 120 | var tmp = keys[i]; 121 | keys[i] = keys[j]; 122 | keys[j] = tmp; 123 | 124 | tmp = values[i]; 125 | values[i] = values[j]; 126 | values[j] = tmp; 127 | } 128 | 129 | sort(keys, values, left, j, compare); 130 | sort(keys, values, j + 1, right, compare); 131 | } 132 | 133 | // function createNode (parent, left, right, height, key, data) { 134 | // return { parent, left, right, balanceFactor: height, key, data }; 135 | // } 136 | 137 | /** 138 | * @typedef {{ 139 | * parent: ?Node, 140 | * left: ?Node, 141 | * right: ?Node, 142 | * balanceFactor: number, 143 | * key: Key, 144 | * data: Value 145 | * }} Node 146 | */ 147 | 148 | /** 149 | * @typedef {*} Key 150 | */ 151 | 152 | /** 153 | * @typedef {*} Value 154 | */ 155 | 156 | /** 157 | * Default comparison function 158 | * @param {Key} a 159 | * @param {Key} b 160 | * @returns {number} 161 | */ 162 | function DEFAULT_COMPARE (a, b) { return a > b ? 1 : a < b ? -1 : 0; } 163 | 164 | 165 | /** 166 | * Single left rotation 167 | * @param {Node} node 168 | * @return {Node} 169 | */ 170 | function rotateLeft (node) { 171 | var rightNode = node.right; 172 | node.right = rightNode.left; 173 | 174 | if (rightNode.left) { rightNode.left.parent = node; } 175 | 176 | rightNode.parent = node.parent; 177 | if (rightNode.parent) { 178 | if (rightNode.parent.left === node) { 179 | rightNode.parent.left = rightNode; 180 | } else { 181 | rightNode.parent.right = rightNode; 182 | } 183 | } 184 | 185 | node.parent = rightNode; 186 | rightNode.left = node; 187 | 188 | node.balanceFactor += 1; 189 | if (rightNode.balanceFactor < 0) { 190 | node.balanceFactor -= rightNode.balanceFactor; 191 | } 192 | 193 | rightNode.balanceFactor += 1; 194 | if (node.balanceFactor > 0) { 195 | rightNode.balanceFactor += node.balanceFactor; 196 | } 197 | return rightNode; 198 | } 199 | 200 | 201 | function rotateRight (node) { 202 | var leftNode = node.left; 203 | node.left = leftNode.right; 204 | if (node.left) { node.left.parent = node; } 205 | 206 | leftNode.parent = node.parent; 207 | if (leftNode.parent) { 208 | if (leftNode.parent.left === node) { 209 | leftNode.parent.left = leftNode; 210 | } else { 211 | leftNode.parent.right = leftNode; 212 | } 213 | } 214 | 215 | node.parent = leftNode; 216 | leftNode.right = node; 217 | 218 | node.balanceFactor -= 1; 219 | if (leftNode.balanceFactor > 0) { 220 | node.balanceFactor -= leftNode.balanceFactor; 221 | } 222 | 223 | leftNode.balanceFactor -= 1; 224 | if (node.balanceFactor < 0) { 225 | leftNode.balanceFactor += node.balanceFactor; 226 | } 227 | 228 | return leftNode; 229 | } 230 | 231 | 232 | // function leftBalance (node) { 233 | // if (node.left.balanceFactor === -1) rotateLeft(node.left); 234 | // return rotateRight(node); 235 | // } 236 | 237 | 238 | // function rightBalance (node) { 239 | // if (node.right.balanceFactor === 1) rotateRight(node.right); 240 | // return rotateLeft(node); 241 | // } 242 | 243 | 244 | var AVLTree = function AVLTree (comparator, noDuplicates) { 245 | if ( noDuplicates === void 0 ) noDuplicates = false; 246 | 247 | this._comparator = comparator || DEFAULT_COMPARE; 248 | this._root = null; 249 | this._size = 0; 250 | this._noDuplicates = !!noDuplicates; 251 | }; 252 | 253 | var prototypeAccessors = { size: { configurable: true } }; 254 | 255 | 256 | /** 257 | * Clear the tree 258 | * @return {AVLTree} 259 | */ 260 | AVLTree.prototype.destroy = function destroy () { 261 | return this.clear(); 262 | }; 263 | 264 | 265 | /** 266 | * Clear the tree 267 | * @return {AVLTree} 268 | */ 269 | AVLTree.prototype.clear = function clear () { 270 | this._root = null; 271 | this._size = 0; 272 | return this; 273 | }; 274 | 275 | /** 276 | * Number of nodes 277 | * @return {number} 278 | */ 279 | prototypeAccessors.size.get = function () { 280 | return this._size; 281 | }; 282 | 283 | 284 | /** 285 | * Whether the tree contains a node with the given key 286 | * @param{Key} key 287 | * @return {boolean} true/false 288 | */ 289 | AVLTree.prototype.contains = function contains (key) { 290 | if (this._root){ 291 | var node = this._root; 292 | var comparator = this._comparator; 293 | while (node){ 294 | var cmp = comparator(key, node.key); 295 | if (cmp === 0) { return true; } 296 | else if (cmp < 0) { node = node.left; } 297 | else { node = node.right; } 298 | } 299 | } 300 | return false; 301 | }; 302 | 303 | 304 | /* eslint-disable class-methods-use-this */ 305 | 306 | /** 307 | * Successor node 308 | * @param{Node} node 309 | * @return {?Node} 310 | */ 311 | AVLTree.prototype.next = function next (node) { 312 | var successor = node; 313 | if (successor) { 314 | if (successor.right) { 315 | successor = successor.right; 316 | while (successor.left) { successor = successor.left; } 317 | } else { 318 | successor = node.parent; 319 | while (successor && successor.right === node) { 320 | node = successor; successor = successor.parent; 321 | } 322 | } 323 | } 324 | return successor; 325 | }; 326 | 327 | 328 | /** 329 | * Predecessor node 330 | * @param{Node} node 331 | * @return {?Node} 332 | */ 333 | AVLTree.prototype.prev = function prev (node) { 334 | var predecessor = node; 335 | if (predecessor) { 336 | if (predecessor.left) { 337 | predecessor = predecessor.left; 338 | while (predecessor.right) { predecessor = predecessor.right; } 339 | } else { 340 | predecessor = node.parent; 341 | while (predecessor && predecessor.left === node) { 342 | node = predecessor; 343 | predecessor = predecessor.parent; 344 | } 345 | } 346 | } 347 | return predecessor; 348 | }; 349 | /* eslint-enable class-methods-use-this */ 350 | 351 | 352 | /** 353 | * Callback for forEach 354 | * @callback forEachCallback 355 | * @param {Node} node 356 | * @param {number} index 357 | */ 358 | 359 | /** 360 | * @param{forEachCallback} callback 361 | * @return {AVLTree} 362 | */ 363 | AVLTree.prototype.forEach = function forEach (callback) { 364 | var current = this._root; 365 | var s = [], done = false, i = 0; 366 | 367 | while (!done) { 368 | // Reach the left most Node of the current Node 369 | if (current) { 370 | // Place pointer to a tree node on the stack 371 | // before traversing the node's left subtree 372 | s.push(current); 373 | current = current.left; 374 | } else { 375 | // BackTrack from the empty subtree and visit the Node 376 | // at the top of the stack; however, if the stack is 377 | // empty you are done 378 | if (s.length > 0) { 379 | current = s.pop(); 380 | callback(current, i++); 381 | 382 | // We have visited the node and its left 383 | // subtree. Now, it's right subtree's turn 384 | current = current.right; 385 | } else { done = true; } 386 | } 387 | } 388 | return this; 389 | }; 390 | 391 | 392 | /** 393 | * Walk key range from `low` to `high`. Stops if `fn` returns a value. 394 | * @param{Key} low 395 | * @param{Key} high 396 | * @param{Function} fn 397 | * @param{*?} ctx 398 | * @return {SplayTree} 399 | */ 400 | AVLTree.prototype.range = function range (low, high, fn, ctx) { 401 | var this$1 = this; 402 | 403 | var Q = []; 404 | var compare = this._comparator; 405 | var node = this._root, cmp; 406 | 407 | while (Q.length !== 0 || node) { 408 | if (node) { 409 | Q.push(node); 410 | node = node.left; 411 | } else { 412 | node = Q.pop(); 413 | cmp = compare(node.key, high); 414 | if (cmp > 0) { 415 | break; 416 | } else if (compare(node.key, low) >= 0) { 417 | if (fn.call(ctx, node)) { return this$1; } // stop if smth is returned 418 | } 419 | node = node.right; 420 | } 421 | } 422 | return this; 423 | }; 424 | 425 | 426 | /** 427 | * Returns all keys in order 428 | * @return {Array} 429 | */ 430 | AVLTree.prototype.keys = function keys () { 431 | var current = this._root; 432 | var s = [], r = [], done = false; 433 | 434 | while (!done) { 435 | if (current) { 436 | s.push(current); 437 | current = current.left; 438 | } else { 439 | if (s.length > 0) { 440 | current = s.pop(); 441 | r.push(current.key); 442 | current = current.right; 443 | } else { done = true; } 444 | } 445 | } 446 | return r; 447 | }; 448 | 449 | 450 | /** 451 | * Returns `data` fields of all nodes in order. 452 | * @return {Array} 453 | */ 454 | AVLTree.prototype.values = function values () { 455 | var current = this._root; 456 | var s = [], r = [], done = false; 457 | 458 | while (!done) { 459 | if (current) { 460 | s.push(current); 461 | current = current.left; 462 | } else { 463 | if (s.length > 0) { 464 | current = s.pop(); 465 | r.push(current.data); 466 | current = current.right; 467 | } else { done = true; } 468 | } 469 | } 470 | return r; 471 | }; 472 | 473 | 474 | /** 475 | * Returns node at given index 476 | * @param{number} index 477 | * @return {?Node} 478 | */ 479 | AVLTree.prototype.at = function at (index) { 480 | // removed after a consideration, more misleading than useful 481 | // index = index % this.size; 482 | // if (index < 0) index = this.size - index; 483 | 484 | var current = this._root; 485 | var s = [], done = false, i = 0; 486 | 487 | while (!done) { 488 | if (current) { 489 | s.push(current); 490 | current = current.left; 491 | } else { 492 | if (s.length > 0) { 493 | current = s.pop(); 494 | if (i === index) { return current; } 495 | i++; 496 | current = current.right; 497 | } else { done = true; } 498 | } 499 | } 500 | return null; 501 | }; 502 | 503 | 504 | /** 505 | * Returns node with the minimum key 506 | * @return {?Node} 507 | */ 508 | AVLTree.prototype.minNode = function minNode () { 509 | var node = this._root; 510 | if (!node) { return null; } 511 | while (node.left) { node = node.left; } 512 | return node; 513 | }; 514 | 515 | 516 | /** 517 | * Returns node with the max key 518 | * @return {?Node} 519 | */ 520 | AVLTree.prototype.maxNode = function maxNode () { 521 | var node = this._root; 522 | if (!node) { return null; } 523 | while (node.right) { node = node.right; } 524 | return node; 525 | }; 526 | 527 | 528 | /** 529 | * Min key 530 | * @return {?Key} 531 | */ 532 | AVLTree.prototype.min = function min () { 533 | var node = this._root; 534 | if (!node) { return null; } 535 | while (node.left) { node = node.left; } 536 | return node.key; 537 | }; 538 | 539 | 540 | /** 541 | * Max key 542 | * @return {?Key} 543 | */ 544 | AVLTree.prototype.max = function max () { 545 | var node = this._root; 546 | if (!node) { return null; } 547 | while (node.right) { node = node.right; } 548 | return node.key; 549 | }; 550 | 551 | 552 | /** 553 | * @return {boolean} true/false 554 | */ 555 | AVLTree.prototype.isEmpty = function isEmpty () { 556 | return !this._root; 557 | }; 558 | 559 | 560 | /** 561 | * Removes and returns the node with smallest key 562 | * @return {?Node} 563 | */ 564 | AVLTree.prototype.pop = function pop () { 565 | var node = this._root, returnValue = null; 566 | if (node) { 567 | while (node.left) { node = node.left; } 568 | returnValue = { key: node.key, data: node.data }; 569 | this.remove(node.key); 570 | } 571 | return returnValue; 572 | }; 573 | 574 | 575 | /** 576 | * Removes and returns the node with highest key 577 | * @return {?Node} 578 | */ 579 | AVLTree.prototype.popMax = function popMax () { 580 | var node = this._root, returnValue = null; 581 | if (node) { 582 | while (node.right) { node = node.right; } 583 | returnValue = { key: node.key, data: node.data }; 584 | this.remove(node.key); 585 | } 586 | return returnValue; 587 | }; 588 | 589 | 590 | /** 591 | * Find node by key 592 | * @param{Key} key 593 | * @return {?Node} 594 | */ 595 | AVLTree.prototype.find = function find (key) { 596 | var root = this._root; 597 | // if (root === null) return null; 598 | // if (key === root.key) return root; 599 | 600 | var subtree = root, cmp; 601 | var compare = this._comparator; 602 | while (subtree) { 603 | cmp = compare(key, subtree.key); 604 | if (cmp === 0) { return subtree; } 605 | else if (cmp < 0) { subtree = subtree.left; } 606 | else { subtree = subtree.right; } 607 | } 608 | 609 | return null; 610 | }; 611 | 612 | 613 | /** 614 | * Insert a node into the tree 615 | * @param{Key} key 616 | * @param{Value} [data] 617 | * @return {?Node} 618 | */ 619 | AVLTree.prototype.insert = function insert (key, data) { 620 | var this$1 = this; 621 | 622 | if (!this._root) { 623 | this._root = { 624 | parent: null, left: null, right: null, balanceFactor: 0, 625 | key: key, data: data 626 | }; 627 | this._size++; 628 | return this._root; 629 | } 630 | 631 | var compare = this._comparator; 632 | var node = this._root; 633 | var parent= null; 634 | var cmp = 0; 635 | 636 | if (this._noDuplicates) { 637 | while (node) { 638 | cmp = compare(key, node.key); 639 | parent = node; 640 | if (cmp === 0) { return null; } 641 | else if (cmp < 0) { node = node.left; } 642 | else { node = node.right; } 643 | } 644 | } else { 645 | while (node) { 646 | cmp = compare(key, node.key); 647 | parent = node; 648 | if (cmp <= 0){ node = node.left; } //return null; 649 | else { node = node.right; } 650 | } 651 | } 652 | 653 | var newNode = { 654 | left: null, 655 | right: null, 656 | balanceFactor: 0, 657 | parent: parent, key: key, data: data 658 | }; 659 | var newRoot; 660 | if (cmp <= 0) { parent.left= newNode; } 661 | else { parent.right = newNode; } 662 | 663 | while (parent) { 664 | cmp = compare(parent.key, key); 665 | if (cmp < 0) { parent.balanceFactor -= 1; } 666 | else { parent.balanceFactor += 1; } 667 | 668 | if (parent.balanceFactor === 0) { break; } 669 | else if (parent.balanceFactor < -1) { 670 | // inlined 671 | //var newRoot = rightBalance(parent); 672 | if (parent.right.balanceFactor === 1) { rotateRight(parent.right); } 673 | newRoot = rotateLeft(parent); 674 | 675 | if (parent === this$1._root) { this$1._root = newRoot; } 676 | break; 677 | } else if (parent.balanceFactor > 1) { 678 | // inlined 679 | // var newRoot = leftBalance(parent); 680 | if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); } 681 | newRoot = rotateRight(parent); 682 | 683 | if (parent === this$1._root) { this$1._root = newRoot; } 684 | break; 685 | } 686 | parent = parent.parent; 687 | } 688 | 689 | this._size++; 690 | return newNode; 691 | }; 692 | 693 | 694 | /** 695 | * Removes the node from the tree. If not found, returns null. 696 | * @param{Key} key 697 | * @return {?Node} 698 | */ 699 | AVLTree.prototype.remove = function remove (key) { 700 | var this$1 = this; 701 | 702 | if (!this._root) { return null; } 703 | 704 | var node = this._root; 705 | var compare = this._comparator; 706 | var cmp = 0; 707 | 708 | while (node) { 709 | cmp = compare(key, node.key); 710 | if (cmp === 0) { break; } 711 | else if (cmp < 0) { node = node.left; } 712 | else { node = node.right; } 713 | } 714 | if (!node) { return null; } 715 | 716 | var returnValue = node.key; 717 | var max, min; 718 | 719 | if (node.left) { 720 | max = node.left; 721 | 722 | while (max.left || max.right) { 723 | while (max.right) { max = max.right; } 724 | 725 | node.key = max.key; 726 | node.data = max.data; 727 | if (max.left) { 728 | node = max; 729 | max = max.left; 730 | } 731 | } 732 | 733 | node.key= max.key; 734 | node.data = max.data; 735 | node = max; 736 | } 737 | 738 | if (node.right) { 739 | min = node.right; 740 | 741 | while (min.left || min.right) { 742 | while (min.left) { min = min.left; } 743 | 744 | node.key= min.key; 745 | node.data = min.data; 746 | if (min.right) { 747 | node = min; 748 | min = min.right; 749 | } 750 | } 751 | 752 | node.key= min.key; 753 | node.data = min.data; 754 | node = min; 755 | } 756 | 757 | var parent = node.parent; 758 | var pp = node; 759 | var newRoot; 760 | 761 | while (parent) { 762 | if (parent.left === pp) { parent.balanceFactor -= 1; } 763 | else { parent.balanceFactor += 1; } 764 | 765 | if (parent.balanceFactor < -1) { 766 | // inlined 767 | //var newRoot = rightBalance(parent); 768 | if (parent.right.balanceFactor === 1) { rotateRight(parent.right); } 769 | newRoot = rotateLeft(parent); 770 | 771 | if (parent === this$1._root) { this$1._root = newRoot; } 772 | parent = newRoot; 773 | } else if (parent.balanceFactor > 1) { 774 | // inlined 775 | // var newRoot = leftBalance(parent); 776 | if (parent.left.balanceFactor === -1) { rotateLeft(parent.left); } 777 | newRoot = rotateRight(parent); 778 | 779 | if (parent === this$1._root) { this$1._root = newRoot; } 780 | parent = newRoot; 781 | } 782 | 783 | if (parent.balanceFactor === -1 || parent.balanceFactor === 1) { break; } 784 | 785 | pp = parent; 786 | parent = parent.parent; 787 | } 788 | 789 | if (node.parent) { 790 | if (node.parent.left === node) { node.parent.left= null; } 791 | else { node.parent.right = null; } 792 | } 793 | 794 | if (node === this._root) { this._root = null; } 795 | 796 | this._size--; 797 | return returnValue; 798 | }; 799 | 800 | 801 | /** 802 | * Bulk-load items 803 | * @param{Array}keys 804 | * @param{Array}[values] 805 | * @return {AVLTree} 806 | */ 807 | AVLTree.prototype.load = function load (keys, values, presort) { 808 | if ( keys === void 0 ) keys = []; 809 | if ( values === void 0 ) values = []; 810 | 811 | if (this._size !== 0) { throw new Error('bulk-load: tree is not empty'); } 812 | var size = keys.length; 813 | if (presort) { sort(keys, values, 0, size - 1, this._comparator); } 814 | this._root = loadRecursive(null, keys, values, 0, size); 815 | markBalance(this._root); 816 | this._size = size; 817 | return this; 818 | }; 819 | 820 | 821 | /** 822 | * Returns true if the tree is balanced 823 | * @return {boolean} 824 | */ 825 | AVLTree.prototype.isBalanced = function isBalanced$1 () { 826 | return isBalanced(this._root); 827 | }; 828 | 829 | 830 | /** 831 | * String representation of the tree - primitive horizontal print-out 832 | * @param{Function(Node):string} [printNode] 833 | * @return {string} 834 | */ 835 | AVLTree.prototype.toString = function toString (printNode) { 836 | return print(this._root, printNode); 837 | }; 838 | 839 | Object.defineProperties( AVLTree.prototype, prototypeAccessors ); 840 | 841 | AVLTree.default = AVLTree; 842 | 843 | return AVLTree; 844 | 845 | }))); 846 | 847 | 848 | class Assassin { 849 | 850 | connect(url){ 851 | //connect to server 852 | self.addr = new URL(url) 853 | //connect to server route 854 | self.write = (addr + "write").toString() 855 | // xhr request 856 | var xhr = new XMLHttpRequest(); 857 | xhr.open("POST", url, false); xhr.send(null); 858 | //create tree 859 | self.tree = new AVLTree(); 860 | // let's parse the object into JSON within array 861 | const res = JSON.parse(xhr.responseText); 862 | //send complete object to main thread. deep clone the object 863 | self.postMessage(JSON.parse(JSON.stringify(res))) 864 | // add object keys and object values into tree to create tree 865 | tree.load(Object.keys(res),Object.values(res)) 866 | 867 | } 868 | 869 | 870 | update(k,val){ 871 | tree.remove(k) 872 | tree.insert(k,val) 873 | const base = {} 874 | tree.keys().forEach((key, i) => base[key] = tree.values()[i]); 875 | self.postMessage(base) 876 | var xhr = new XMLHttpRequest();xhr.open("POST", write, true); 877 | xhr.send(JSON.stringify(base)); 878 | } 879 | 880 | delete(key){ 881 | tree.remove(key) 882 | const base = {} 883 | tree.keys().forEach((key, i) => base[key] = tree.values()[i]); 884 | self.postMessage(base) 885 | const xhr = new XMLHttpRequest(); xhr.open("POST", write , true); 886 | xhr.send(JSON.stringify(base)); 887 | } 888 | 889 | create (k,val){ 890 | if (tree.contains(k)==false){ 891 | tree.insert(k,val); 892 | const base = {}; 893 | tree.keys().forEach((key, i) => base[key] = tree.values()[i]); 894 | self.postMessage(base); 895 | var xhr = new XMLHttpRequest(); xhr.open("POST", write, true); 896 | xhr.send(JSON.stringify(base)); 897 | } else if (tree.contains(k)==true){ 898 | console.log("Key already exists.") 899 | } 900 | } 901 | 902 | } 903 | killer = new Assassin(); 904 | -------------------------------------------------------------------------------- /dist/assassin.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | MIT 3 | @preserve 4 | */ 5 | (function(g,k){"object"===typeof exports&&"undefined"!==typeof module?module.exports=k():"function"===typeof define&&define.amd?define(k):g.AVLTree=k()})(this,function(){function g(b,a){void 0===a&&(a=function(d){return d.key});var c=[];k(b,"",!0,function(d){return c.push(d)},a);return c.join("")}function k(b,a,c,d,e){b&&(d(""+a+(c?"\u2514\u2500\u2500 ":"\u251c\u2500\u2500 ")+e(b)+"\n"),a+=c?" ":"\u2502 ",b.left&&k(b.left,a,!1,d,e),b.right&&k(b.right,a,!0,d,e))}function m(b){if(null===b)return!0; 6 | var a=n(b.left),c=n(b.right);return 1>=Math.abs(a-c)&&m(b.left)&&m(b.right)?!0:!1}function n(b){return b?1+Math.max(n(b.left),n(b.right)):0}function q(b,a,c,d,e){var h=e-d;return 0=d)){for(var h=b[c+d>>1],l=c-1,p=d+1;;){do l++;while(0>e(b[l],h));do p--;while(0< 7 | e(b[p],h));if(l>=p)break;var w=b[l];b[l]=b[p];b[p]=w;w=a[l];a[l]=a[p];a[p]=w}v(b,a,c,p,e);v(b,a,p+1,d,e)}}function y(b,a){return b>a?1:ba.balanceFactor&&(b.balanceFactor-=a.balanceFactor);a.balanceFactor+=1;0b.balanceFactor&&(a.balanceFactor+=b.balanceFactor);return a}var f=function(b,a){void 0===a&&(a=!1);this._comparator=b||y;this._root=null;this._size=0;this._noDuplicates=!!a},x={size:{configurable:!0}};f.prototype.destroy=function(){return this.clear()};f.prototype.clear=function(){this._root= 9 | null;this._size=0;return this};x.size.get=function(){return this._size};f.prototype.contains=function(b){if(this._root)for(var a=this._root,c=this._comparator;a;){var d=c(b,a.key);if(0===d)return!0;a=0>d?a.left:a.right}return!1};f.prototype.next=function(b){var a=b;if(a)if(a.right)for(a=a.right;a.left;)a=a.left;else for(a=b.parent;a&&a.right===b;)b=a,a=a.parent;return a};f.prototype.prev=function(b){var a=b;if(a)if(a.left)for(a=a.left;a.right;)a=a.right;else for(a=b.parent;a&&a.left===b;)b=a,a=a.parent; 10 | return a};f.prototype.forEach=function(b){for(var a=this._root,c=[],d=!1,e=0;!d;)a?(c.push(a),a=a.left):0c?a.left:a.right}return null};f.prototype.insert=function(b,a){if(!this._root)return this._root={parent:null,left:null,right:null,balanceFactor:0,key:b,data:a},this._size++,this._root;var c=this._comparator,d=this._root,e=null,h=0;if(this._noDuplicates)for(;d;){h=c(b,d.key);e=d;if(0===h)return null;d=0>h?d.left:d.right}else for(;d;)h= 14 | c(b,d.key),e=d,d=0>=h?d.left:d.right;d={left:null,right:null,balanceFactor:0,parent:e,key:b,data:a};for(0>=h?e.left=d:e.right=d;e;){h=c(e.key,b);0>h?--e.balanceFactor:e.balanceFactor+=1;if(0===e.balanceFactor)break;else if(-1>e.balanceFactor){1===e.right.balanceFactor&&u(e.right);c=t(e);e===this._root&&(this._root=c);break}else if(1d?a.left:a.right;if(!a)return null;b=a.key;if(a.left){for(c=a.left;c.left||c.right;){for(;c.right;)c=c.right;a.key=c.key;a.data=c.data;c.left&&(a=c,c=c.left)}a.key=c.key;a.data=c.data;a=c}if(a.right){for(c=a.right;c.left||c.right;){for(;c.left;)c=c.left;a.key=c.key;a.data=c.data;c.right&&(a=c,c=c.right)}a.key=c.key;a.data=c.data;a=c}c=a.parent;for(d=a;c;){c.left===d?--c.balanceFactor:c.balanceFactor+=1;-1>c.balanceFactor?(1=== 16 | c.right.balanceFactor&&u(c.right),d=t(c),c===this._root&&(this._root=d),c=d):1 4 | cd /path/to/where_you_want_this_to_be_stored 5 | git clone https://github.com/genderev/assassin_server.git 6 | flyctl init 7 | flyctl deploy 8 | 9 | 10 | For flyctl init , the default configuration is to use the Dockerfile to install and listen on port 8080. 11 | If you want to install the server with default config, install Docker and have the Docker daemon running while you deploy to fly.io. (If it's already on your computer, great!) 12 | 13 | If you don't want to install with the default config, well...I can't tell you what to do. Go be free! 14 | -------------------------------------------------------------------------------- /server/index.html: -------------------------------------------------------------------------------- 1 | ASSASSIN

A S S A S S I N

2 | -------------------------------------------------------------------------------- /server/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "assassin_server", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "abstract-extension": { 8 | "version": "3.1.1", 9 | "resolved": "https://registry.npmjs.org/abstract-extension/-/abstract-extension-3.1.1.tgz", 10 | "integrity": "sha512-qmUIqQEh6ZZBKN6JfysKgCEBqI4qVexE6/N/MUJjqtQhhuGR8a16GKnK6SGFKv/n1cAlbYxLDXbtyhkxSnVYRQ==", 11 | "requires": { 12 | "codecs": "^2.0.0" 13 | } 14 | }, 15 | "accepts": { 16 | "version": "1.3.7", 17 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", 18 | "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", 19 | "requires": { 20 | "mime-types": "~2.1.24", 21 | "negotiator": "0.6.2" 22 | } 23 | }, 24 | "array-flatten": { 25 | "version": "1.1.1", 26 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 27 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" 28 | }, 29 | "array-lru": { 30 | "version": "1.1.1", 31 | "resolved": "https://registry.npmjs.org/array-lru/-/array-lru-1.1.1.tgz", 32 | "integrity": "sha1-DH4bTgIq4Wb/HoRIxZXzGB/NMzc=" 33 | }, 34 | "atomic-batcher": { 35 | "version": "1.0.2", 36 | "resolved": "https://registry.npmjs.org/atomic-batcher/-/atomic-batcher-1.0.2.tgz", 37 | "integrity": "sha1-0WkB0QzOxZUWwZe5zNiTBom4E7Q=" 38 | }, 39 | "bitfield-rle": { 40 | "version": "2.2.1", 41 | "resolved": "https://registry.npmjs.org/bitfield-rle/-/bitfield-rle-2.2.1.tgz", 42 | "integrity": "sha512-wrDhHe7LUkqaytxgbsFXoemzHRv6e8FrVNWWsQCgUfmuVYW6ke44hoGc9VdpjgfIsJ/ejmCFA8wDtDqACNAvyw==", 43 | "requires": { 44 | "buffer-alloc-unsafe": "^1.1.0", 45 | "varint": "^4.0.0" 46 | }, 47 | "dependencies": { 48 | "varint": { 49 | "version": "4.0.1", 50 | "resolved": "https://registry.npmjs.org/varint/-/varint-4.0.1.tgz", 51 | "integrity": "sha1-SQgpuULSSEY7KzUJeZXDv3NxmOk=" 52 | } 53 | } 54 | }, 55 | "blake2b": { 56 | "version": "2.1.3", 57 | "resolved": "https://registry.npmjs.org/blake2b/-/blake2b-2.1.3.tgz", 58 | "integrity": "sha512-pkDss4xFVbMb4270aCyGD3qLv92314Et+FsKzilCLxDz5DuZ2/1g3w4nmBbu6nKApPspnjG7JcwTjGZnduB1yg==", 59 | "requires": { 60 | "blake2b-wasm": "^1.1.0", 61 | "nanoassert": "^1.0.0" 62 | } 63 | }, 64 | "blake2b-universal": { 65 | "version": "1.0.1", 66 | "resolved": "https://registry.npmjs.org/blake2b-universal/-/blake2b-universal-1.0.1.tgz", 67 | "integrity": "sha512-vmMqpF8E9RCde8/+Su/s2rZRxOBwAYQsTyCgok4kLWhWrzMrX0CzID6pVheNJSESY0S0FNTOG4QfRJqnSLOjFA==", 68 | "requires": { 69 | "blake2b": "^2.1.3", 70 | "sodium-native": "^3.0.1" 71 | } 72 | }, 73 | "blake2b-wasm": { 74 | "version": "1.1.7", 75 | "resolved": "https://registry.npmjs.org/blake2b-wasm/-/blake2b-wasm-1.1.7.tgz", 76 | "integrity": "sha512-oFIHvXhlz/DUgF0kq5B1CqxIDjIJwh9iDeUUGQUcvgiGz7Wdw03McEO7CfLBy7QKGdsydcMCgO9jFNBAFCtFcA==", 77 | "requires": { 78 | "nanoassert": "^1.0.0" 79 | } 80 | }, 81 | "body-parser": { 82 | "version": "1.19.0", 83 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", 84 | "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", 85 | "requires": { 86 | "bytes": "3.1.0", 87 | "content-type": "~1.0.4", 88 | "debug": "2.6.9", 89 | "depd": "~1.1.2", 90 | "http-errors": "1.7.2", 91 | "iconv-lite": "0.4.24", 92 | "on-finished": "~2.3.0", 93 | "qs": "6.7.0", 94 | "raw-body": "2.4.0", 95 | "type-is": "~1.6.17" 96 | } 97 | }, 98 | "buffer-alloc": { 99 | "version": "1.2.0", 100 | "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", 101 | "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", 102 | "requires": { 103 | "buffer-alloc-unsafe": "^1.1.0", 104 | "buffer-fill": "^1.0.0" 105 | } 106 | }, 107 | "buffer-alloc-unsafe": { 108 | "version": "1.1.0", 109 | "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", 110 | "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==" 111 | }, 112 | "buffer-fill": { 113 | "version": "1.0.0", 114 | "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", 115 | "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=" 116 | }, 117 | "buffer-from": { 118 | "version": "1.1.1", 119 | "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", 120 | "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" 121 | }, 122 | "bulk-write-stream": { 123 | "version": "1.1.4", 124 | "resolved": "https://registry.npmjs.org/bulk-write-stream/-/bulk-write-stream-1.1.4.tgz", 125 | "integrity": "sha512-GtKwd/4etuk1hNeprXoESBO1RSeRYJMXKf+O0qHmWdUomLT8ysNEfX/4bZFXr3BK6eukpHiEnhY2uMtEHDM2ng==", 126 | "requires": { 127 | "buffer-from": "^1.0.0", 128 | "inherits": "^2.0.1", 129 | "readable-stream": "^2.1.4" 130 | }, 131 | "dependencies": { 132 | "isarray": { 133 | "version": "1.0.0", 134 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 135 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 136 | }, 137 | "readable-stream": { 138 | "version": "2.3.7", 139 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", 140 | "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", 141 | "requires": { 142 | "core-util-is": "~1.0.0", 143 | "inherits": "~2.0.3", 144 | "isarray": "~1.0.0", 145 | "process-nextick-args": "~2.0.0", 146 | "safe-buffer": "~5.1.1", 147 | "string_decoder": "~1.1.1", 148 | "util-deprecate": "~1.0.1" 149 | } 150 | }, 151 | "string_decoder": { 152 | "version": "1.1.1", 153 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 154 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 155 | "requires": { 156 | "safe-buffer": "~5.1.0" 157 | } 158 | } 159 | } 160 | }, 161 | "byte-stream": { 162 | "version": "2.1.0", 163 | "resolved": "https://registry.npmjs.org/byte-stream/-/byte-stream-2.1.0.tgz", 164 | "integrity": "sha1-Mu7LpiU4IdaVELnPNLMVzj5Vsxo=", 165 | "requires": { 166 | "debug": "^1.0.4", 167 | "readable-stream": "~1.1.10" 168 | }, 169 | "dependencies": { 170 | "debug": { 171 | "version": "1.0.5", 172 | "resolved": "https://registry.npmjs.org/debug/-/debug-1.0.5.tgz", 173 | "integrity": "sha1-9yQSF0MPmd7EwrRz6rkiKOh0wqw=", 174 | "requires": { 175 | "ms": "2.0.0" 176 | } 177 | } 178 | } 179 | }, 180 | "bytes": { 181 | "version": "3.1.0", 182 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", 183 | "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" 184 | }, 185 | "call-me-maybe": { 186 | "version": "1.0.1", 187 | "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", 188 | "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=" 189 | }, 190 | "chacha20-universal": { 191 | "version": "1.0.4", 192 | "resolved": "https://registry.npmjs.org/chacha20-universal/-/chacha20-universal-1.0.4.tgz", 193 | "integrity": "sha512-/IOxdWWNa7nRabfe7+oF+jVkGjlr2xUL4J8l/OvzZhj+c9RpMqoo3Dq+5nU1j/BflRV4BKnaQ4+4oH1yBpQG1Q==", 194 | "requires": { 195 | "nanoassert": "^2.0.0" 196 | }, 197 | "dependencies": { 198 | "nanoassert": { 199 | "version": "2.0.0", 200 | "resolved": "https://registry.npmjs.org/nanoassert/-/nanoassert-2.0.0.tgz", 201 | "integrity": "sha512-7vO7n28+aYO4J+8w96AzhmU8G+Y/xpPDJz/se19ICsqj/momRbb9mh9ZUtkoJ5X3nTnPdhEJyc0qnM6yAsHBaA==" 202 | } 203 | } 204 | }, 205 | "clone": { 206 | "version": "2.1.2", 207 | "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", 208 | "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=" 209 | }, 210 | "codecs": { 211 | "version": "2.1.0", 212 | "resolved": "https://registry.npmjs.org/codecs/-/codecs-2.1.0.tgz", 213 | "integrity": "sha512-nSWYToViFEpZXOxhtMQ6IDs76TN9xKIkHOu1KCr/iFiBcgzKuY1AFPZktuXN8r82FbZ/TXP9fwITszLgcp3eQg==" 214 | }, 215 | "content-disposition": { 216 | "version": "0.5.3", 217 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", 218 | "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", 219 | "requires": { 220 | "safe-buffer": "5.1.2" 221 | } 222 | }, 223 | "content-type": { 224 | "version": "1.0.4", 225 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", 226 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" 227 | }, 228 | "cookie": { 229 | "version": "0.4.0", 230 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", 231 | "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" 232 | }, 233 | "cookie-signature": { 234 | "version": "1.0.6", 235 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 236 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" 237 | }, 238 | "core-util-is": { 239 | "version": "1.0.2", 240 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 241 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 242 | }, 243 | "corestore": { 244 | "version": "5.7.3", 245 | "resolved": "https://registry.npmjs.org/corestore/-/corestore-5.7.3.tgz", 246 | "integrity": "sha512-H9JKy7cS0OMtaGX6uZRt+4GFqWlJNtzfQXk04xPGJSiNT96ecwY5tNwR5K72+zOX0sZuNainhvyGZkD9rVZhuA==", 247 | "requires": { 248 | "call-me-maybe": "^1.0.1", 249 | "dat-encoding": "^5.0.1", 250 | "derive-key": "^1.0.0", 251 | "derived-key-storage": "^2.1.0", 252 | "fd-lock": "^1.0.2", 253 | "hypercore": "^9.0.0", 254 | "hypercore-crypto": "^2.0.0", 255 | "hypercore-protocol": "^8.0.0", 256 | "nanoresource": "^1.3.0", 257 | "refpool": "^1.2.0" 258 | } 259 | }, 260 | "cors": { 261 | "version": "2.8.5", 262 | "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", 263 | "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", 264 | "requires": { 265 | "object-assign": "^4", 266 | "vary": "^1" 267 | } 268 | }, 269 | "count-trailing-zeros": { 270 | "version": "1.0.1", 271 | "resolved": "https://registry.npmjs.org/count-trailing-zeros/-/count-trailing-zeros-1.0.1.tgz", 272 | "integrity": "sha1-q6bFgzvkENRbHso+bVg4RM5oLHc=" 273 | }, 274 | "custom-error-class": { 275 | "version": "1.0.0", 276 | "resolved": "https://registry.npmjs.org/custom-error-class/-/custom-error-class-1.0.0.tgz", 277 | "integrity": "sha512-bHT5BAycUbsHYexiPuoIEM/o770u48yWBrZHw/f+BRVkERn19xTgNwcHt79A/AYMxUcOfPjb9OrKoj6rVvPJuA==" 278 | }, 279 | "dat-encoding": { 280 | "version": "5.0.1", 281 | "resolved": "https://registry.npmjs.org/dat-encoding/-/dat-encoding-5.0.1.tgz", 282 | "integrity": "sha512-PET9PlGt6ejgqU07hbPLx3tP2siDMMFumUe+xwmm4+5W+0cOlpzreCPoMVUBzxWeR4sPdxL+AS53odQTBtzEqA==", 283 | "requires": { 284 | "safe-buffer": "^5.0.1" 285 | } 286 | }, 287 | "debug": { 288 | "version": "2.6.9", 289 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 290 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 291 | "requires": { 292 | "ms": "2.0.0" 293 | } 294 | }, 295 | "depd": { 296 | "version": "1.1.2", 297 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", 298 | "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" 299 | }, 300 | "derive-key": { 301 | "version": "1.0.1", 302 | "resolved": "https://registry.npmjs.org/derive-key/-/derive-key-1.0.1.tgz", 303 | "integrity": "sha512-7DHGLGvxFF8umw8NEGH3n9KKgEN8duk4Fiy4WmN3QgNKEogDhaNIsTDd5JVN7ilB8xw4ike1Q08z8UJSJ7hebA==", 304 | "requires": { 305 | "blake2b-universal": "^1.0.0" 306 | } 307 | }, 308 | "derived-key-storage": { 309 | "version": "2.1.0", 310 | "resolved": "https://registry.npmjs.org/derived-key-storage/-/derived-key-storage-2.1.0.tgz", 311 | "integrity": "sha512-4RKKrpf2YouCASaRHqUvyxtHABGLH7UJWNXPjsJxMvzCj4tettUvuyGsmP2/mpGYhSda7caZkS2oP4rqWjgkZg==", 312 | "requires": { 313 | "random-access-storage": "^1.4.0", 314 | "thunky": "^1.0.3", 315 | "varint": "^5.0.0" 316 | } 317 | }, 318 | "destroy": { 319 | "version": "1.0.4", 320 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", 321 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" 322 | }, 323 | "duplexify": { 324 | "version": "3.7.1", 325 | "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", 326 | "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", 327 | "requires": { 328 | "end-of-stream": "^1.0.0", 329 | "inherits": "^2.0.1", 330 | "readable-stream": "^2.0.0", 331 | "stream-shift": "^1.0.0" 332 | }, 333 | "dependencies": { 334 | "isarray": { 335 | "version": "1.0.0", 336 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 337 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 338 | }, 339 | "readable-stream": { 340 | "version": "2.3.7", 341 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", 342 | "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", 343 | "requires": { 344 | "core-util-is": "~1.0.0", 345 | "inherits": "~2.0.3", 346 | "isarray": "~1.0.0", 347 | "process-nextick-args": "~2.0.0", 348 | "safe-buffer": "~5.1.1", 349 | "string_decoder": "~1.1.1", 350 | "util-deprecate": "~1.0.1" 351 | } 352 | }, 353 | "string_decoder": { 354 | "version": "1.1.1", 355 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 356 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 357 | "requires": { 358 | "safe-buffer": "~5.1.0" 359 | } 360 | } 361 | } 362 | }, 363 | "ee-first": { 364 | "version": "1.1.1", 365 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 366 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" 367 | }, 368 | "encodeurl": { 369 | "version": "1.0.2", 370 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 371 | "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" 372 | }, 373 | "end-of-stream": { 374 | "version": "1.4.4", 375 | "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", 376 | "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", 377 | "requires": { 378 | "once": "^1.4.0" 379 | } 380 | }, 381 | "escape-html": { 382 | "version": "1.0.3", 383 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 384 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" 385 | }, 386 | "etag": { 387 | "version": "1.8.1", 388 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 389 | "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" 390 | }, 391 | "express": { 392 | "version": "4.17.1", 393 | "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", 394 | "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", 395 | "requires": { 396 | "accepts": "~1.3.7", 397 | "array-flatten": "1.1.1", 398 | "body-parser": "1.19.0", 399 | "content-disposition": "0.5.3", 400 | "content-type": "~1.0.4", 401 | "cookie": "0.4.0", 402 | "cookie-signature": "1.0.6", 403 | "debug": "2.6.9", 404 | "depd": "~1.1.2", 405 | "encodeurl": "~1.0.2", 406 | "escape-html": "~1.0.3", 407 | "etag": "~1.8.1", 408 | "finalhandler": "~1.1.2", 409 | "fresh": "0.5.2", 410 | "merge-descriptors": "1.0.1", 411 | "methods": "~1.1.2", 412 | "on-finished": "~2.3.0", 413 | "parseurl": "~1.3.3", 414 | "path-to-regexp": "0.1.7", 415 | "proxy-addr": "~2.0.5", 416 | "qs": "6.7.0", 417 | "range-parser": "~1.2.1", 418 | "safe-buffer": "5.1.2", 419 | "send": "0.17.1", 420 | "serve-static": "1.14.1", 421 | "setprototypeof": "1.1.1", 422 | "statuses": "~1.5.0", 423 | "type-is": "~1.6.18", 424 | "utils-merge": "1.0.1", 425 | "vary": "~1.1.2" 426 | } 427 | }, 428 | "fast-bitfield": { 429 | "version": "1.2.2", 430 | "resolved": "https://registry.npmjs.org/fast-bitfield/-/fast-bitfield-1.2.2.tgz", 431 | "integrity": "sha512-t8HYqkuE3YEqNcyWlAfh55479aTxO+GpYwvQvJppYqyBfSmRdNIhzY2m09FKN/MENTzq4wH6heHOIvsPyMAwvQ==", 432 | "requires": { 433 | "count-trailing-zeros": "^1.0.1" 434 | } 435 | }, 436 | "fast-fifo": { 437 | "version": "1.0.0", 438 | "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.0.0.tgz", 439 | "integrity": "sha512-4VEXmjxLj7sbs8J//cn2qhRap50dGzF5n8fjay8mau+Jn4hxSeR3xPFwxMaQq/pDaq7+KQk0PAbC2+nWDkJrmQ==" 440 | }, 441 | "fd-lock": { 442 | "version": "1.1.1", 443 | "resolved": "https://registry.npmjs.org/fd-lock/-/fd-lock-1.1.1.tgz", 444 | "integrity": "sha512-Ng+IXbq6LPMDvvVb0Vr325NjqhPwqlLIvmf43ii7t3WQvo2sHU6V6jQY1cclflxPaPfvNUAuD5VdPuIO1sp50g==", 445 | "requires": { 446 | "napi-macros": "^2.0.0", 447 | "node-gyp-build": "^4.2.2" 448 | } 449 | }, 450 | "filesystem-constants": { 451 | "version": "1.0.0", 452 | "resolved": "https://registry.npmjs.org/filesystem-constants/-/filesystem-constants-1.0.0.tgz", 453 | "integrity": "sha512-/ue62eYa8Mk53dc1XXxT1nhwat3ygWMepjrFON8tBVjtjCTVUzM8JTEAQquNoZnmimM4dbxfV9tZeEav1KUccg==" 454 | }, 455 | "finalhandler": { 456 | "version": "1.1.2", 457 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", 458 | "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", 459 | "requires": { 460 | "debug": "2.6.9", 461 | "encodeurl": "~1.0.2", 462 | "escape-html": "~1.0.3", 463 | "on-finished": "~2.3.0", 464 | "parseurl": "~1.3.3", 465 | "statuses": "~1.5.0", 466 | "unpipe": "~1.0.0" 467 | } 468 | }, 469 | "flat-tree": { 470 | "version": "1.6.0", 471 | "resolved": "https://registry.npmjs.org/flat-tree/-/flat-tree-1.6.0.tgz", 472 | "integrity": "sha1-/KMM3bkAb7ZW6168ea6ydOf96e0=" 473 | }, 474 | "forwarded": { 475 | "version": "0.1.2", 476 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", 477 | "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" 478 | }, 479 | "fresh": { 480 | "version": "0.5.2", 481 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 482 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" 483 | }, 484 | "from2": { 485 | "version": "2.3.0", 486 | "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", 487 | "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", 488 | "requires": { 489 | "inherits": "^2.0.1", 490 | "readable-stream": "^2.0.0" 491 | }, 492 | "dependencies": { 493 | "isarray": { 494 | "version": "1.0.0", 495 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 496 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 497 | }, 498 | "readable-stream": { 499 | "version": "2.3.7", 500 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", 501 | "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", 502 | "requires": { 503 | "core-util-is": "~1.0.0", 504 | "inherits": "~2.0.3", 505 | "isarray": "~1.0.0", 506 | "process-nextick-args": "~2.0.0", 507 | "safe-buffer": "~5.1.1", 508 | "string_decoder": "~1.1.1", 509 | "util-deprecate": "~1.0.1" 510 | } 511 | }, 512 | "string_decoder": { 513 | "version": "1.1.1", 514 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 515 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 516 | "requires": { 517 | "safe-buffer": "~5.1.0" 518 | } 519 | } 520 | } 521 | }, 522 | "generate-function": { 523 | "version": "2.3.1", 524 | "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", 525 | "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", 526 | "requires": { 527 | "is-property": "^1.0.2" 528 | } 529 | }, 530 | "generate-object-property": { 531 | "version": "1.2.0", 532 | "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", 533 | "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", 534 | "requires": { 535 | "is-property": "^1.0.0" 536 | } 537 | }, 538 | "hmac-blake2b": { 539 | "version": "1.0.0", 540 | "resolved": "https://registry.npmjs.org/hmac-blake2b/-/hmac-blake2b-1.0.0.tgz", 541 | "integrity": "sha512-sOdcBvyOQPHYjTOVmE4y1C8SlZDRJmKkAgWMFjoX6URTk7mbP35+QLzE4ZwfcScnP3r3NB3yV0vqJaofrWCMMQ==", 542 | "requires": { 543 | "nanoassert": "^1.1.0", 544 | "sodium-native": "^3.1.1" 545 | } 546 | }, 547 | "http-errors": { 548 | "version": "1.7.2", 549 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", 550 | "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", 551 | "requires": { 552 | "depd": "~1.1.2", 553 | "inherits": "2.0.3", 554 | "setprototypeof": "1.1.1", 555 | "statuses": ">= 1.5.0 < 2", 556 | "toidentifier": "1.0.0" 557 | } 558 | }, 559 | "hypercore": { 560 | "version": "9.5.0", 561 | "resolved": "https://registry.npmjs.org/hypercore/-/hypercore-9.5.0.tgz", 562 | "integrity": "sha512-0jm/sp7Mk8zPTRAKTzMWBk7MSBcVhykxheN2wTGUQjFx1HFR372RYawMoN+tqEQfqq9rmtA2uNHFzFq6AEWgvA==", 563 | "requires": { 564 | "abstract-extension": "^3.0.1", 565 | "atomic-batcher": "^1.0.2", 566 | "bitfield-rle": "^2.2.1", 567 | "bulk-write-stream": "^1.1.3", 568 | "codecs": "^2.0.0", 569 | "fast-bitfield": "^1.2.2", 570 | "fd-lock": "^1.0.2", 571 | "flat-tree": "^1.6.0", 572 | "from2": "^2.3.0", 573 | "hypercore-cache": "^1.0.1", 574 | "hypercore-crypto": "^2.0.0", 575 | "hypercore-protocol": "^8.0.1", 576 | "inherits": "^2.0.3", 577 | "inspect-custom-symbol": "^1.1.0", 578 | "last-one-wins": "^1.0.4", 579 | "memory-pager": "^1.0.2", 580 | "merkle-tree-stream": "^3.0.3", 581 | "nanoguard": "^1.2.0", 582 | "nanoresource": "^1.3.0", 583 | "pretty-hash": "^1.0.1", 584 | "random-access-file": "^2.1.0", 585 | "sparse-bitfield": "^3.0.0", 586 | "timeout-refresh": "^1.0.1", 587 | "uint64be": "^2.0.1", 588 | "unordered-array-remove": "^1.0.2", 589 | "unordered-set": "^2.0.0" 590 | } 591 | }, 592 | "hypercore-byte-stream": { 593 | "version": "1.0.12", 594 | "resolved": "https://registry.npmjs.org/hypercore-byte-stream/-/hypercore-byte-stream-1.0.12.tgz", 595 | "integrity": "sha512-JnpLfCkvH9EPRZ8JXLBUAXo+L2wRQ504yWTwtveH+cSwwx0E8I2dbxXvNIsYGDeghOlX3hka0Ng3GiYI0risZw==", 596 | "requires": { 597 | "readable-stream": "^3.1.1" 598 | }, 599 | "dependencies": { 600 | "readable-stream": { 601 | "version": "3.6.0", 602 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", 603 | "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", 604 | "requires": { 605 | "inherits": "^2.0.3", 606 | "string_decoder": "^1.1.1", 607 | "util-deprecate": "^1.0.1" 608 | } 609 | }, 610 | "safe-buffer": { 611 | "version": "5.2.1", 612 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 613 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" 614 | }, 615 | "string_decoder": { 616 | "version": "1.3.0", 617 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", 618 | "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", 619 | "requires": { 620 | "safe-buffer": "~5.2.0" 621 | } 622 | } 623 | } 624 | }, 625 | "hypercore-cache": { 626 | "version": "1.0.2", 627 | "resolved": "https://registry.npmjs.org/hypercore-cache/-/hypercore-cache-1.0.2.tgz", 628 | "integrity": "sha512-AJ/q7y6EOrXnOH/4+DVcfDygsh1ZXMRGvNc67GBNqwCt22oSCOWhRI6EJ+3HEJciM9M2oSm1WX3qg6kgRhT/Gw==" 629 | }, 630 | "hypercore-crypto": { 631 | "version": "2.1.1", 632 | "resolved": "https://registry.npmjs.org/hypercore-crypto/-/hypercore-crypto-2.1.1.tgz", 633 | "integrity": "sha512-KIA25GiFJXieB7Oa0HSDNtXrPH41VJY5j2xWmIjBqREt3quKOFxL7ceOLz7zBMoWkoYeF2m67RhtDE1C4XfoNA==", 634 | "requires": { 635 | "sodium-universal": "^3.0.0", 636 | "uint64be": "^3.0.0" 637 | }, 638 | "dependencies": { 639 | "uint64be": { 640 | "version": "3.0.0", 641 | "resolved": "https://registry.npmjs.org/uint64be/-/uint64be-3.0.0.tgz", 642 | "integrity": "sha512-mliiCSrsE29aNBI7O9W5gGv6WmA9kBR8PtTt6Apaxns076IRdYrrtFhXHEWMj5CSum3U7cv7/pi4xmi4XsIOqg==" 643 | } 644 | } 645 | }, 646 | "hypercore-protocol": { 647 | "version": "8.0.1", 648 | "resolved": "https://registry.npmjs.org/hypercore-protocol/-/hypercore-protocol-8.0.1.tgz", 649 | "integrity": "sha512-/pWKbp09AvQBD5Nj9FUOMql6WNFB7dBhMeKhzYtTfCvEIEGD5SB6B5/qPpCHiFtiMa7cWqKnuTkNk6MSVFqwDg==", 650 | "requires": { 651 | "abstract-extension": "^3.0.1", 652 | "debug": "^4.1.1", 653 | "hypercore-crypto": "^2.0.0", 654 | "inspect-custom-symbol": "^1.1.0", 655 | "nanoguard": "^1.2.1", 656 | "pretty-hash": "^1.0.1", 657 | "simple-hypercore-protocol": "^2.0.0", 658 | "streamx": "^2.1.0", 659 | "timeout-refresh": "^1.0.0" 660 | }, 661 | "dependencies": { 662 | "debug": { 663 | "version": "4.1.1", 664 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", 665 | "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", 666 | "requires": { 667 | "ms": "^2.1.1" 668 | } 669 | }, 670 | "ms": { 671 | "version": "2.1.2", 672 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 673 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" 674 | } 675 | } 676 | }, 677 | "hyperdrive": { 678 | "version": "10.17.2", 679 | "resolved": "https://registry.npmjs.org/hyperdrive/-/hyperdrive-10.17.2.tgz", 680 | "integrity": "sha512-MDgpugN1AgTdbJVH5L5tDiiKcqgGL9BV0zPFOLGUlNkIr3gv44brGL16Az5mbnO/BYdZXIMqfZH15Y7ZboBNlQ==", 681 | "requires": { 682 | "byte-stream": "^2.1.0", 683 | "corestore": "^5.3.2", 684 | "custom-error-class": "^1.0.0", 685 | "duplexify": "^3.7.1", 686 | "filesystem-constants": "^1.0.0", 687 | "hypercore-byte-stream": "^1.0.2", 688 | "hypercore-protocol": "^8.0.0", 689 | "hyperdrive-schemas": "^2.0.0", 690 | "mountable-hypertrie": "^2.6.0", 691 | "mutexify": "^1.2.0", 692 | "nanoiterator": "^1.2.0", 693 | "nanoresource": "^1.3.0", 694 | "pump": "^3.0.0", 695 | "pumpify": "^2.0.1", 696 | "stream-collector": "^1.0.1", 697 | "streamx": "^2.6.3", 698 | "thunky": "^1.0.3", 699 | "thunky-map": "^1.0.0", 700 | "unixify": "^1.0.0", 701 | "varint": "^5.0.0" 702 | } 703 | }, 704 | "hyperdrive-schemas": { 705 | "version": "2.0.0", 706 | "resolved": "https://registry.npmjs.org/hyperdrive-schemas/-/hyperdrive-schemas-2.0.0.tgz", 707 | "integrity": "sha512-mzD741NjsSt3ttIaavbh3zyNdR3zy0X55HRweNRsw/JEduWjaoOZa6EXz7ly2JxuD7MvAbJxsuNPlnVl9saL6w==", 708 | "requires": { 709 | "protocol-buffers-encodings": "^1.1.0" 710 | } 711 | }, 712 | "hypertrie": { 713 | "version": "5.0.5", 714 | "resolved": "https://registry.npmjs.org/hypertrie/-/hypertrie-5.0.5.tgz", 715 | "integrity": "sha512-SL2sVyDJW17e7xk5uq+6xKRslt9iCUqgCAEtBBHsnGH2VKXUQzlnrhRcLKmll7/mvpzAoDs0PiROGqMv2U3Rjg==", 716 | "requires": { 717 | "array-lru": "^1.1.1", 718 | "bulk-write-stream": "^1.1.4", 719 | "codecs": "^2.0.0", 720 | "hypercore": "^9.4.1", 721 | "hypercore-protocol": "^8.0.0", 722 | "inherits": "^2.0.3", 723 | "inspect-custom-symbol": "^1.1.0", 724 | "is-options": "^1.0.1", 725 | "mutexify": "^1.2.0", 726 | "nanoiterator": "^1.2.0", 727 | "protocol-buffers-encodings": "^1.1.0", 728 | "siphash24-universal": "^1.0.0", 729 | "thunky": "^1.0.2", 730 | "unordered-set": "^2.0.1", 731 | "varint": "^5.0.0" 732 | } 733 | }, 734 | "iconv-lite": { 735 | "version": "0.4.24", 736 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 737 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 738 | "requires": { 739 | "safer-buffer": ">= 2.1.2 < 3" 740 | } 741 | }, 742 | "inherits": { 743 | "version": "2.0.3", 744 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 745 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 746 | }, 747 | "ini": { 748 | "version": "1.3.5", 749 | "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", 750 | "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" 751 | }, 752 | "inspect-custom-symbol": { 753 | "version": "1.1.1", 754 | "resolved": "https://registry.npmjs.org/inspect-custom-symbol/-/inspect-custom-symbol-1.1.1.tgz", 755 | "integrity": "sha512-GOucsp9EcdlLdhPUyOTvQDnbFJtp2WBWZV1Jqe+mVnkJQBL3w96+fB84C+JL+EKXOspMdB0eMDQPDp5w9fkfZA==" 756 | }, 757 | "ipaddr.js": { 758 | "version": "1.9.1", 759 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", 760 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" 761 | }, 762 | "is-options": { 763 | "version": "1.0.1", 764 | "resolved": "https://registry.npmjs.org/is-options/-/is-options-1.0.1.tgz", 765 | "integrity": "sha512-2Xj8sA0zDrAcaoWfBiNmc6VPWAgKDpim0T3J9Djq7vbm1UjwbUWzeuLu/FwC46g3cBbAn0E5R0xwVtOobM6Xxg==" 766 | }, 767 | "is-property": { 768 | "version": "1.0.2", 769 | "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", 770 | "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=" 771 | }, 772 | "isarray": { 773 | "version": "0.0.1", 774 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", 775 | "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" 776 | }, 777 | "last-one-wins": { 778 | "version": "1.0.4", 779 | "resolved": "https://registry.npmjs.org/last-one-wins/-/last-one-wins-1.0.4.tgz", 780 | "integrity": "sha1-wb/Qy8tGeQ7JFWuNGu6Py4bNoio=" 781 | }, 782 | "media-typer": { 783 | "version": "0.3.0", 784 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 785 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" 786 | }, 787 | "memory-pager": { 788 | "version": "1.5.0", 789 | "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", 790 | "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==" 791 | }, 792 | "merge-descriptors": { 793 | "version": "1.0.1", 794 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 795 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" 796 | }, 797 | "merkle-tree-stream": { 798 | "version": "3.0.3", 799 | "resolved": "https://registry.npmjs.org/merkle-tree-stream/-/merkle-tree-stream-3.0.3.tgz", 800 | "integrity": "sha1-+KBkdg0355eK1fn208EZpJT1cIE=", 801 | "requires": { 802 | "flat-tree": "^1.3.0", 803 | "readable-stream": "^2.0.5" 804 | }, 805 | "dependencies": { 806 | "isarray": { 807 | "version": "1.0.0", 808 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 809 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 810 | }, 811 | "readable-stream": { 812 | "version": "2.3.7", 813 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", 814 | "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", 815 | "requires": { 816 | "core-util-is": "~1.0.0", 817 | "inherits": "~2.0.3", 818 | "isarray": "~1.0.0", 819 | "process-nextick-args": "~2.0.0", 820 | "safe-buffer": "~5.1.1", 821 | "string_decoder": "~1.1.1", 822 | "util-deprecate": "~1.0.1" 823 | } 824 | }, 825 | "string_decoder": { 826 | "version": "1.1.1", 827 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 828 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 829 | "requires": { 830 | "safe-buffer": "~5.1.0" 831 | } 832 | } 833 | } 834 | }, 835 | "methods": { 836 | "version": "1.1.2", 837 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 838 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 839 | }, 840 | "mime": { 841 | "version": "1.6.0", 842 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 843 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" 844 | }, 845 | "mime-db": { 846 | "version": "1.44.0", 847 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", 848 | "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" 849 | }, 850 | "mime-types": { 851 | "version": "2.1.27", 852 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", 853 | "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", 854 | "requires": { 855 | "mime-db": "1.44.0" 856 | } 857 | }, 858 | "mkdirp-classic": { 859 | "version": "0.5.3", 860 | "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", 861 | "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" 862 | }, 863 | "mountable-hypertrie": { 864 | "version": "2.7.0", 865 | "resolved": "https://registry.npmjs.org/mountable-hypertrie/-/mountable-hypertrie-2.7.0.tgz", 866 | "integrity": "sha512-ye+46JOvS3tHmbwMv9jASqPVP0XqnMoFprNb0ThO9LLBTWTm8Eo5kcXBkT9huLdv8jDCg+rWhCJDfrMqzXgISw==", 867 | "requires": { 868 | "hypercore-crypto": "^2.0.1", 869 | "hypercore-protocol": "^8.0.0", 870 | "hypertrie": "^5.0.0", 871 | "is-options": "^1.0.1", 872 | "nanoiterator": "^1.2.0", 873 | "nanoresource": "^1.3.0", 874 | "protocol-buffers": "^4.1.0", 875 | "protocol-buffers-encodings": "^1.1.0", 876 | "thunky": "^1.1.0", 877 | "unixify": "^1.0.0" 878 | } 879 | }, 880 | "ms": { 881 | "version": "2.0.0", 882 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 883 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 884 | }, 885 | "mutexify": { 886 | "version": "1.3.1", 887 | "resolved": "https://registry.npmjs.org/mutexify/-/mutexify-1.3.1.tgz", 888 | "integrity": "sha512-nU7mOEuaXiQIB/EgTIjYZJ7g8KqMm2D8l4qp+DqA4jxWOb/tnb1KEoqp+tlbdQIDIAiC1i7j7X/3yHDFXLxr9g==" 889 | }, 890 | "nanoassert": { 891 | "version": "1.1.0", 892 | "resolved": "https://registry.npmjs.org/nanoassert/-/nanoassert-1.1.0.tgz", 893 | "integrity": "sha1-TzFS4JVA/eKMdvRLGbvNHVpCR40=" 894 | }, 895 | "nanoguard": { 896 | "version": "1.3.0", 897 | "resolved": "https://registry.npmjs.org/nanoguard/-/nanoguard-1.3.0.tgz", 898 | "integrity": "sha512-K/ON5wyflyPyZskdeT3m7Y2gJVkm3QLdKykMCquAbK8A2erstyMpZUc3NG8Nz5jKdfatiYndONrlmLF8+pGl+A==" 899 | }, 900 | "nanoiterator": { 901 | "version": "1.2.1", 902 | "resolved": "https://registry.npmjs.org/nanoiterator/-/nanoiterator-1.2.1.tgz", 903 | "integrity": "sha512-M7V9cvfDErMg/H3j90zIGY7Fq3vIGjnnNXwcZ/EXO4plZT3dGNwvykfslHgtbJ8prOGuu3khmc87pND0jdmkcA==", 904 | "requires": { 905 | "inherits": "^2.0.3", 906 | "readable-stream": "^2.3.3" 907 | }, 908 | "dependencies": { 909 | "isarray": { 910 | "version": "1.0.0", 911 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 912 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 913 | }, 914 | "readable-stream": { 915 | "version": "2.3.7", 916 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", 917 | "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", 918 | "requires": { 919 | "core-util-is": "~1.0.0", 920 | "inherits": "~2.0.3", 921 | "isarray": "~1.0.0", 922 | "process-nextick-args": "~2.0.0", 923 | "safe-buffer": "~5.1.1", 924 | "string_decoder": "~1.1.1", 925 | "util-deprecate": "~1.0.1" 926 | } 927 | }, 928 | "string_decoder": { 929 | "version": "1.1.1", 930 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 931 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 932 | "requires": { 933 | "safe-buffer": "~5.1.0" 934 | } 935 | } 936 | } 937 | }, 938 | "nanoresource": { 939 | "version": "1.3.0", 940 | "resolved": "https://registry.npmjs.org/nanoresource/-/nanoresource-1.3.0.tgz", 941 | "integrity": "sha512-OI5dswqipmlYfyL3k/YMm7mbERlh4Bd1KuKdMHpeoVD1iVxqxaTMKleB4qaA2mbQZ6/zMNSxCXv9M9P/YbqTuQ==", 942 | "requires": { 943 | "inherits": "^2.0.4" 944 | }, 945 | "dependencies": { 946 | "inherits": { 947 | "version": "2.0.4", 948 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 949 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 950 | } 951 | } 952 | }, 953 | "napi-macros": { 954 | "version": "2.0.0", 955 | "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", 956 | "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==" 957 | }, 958 | "negotiator": { 959 | "version": "0.6.2", 960 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", 961 | "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" 962 | }, 963 | "node-gyp-build": { 964 | "version": "4.2.3", 965 | "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", 966 | "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==" 967 | }, 968 | "noise-protocol": { 969 | "version": "2.0.0", 970 | "resolved": "https://registry.npmjs.org/noise-protocol/-/noise-protocol-2.0.0.tgz", 971 | "integrity": "sha512-12WcN79T+5At0ja5gJIKHnfJ8wTZj5zY5c5P2pcG0ci34tGqLCCAv31eHcwMS9UfS9Z6MpDCLSBUU4tMdFTudQ==", 972 | "requires": { 973 | "clone": "^2.1.2", 974 | "hmac-blake2b": "^1.0.0", 975 | "nanoassert": "^2.0.0", 976 | "sodium-native": "^3.1.1" 977 | }, 978 | "dependencies": { 979 | "nanoassert": { 980 | "version": "2.0.0", 981 | "resolved": "https://registry.npmjs.org/nanoassert/-/nanoassert-2.0.0.tgz", 982 | "integrity": "sha512-7vO7n28+aYO4J+8w96AzhmU8G+Y/xpPDJz/se19ICsqj/momRbb9mh9ZUtkoJ5X3nTnPdhEJyc0qnM6yAsHBaA==" 983 | } 984 | } 985 | }, 986 | "normalize-path": { 987 | "version": "2.1.1", 988 | "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", 989 | "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", 990 | "requires": { 991 | "remove-trailing-separator": "^1.0.1" 992 | } 993 | }, 994 | "object-assign": { 995 | "version": "4.1.1", 996 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 997 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" 998 | }, 999 | "on-finished": { 1000 | "version": "2.3.0", 1001 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 1002 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 1003 | "requires": { 1004 | "ee-first": "1.1.1" 1005 | } 1006 | }, 1007 | "once": { 1008 | "version": "1.4.0", 1009 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 1010 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 1011 | "requires": { 1012 | "wrappy": "1" 1013 | } 1014 | }, 1015 | "parseurl": { 1016 | "version": "1.3.3", 1017 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 1018 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" 1019 | }, 1020 | "path-parse": { 1021 | "version": "1.0.6", 1022 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", 1023 | "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" 1024 | }, 1025 | "path-to-regexp": { 1026 | "version": "0.1.7", 1027 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 1028 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" 1029 | }, 1030 | "pretty-hash": { 1031 | "version": "1.0.1", 1032 | "resolved": "https://registry.npmjs.org/pretty-hash/-/pretty-hash-1.0.1.tgz", 1033 | "integrity": "sha1-FuBXkYje9WvbVliSvNBaXWUySAc=" 1034 | }, 1035 | "process-nextick-args": { 1036 | "version": "2.0.1", 1037 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 1038 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" 1039 | }, 1040 | "protocol-buffers": { 1041 | "version": "4.2.0", 1042 | "resolved": "https://registry.npmjs.org/protocol-buffers/-/protocol-buffers-4.2.0.tgz", 1043 | "integrity": "sha512-hNp56d5uuREVde7UqP+dmBkwzxrhJwYU5nL/mdivyFfkRZdgAgojkyBeU3jKo7ZHrjdSx6Q1CwUmYJI6INt20g==", 1044 | "requires": { 1045 | "generate-function": "^2.0.0", 1046 | "generate-object-property": "^1.2.0", 1047 | "protocol-buffers-encodings": "^1.1.0", 1048 | "protocol-buffers-schema": "^3.1.1", 1049 | "signed-varint": "^2.0.0", 1050 | "varint": "^5.0.0" 1051 | } 1052 | }, 1053 | "protocol-buffers-encodings": { 1054 | "version": "1.1.0", 1055 | "resolved": "https://registry.npmjs.org/protocol-buffers-encodings/-/protocol-buffers-encodings-1.1.0.tgz", 1056 | "integrity": "sha512-SmjEuAf3hc3h3rWZ6V1YaaQw2MNJWK848gLJgzx/sefOJdNLujKinJVXIS0q2cBQpQn2Q32TinawZyDZPzm4kQ==", 1057 | "requires": { 1058 | "signed-varint": "^2.0.1", 1059 | "varint": "^5.0.0" 1060 | } 1061 | }, 1062 | "protocol-buffers-schema": { 1063 | "version": "3.4.0", 1064 | "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.4.0.tgz", 1065 | "integrity": "sha512-G/2kcamPF2S49W5yaMGdIpkG6+5wZF0fzBteLKgEHjbNzqjZQ85aAs1iJGto31EJaSTkNvHs5IXuHSaTLWBAiA==" 1066 | }, 1067 | "proxy-addr": { 1068 | "version": "2.0.6", 1069 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", 1070 | "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", 1071 | "requires": { 1072 | "forwarded": "~0.1.2", 1073 | "ipaddr.js": "1.9.1" 1074 | } 1075 | }, 1076 | "pump": { 1077 | "version": "3.0.0", 1078 | "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", 1079 | "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", 1080 | "requires": { 1081 | "end-of-stream": "^1.1.0", 1082 | "once": "^1.3.1" 1083 | } 1084 | }, 1085 | "pumpify": { 1086 | "version": "2.0.1", 1087 | "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-2.0.1.tgz", 1088 | "integrity": "sha512-m7KOje7jZxrmutanlkS1daj1dS6z6BgslzOXmcSEpIlCxM3VJH7lG5QLeck/6hgF6F4crFf01UtQmNsJfweTAw==", 1089 | "requires": { 1090 | "duplexify": "^4.1.1", 1091 | "inherits": "^2.0.3", 1092 | "pump": "^3.0.0" 1093 | }, 1094 | "dependencies": { 1095 | "duplexify": { 1096 | "version": "4.1.1", 1097 | "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.1.tgz", 1098 | "integrity": "sha512-DY3xVEmVHTv1wSzKNbwoU6nVjzI369Y6sPoqfYr0/xlx3IdX2n94xIszTcjPO8W8ZIv0Wb0PXNcjuZyT4wiICA==", 1099 | "requires": { 1100 | "end-of-stream": "^1.4.1", 1101 | "inherits": "^2.0.3", 1102 | "readable-stream": "^3.1.1", 1103 | "stream-shift": "^1.0.0" 1104 | } 1105 | }, 1106 | "readable-stream": { 1107 | "version": "3.6.0", 1108 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", 1109 | "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", 1110 | "requires": { 1111 | "inherits": "^2.0.3", 1112 | "string_decoder": "^1.1.1", 1113 | "util-deprecate": "^1.0.1" 1114 | } 1115 | }, 1116 | "safe-buffer": { 1117 | "version": "5.2.1", 1118 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 1119 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" 1120 | }, 1121 | "string_decoder": { 1122 | "version": "1.3.0", 1123 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", 1124 | "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", 1125 | "requires": { 1126 | "safe-buffer": "~5.2.0" 1127 | } 1128 | } 1129 | } 1130 | }, 1131 | "qs": { 1132 | "version": "6.7.0", 1133 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", 1134 | "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" 1135 | }, 1136 | "random-access-file": { 1137 | "version": "2.1.4", 1138 | "resolved": "https://registry.npmjs.org/random-access-file/-/random-access-file-2.1.4.tgz", 1139 | "integrity": "sha512-WAcBP5iLhg1pbjZA40WyMenjK7c5gJUY6Pi5HJ3fLJCeVFNSZv3juf20yFMKxBdvcX5GKbX/HZSfFzlLBdGTdQ==", 1140 | "requires": { 1141 | "mkdirp-classic": "^0.5.2", 1142 | "random-access-storage": "^1.1.1" 1143 | } 1144 | }, 1145 | "random-access-storage": { 1146 | "version": "1.4.1", 1147 | "resolved": "https://registry.npmjs.org/random-access-storage/-/random-access-storage-1.4.1.tgz", 1148 | "integrity": "sha512-DbCc2TIzOxPaHF6KCbr8zLtiYOJQQQCBHUVNHV/SckUQobCBB2YkDtbLdxGnPwPNpJfEyMWxDAm36A2xkbxxtw==", 1149 | "requires": { 1150 | "inherits": "^2.0.3" 1151 | } 1152 | }, 1153 | "range-parser": { 1154 | "version": "1.2.1", 1155 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 1156 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" 1157 | }, 1158 | "raw-body": { 1159 | "version": "2.4.0", 1160 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", 1161 | "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", 1162 | "requires": { 1163 | "bytes": "3.1.0", 1164 | "http-errors": "1.7.2", 1165 | "iconv-lite": "0.4.24", 1166 | "unpipe": "1.0.0" 1167 | } 1168 | }, 1169 | "readable-stream": { 1170 | "version": "1.1.14", 1171 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", 1172 | "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", 1173 | "requires": { 1174 | "core-util-is": "~1.0.0", 1175 | "inherits": "~2.0.1", 1176 | "isarray": "0.0.1", 1177 | "string_decoder": "~0.10.x" 1178 | } 1179 | }, 1180 | "refpool": { 1181 | "version": "1.2.1", 1182 | "resolved": "https://registry.npmjs.org/refpool/-/refpool-1.2.1.tgz", 1183 | "integrity": "sha512-14IP+RGLPL78cPvX79/c7WKDufiqwpic3sZIsJ7AhBp4+fcUfySChJc/aiHSrBKCAr7uoytWAw8yVI4/pLKjbQ==", 1184 | "requires": { 1185 | "time-ordered-set": "^1.0.2" 1186 | } 1187 | }, 1188 | "remove-trailing-separator": { 1189 | "version": "1.1.0", 1190 | "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", 1191 | "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" 1192 | }, 1193 | "resolve": { 1194 | "version": "1.17.0", 1195 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", 1196 | "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", 1197 | "requires": { 1198 | "path-parse": "^1.0.6" 1199 | } 1200 | }, 1201 | "safe-buffer": { 1202 | "version": "5.1.2", 1203 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 1204 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 1205 | }, 1206 | "safer-buffer": { 1207 | "version": "2.1.2", 1208 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 1209 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 1210 | }, 1211 | "send": { 1212 | "version": "0.17.1", 1213 | "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", 1214 | "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", 1215 | "requires": { 1216 | "debug": "2.6.9", 1217 | "depd": "~1.1.2", 1218 | "destroy": "~1.0.4", 1219 | "encodeurl": "~1.0.2", 1220 | "escape-html": "~1.0.3", 1221 | "etag": "~1.8.1", 1222 | "fresh": "0.5.2", 1223 | "http-errors": "~1.7.2", 1224 | "mime": "1.6.0", 1225 | "ms": "2.1.1", 1226 | "on-finished": "~2.3.0", 1227 | "range-parser": "~1.2.1", 1228 | "statuses": "~1.5.0" 1229 | }, 1230 | "dependencies": { 1231 | "ms": { 1232 | "version": "2.1.1", 1233 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", 1234 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" 1235 | } 1236 | } 1237 | }, 1238 | "serve-static": { 1239 | "version": "1.14.1", 1240 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", 1241 | "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", 1242 | "requires": { 1243 | "encodeurl": "~1.0.2", 1244 | "escape-html": "~1.0.3", 1245 | "parseurl": "~1.3.3", 1246 | "send": "0.17.1" 1247 | } 1248 | }, 1249 | "setprototypeof": { 1250 | "version": "1.1.1", 1251 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", 1252 | "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" 1253 | }, 1254 | "sha256-universal": { 1255 | "version": "1.1.0", 1256 | "resolved": "https://registry.npmjs.org/sha256-universal/-/sha256-universal-1.1.0.tgz", 1257 | "integrity": "sha512-CDpS+UrEMA7UOPdogFJ1HOPNrhj0vH+mzWHT5FaU0qlsEXQ4BBey2Mc5+TfJ5nxyRf77fpABbKmXbL/QIzgz2A==", 1258 | "requires": { 1259 | "sha256-wasm": "^2.1.0" 1260 | } 1261 | }, 1262 | "sha256-wasm": { 1263 | "version": "2.1.0", 1264 | "resolved": "https://registry.npmjs.org/sha256-wasm/-/sha256-wasm-2.1.0.tgz", 1265 | "integrity": "sha512-xhb4uSXGIotJj2Q8pWpchDjkszHeTWVoP7p9NM6TGssL/mGUOLFR7vfIrrmcG99aRRox8YiN0JukZf4ZlLWu1w==", 1266 | "requires": { 1267 | "nanoassert": "^2.0.0" 1268 | }, 1269 | "dependencies": { 1270 | "nanoassert": { 1271 | "version": "2.0.0", 1272 | "resolved": "https://registry.npmjs.org/nanoassert/-/nanoassert-2.0.0.tgz", 1273 | "integrity": "sha512-7vO7n28+aYO4J+8w96AzhmU8G+Y/xpPDJz/se19ICsqj/momRbb9mh9ZUtkoJ5X3nTnPdhEJyc0qnM6yAsHBaA==" 1274 | } 1275 | } 1276 | }, 1277 | "sha512-universal": { 1278 | "version": "1.1.0", 1279 | "resolved": "https://registry.npmjs.org/sha512-universal/-/sha512-universal-1.1.0.tgz", 1280 | "integrity": "sha512-2ag5no5DwP9lv6Nk8VkJNujqv5LiJODxReqNp2qiY+O1c1bgiN/PlCRdmjQdBp0k/2XAkdIirEPDpZJoGf9gLw==", 1281 | "requires": { 1282 | "sha512-wasm": "^2.1.0" 1283 | } 1284 | }, 1285 | "sha512-wasm": { 1286 | "version": "2.1.1", 1287 | "resolved": "https://registry.npmjs.org/sha512-wasm/-/sha512-wasm-2.1.1.tgz", 1288 | "integrity": "sha512-v6t7N3YkJzc4UUhel6fpc423O+7pqlKARUrUOAthgBL3LSncb74qnUXljyd8q24+twG7yC/Kh/ouo6wc2L4oVw==", 1289 | "requires": { 1290 | "nanoassert": "^2.0.0" 1291 | }, 1292 | "dependencies": { 1293 | "nanoassert": { 1294 | "version": "2.0.0", 1295 | "resolved": "https://registry.npmjs.org/nanoassert/-/nanoassert-2.0.0.tgz", 1296 | "integrity": "sha512-7vO7n28+aYO4J+8w96AzhmU8G+Y/xpPDJz/se19ICsqj/momRbb9mh9ZUtkoJ5X3nTnPdhEJyc0qnM6yAsHBaA==" 1297 | } 1298 | } 1299 | }, 1300 | "signed-varint": { 1301 | "version": "2.0.1", 1302 | "resolved": "https://registry.npmjs.org/signed-varint/-/signed-varint-2.0.1.tgz", 1303 | "integrity": "sha1-UKmYnafJjCxh2tEZvJdHDvhSgSk=", 1304 | "requires": { 1305 | "varint": "~5.0.0" 1306 | } 1307 | }, 1308 | "simple-handshake": { 1309 | "version": "2.0.0", 1310 | "resolved": "https://registry.npmjs.org/simple-handshake/-/simple-handshake-2.0.0.tgz", 1311 | "integrity": "sha512-9f832LFISpuUaL5yG9HccJ/wW8BlqqANC8DGcNTcKStG2Yjp6kaoq8IdEtUXbRe0sD+qoxAiluDiurmGHNBLjA==", 1312 | "requires": { 1313 | "nanoassert": "^2.0.0", 1314 | "noise-protocol": "^2.0.0" 1315 | }, 1316 | "dependencies": { 1317 | "nanoassert": { 1318 | "version": "2.0.0", 1319 | "resolved": "https://registry.npmjs.org/nanoassert/-/nanoassert-2.0.0.tgz", 1320 | "integrity": "sha512-7vO7n28+aYO4J+8w96AzhmU8G+Y/xpPDJz/se19ICsqj/momRbb9mh9ZUtkoJ5X3nTnPdhEJyc0qnM6yAsHBaA==" 1321 | } 1322 | } 1323 | }, 1324 | "simple-hypercore-protocol": { 1325 | "version": "2.1.0", 1326 | "resolved": "https://registry.npmjs.org/simple-hypercore-protocol/-/simple-hypercore-protocol-2.1.0.tgz", 1327 | "integrity": "sha512-ZnArJL/l/19ahzjZoECd3ojt1OUn+ZFGqZTyuQaiR0R5XarxplRhpLpK+Wr5dyle2cH9ak3cxwUNCfGCOBSN3Q==", 1328 | "requires": { 1329 | "hypercore-crypto": "^2.1.0", 1330 | "noise-protocol": "^2.0.0", 1331 | "protocol-buffers-encodings": "^1.1.0", 1332 | "simple-handshake": "^2.0.0", 1333 | "simple-message-channels": "^1.2.1", 1334 | "varint": "^5.0.0", 1335 | "xsalsa20-universal": "^1.0.0" 1336 | } 1337 | }, 1338 | "simple-message-channels": { 1339 | "version": "1.2.1", 1340 | "resolved": "https://registry.npmjs.org/simple-message-channels/-/simple-message-channels-1.2.1.tgz", 1341 | "integrity": "sha512-knSr69GKW9sCjzpoy817xQelpOASUQ53TXCBcSLDKLE7GTGpUAhZzOZYrdbX2Ig//m+8AIrNp7sM7HDNHBRzXw==", 1342 | "requires": { 1343 | "varint": "^5.0.0" 1344 | } 1345 | }, 1346 | "siphash24": { 1347 | "version": "1.1.1", 1348 | "resolved": "https://registry.npmjs.org/siphash24/-/siphash24-1.1.1.tgz", 1349 | "integrity": "sha512-dKKwjIoTOa587TARYLlBRXq2lkbu5Iz35XrEVWpelhBP1m8r2BGOy1QlaZe84GTFHG/BTucEUd2btnNc8QzIVA==", 1350 | "requires": { 1351 | "nanoassert": "^1.0.0" 1352 | } 1353 | }, 1354 | "siphash24-universal": { 1355 | "version": "1.0.0", 1356 | "resolved": "https://registry.npmjs.org/siphash24-universal/-/siphash24-universal-1.0.0.tgz", 1357 | "integrity": "sha512-TasWcrGz+ITPEvE6Bhz8hACI39bSuoO9aRBYk601lhFZRpkHikbmmCbD5OkBFenYUmhOCjbOSZDbaHb8+FdWkg==", 1358 | "requires": { 1359 | "siphash24": "^1.1.1" 1360 | } 1361 | }, 1362 | "sodium-javascript": { 1363 | "version": "0.6.2", 1364 | "resolved": "https://registry.npmjs.org/sodium-javascript/-/sodium-javascript-0.6.2.tgz", 1365 | "integrity": "sha512-9izwe0RrbTLlM0NkNbt57R6UmXOS4ZPPO20MqW2vvbJtWdTeoxMiQlUIgy1mLzbj+HwxYKTsVs+D/Wf9E6UeoA==", 1366 | "requires": { 1367 | "blake2b": "^2.1.1", 1368 | "chacha20-universal": "^1.0.4", 1369 | "nanoassert": "^2.0.0", 1370 | "sha256-universal": "^1.0.1", 1371 | "sha512-universal": "^1.0.1", 1372 | "siphash24": "^1.0.1", 1373 | "xsalsa20": "^1.0.0" 1374 | }, 1375 | "dependencies": { 1376 | "nanoassert": { 1377 | "version": "2.0.0", 1378 | "resolved": "https://registry.npmjs.org/nanoassert/-/nanoassert-2.0.0.tgz", 1379 | "integrity": "sha512-7vO7n28+aYO4J+8w96AzhmU8G+Y/xpPDJz/se19ICsqj/momRbb9mh9ZUtkoJ5X3nTnPdhEJyc0qnM6yAsHBaA==" 1380 | } 1381 | } 1382 | }, 1383 | "sodium-native": { 1384 | "version": "3.2.0", 1385 | "resolved": "https://registry.npmjs.org/sodium-native/-/sodium-native-3.2.0.tgz", 1386 | "integrity": "sha512-8aq/vQSegLwsRch8Sb/Bpf9aAqlNe5dp0+NVhb9UjHv42zDZ0D5zX3wBRUbXK9Ejum9uZE6DUgT4vVLlUFRBWg==", 1387 | "requires": { 1388 | "ini": "^1.3.5", 1389 | "node-gyp-build": "^4.2.0" 1390 | } 1391 | }, 1392 | "sodium-universal": { 1393 | "version": "3.0.2", 1394 | "resolved": "https://registry.npmjs.org/sodium-universal/-/sodium-universal-3.0.2.tgz", 1395 | "integrity": "sha512-K/KepORKL1fjAY68z/l9sqgxnEXZ0KCTo+qfMM1m6LkGDnhdEdZiZsf7DcUZYWeZe0/uGOC2fweWusPD7vSj8A==", 1396 | "requires": { 1397 | "blake2b": "^2.1.1", 1398 | "chacha20-universal": "^1.0.4", 1399 | "nanoassert": "^2.0.0", 1400 | "resolve": "^1.17.0", 1401 | "sha256-universal": "^1.0.1", 1402 | "sha512-universal": "^1.0.1", 1403 | "siphash24": "^1.0.1", 1404 | "sodium-javascript": "~0.6.2", 1405 | "sodium-native": "^3.2.0", 1406 | "xsalsa20": "^1.0.0" 1407 | }, 1408 | "dependencies": { 1409 | "nanoassert": { 1410 | "version": "2.0.0", 1411 | "resolved": "https://registry.npmjs.org/nanoassert/-/nanoassert-2.0.0.tgz", 1412 | "integrity": "sha512-7vO7n28+aYO4J+8w96AzhmU8G+Y/xpPDJz/se19ICsqj/momRbb9mh9ZUtkoJ5X3nTnPdhEJyc0qnM6yAsHBaA==" 1413 | } 1414 | } 1415 | }, 1416 | "sparse-bitfield": { 1417 | "version": "3.0.3", 1418 | "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", 1419 | "integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=", 1420 | "requires": { 1421 | "memory-pager": "^1.0.2" 1422 | } 1423 | }, 1424 | "statuses": { 1425 | "version": "1.5.0", 1426 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", 1427 | "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" 1428 | }, 1429 | "stream-collector": { 1430 | "version": "1.0.1", 1431 | "resolved": "https://registry.npmjs.org/stream-collector/-/stream-collector-1.0.1.tgz", 1432 | "integrity": "sha1-TU5V8XE1YSGyxfZVn5RHBaso2xU=", 1433 | "requires": { 1434 | "once": "^1.3.1" 1435 | } 1436 | }, 1437 | "stream-shift": { 1438 | "version": "1.0.1", 1439 | "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", 1440 | "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==" 1441 | }, 1442 | "streamx": { 1443 | "version": "2.7.0", 1444 | "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.7.0.tgz", 1445 | "integrity": "sha512-IZKrxBttcIFPfivBLerTrik1WiuhJONmcbVTEj3nArchrZcLQih4hILQiAZnGlyVPhP901i5Pz5t09JF8atltA==", 1446 | "requires": { 1447 | "fast-fifo": "^1.0.0", 1448 | "nanoassert": "^2.0.0" 1449 | }, 1450 | "dependencies": { 1451 | "nanoassert": { 1452 | "version": "2.0.0", 1453 | "resolved": "https://registry.npmjs.org/nanoassert/-/nanoassert-2.0.0.tgz", 1454 | "integrity": "sha512-7vO7n28+aYO4J+8w96AzhmU8G+Y/xpPDJz/se19ICsqj/momRbb9mh9ZUtkoJ5X3nTnPdhEJyc0qnM6yAsHBaA==" 1455 | } 1456 | } 1457 | }, 1458 | "string_decoder": { 1459 | "version": "0.10.31", 1460 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", 1461 | "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" 1462 | }, 1463 | "thunky": { 1464 | "version": "1.1.0", 1465 | "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", 1466 | "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==" 1467 | }, 1468 | "thunky-map": { 1469 | "version": "1.0.1", 1470 | "resolved": "https://registry.npmjs.org/thunky-map/-/thunky-map-1.0.1.tgz", 1471 | "integrity": "sha512-RC34aHdxC9CYpvuO1TLBnsFa2G9KWFvUbbIbYnqX3hWdUfECWUzjDmv1XRgjRsQ9oGVmUZC+pOD4fAUWB6HU4Q==" 1472 | }, 1473 | "time-ordered-set": { 1474 | "version": "1.0.2", 1475 | "resolved": "https://registry.npmjs.org/time-ordered-set/-/time-ordered-set-1.0.2.tgz", 1476 | "integrity": "sha512-vGO99JkxvgX+u+LtOKQEpYf31Kj3i/GNwVstfnh4dyINakMgeZCpew1e3Aj+06hEslhtHEd52g7m5IV+o1K8Mw==" 1477 | }, 1478 | "timeout-refresh": { 1479 | "version": "1.0.2", 1480 | "resolved": "https://registry.npmjs.org/timeout-refresh/-/timeout-refresh-1.0.2.tgz", 1481 | "integrity": "sha512-lsO23gD/EeW53AvEoTOleUFqTIapZTu5NPzD6ndUGs0+G1IuN0+hu2kT6I3AmNX2fiOrcC6umtzMEv1XQmajgQ==" 1482 | }, 1483 | "toidentifier": { 1484 | "version": "1.0.0", 1485 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", 1486 | "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" 1487 | }, 1488 | "type-is": { 1489 | "version": "1.6.18", 1490 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 1491 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 1492 | "requires": { 1493 | "media-typer": "0.3.0", 1494 | "mime-types": "~2.1.24" 1495 | } 1496 | }, 1497 | "uint64be": { 1498 | "version": "2.0.2", 1499 | "resolved": "https://registry.npmjs.org/uint64be/-/uint64be-2.0.2.tgz", 1500 | "integrity": "sha512-9QqdvpGQTXgxthP+lY4e/gIBy+RuqcBaC6JVwT5I3bDLgT/btL6twZMR0pI3/Fgah9G/pdwzIprE5gL6v9UvyQ==", 1501 | "requires": { 1502 | "buffer-alloc": "^1.1.0" 1503 | } 1504 | }, 1505 | "unixify": { 1506 | "version": "1.0.0", 1507 | "resolved": "https://registry.npmjs.org/unixify/-/unixify-1.0.0.tgz", 1508 | "integrity": "sha1-OmQcjC/7zk2mg6XHDwOkYpQMIJA=", 1509 | "requires": { 1510 | "normalize-path": "^2.1.1" 1511 | } 1512 | }, 1513 | "unordered-array-remove": { 1514 | "version": "1.0.2", 1515 | "resolved": "https://registry.npmjs.org/unordered-array-remove/-/unordered-array-remove-1.0.2.tgz", 1516 | "integrity": "sha1-xUbo+I4xegzyZEyX7LV9umbSUO8=" 1517 | }, 1518 | "unordered-set": { 1519 | "version": "2.0.1", 1520 | "resolved": "https://registry.npmjs.org/unordered-set/-/unordered-set-2.0.1.tgz", 1521 | "integrity": "sha512-eUmNTPzdx+q/WvOHW0bgGYLWvWHNT3PTKEQLg0MAQhc0AHASHVHoP/9YytYd4RBVariqno/mEUhVZN98CmD7bg==" 1522 | }, 1523 | "unpipe": { 1524 | "version": "1.0.0", 1525 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 1526 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" 1527 | }, 1528 | "util-deprecate": { 1529 | "version": "1.0.2", 1530 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 1531 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 1532 | }, 1533 | "utils-merge": { 1534 | "version": "1.0.1", 1535 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 1536 | "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" 1537 | }, 1538 | "varint": { 1539 | "version": "5.0.0", 1540 | "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.0.tgz", 1541 | "integrity": "sha1-2Ca4n3SQcy+rwMDtaT7Uddyynr8=" 1542 | }, 1543 | "vary": { 1544 | "version": "1.1.2", 1545 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 1546 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" 1547 | }, 1548 | "wrappy": { 1549 | "version": "1.0.2", 1550 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1551 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" 1552 | }, 1553 | "xsalsa20": { 1554 | "version": "1.1.0", 1555 | "resolved": "https://registry.npmjs.org/xsalsa20/-/xsalsa20-1.1.0.tgz", 1556 | "integrity": "sha512-zd3ytX2cm+tcSndRU+krm0eL4TMMpZE7evs5hLRAoOy6gviqLfe3qOlkjF3i5SeAkQUCeJk0lJZrEU56kHRfWw==" 1557 | }, 1558 | "xsalsa20-universal": { 1559 | "version": "1.0.0", 1560 | "resolved": "https://registry.npmjs.org/xsalsa20-universal/-/xsalsa20-universal-1.0.0.tgz", 1561 | "integrity": "sha512-0M/X61wiKKAGAMqsxEyJ0kY6NtjpcMiKinYSSsl4K7ypgvqXDTMwQK6hxnYE1s1Jm7h6YKcN8obDUg2CC+jVGA==", 1562 | "requires": { 1563 | "sodium-native": "^3.0.1", 1564 | "xsalsa20": "^1.1.0" 1565 | } 1566 | } 1567 | } 1568 | } 1569 | -------------------------------------------------------------------------------- /server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "assassin_server", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "server.js", 6 | "dependencies": { 7 | "body-parser": "^1.19.0", 8 | "cors": "^2.8.5", 9 | "express": "^4.17.1", 10 | "hyperdrive": "^10.17.2" 11 | }, 12 | "devDependencies": {}, 13 | "scripts": { 14 | "test": "echo \"Error: no test specified\" && exit 1", 15 | "start": "node server.js" 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "git+https://github.com/genderev/assassin_server.git" 20 | }, 21 | "author": "", 22 | "license": "ISC", 23 | "bugs": { 24 | "url": "https://github.com/genderev/assassin_server/issues" 25 | }, 26 | "homepage": "https://github.com/genderev/assassin_server#readme" 27 | } 28 | -------------------------------------------------------------------------------- /server/server.js: -------------------------------------------------------------------------------- 1 | var express = require('express') 2 | var cors = require('cors') 3 | var app = express() 4 | var hyperdrive = require('hyperdrive') 5 | var drive = hyperdrive('./sync') 6 | var bodyParser = require('body-parser') 7 | var path = require('path') 8 | app.use(cors()) 9 | app.use(bodyParser.text()); 10 | 11 | 12 | drive.writeFile('/data.txt', JSON.stringify({Thanks:"Visit gitter.im/assassindb for help!"}), function (err) { 13 | if (err) {throw err} 14 | }) 15 | 16 | 17 | app.get('/', function (req, res) { 18 | res.sendFile(path.join(__dirname+'/index.html')); 19 | }) 20 | 21 | 22 | app.post('/', function (req, res) { 23 | drive.readFile('/data.txt', 'utf-8', function (err, data) { 24 | res.send(data) 25 | }) 26 | 27 | }) 28 | 29 | app.post('/write', function (req, res) { 30 | var writing = req.body; 31 | drive.unlink('/data.txt'); 32 | drive.writeFile('/data.txt', writing, function (err) { 33 | if (err) throw err 34 | }) 35 | 36 | }) 37 | 38 | app.listen(8080) 39 | --------------------------------------------------------------------------------