From 1055f6868271150e0984845857f43367d57680be Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Sun, 12 Aug 2018 20:19:40 -0700 Subject: [PATCH 01/28] dep: add pouchdb --- packages/gnarly-core/package.json | 1 + yarn.lock | 403 ++++++++++++++++++++++++++++-- 2 files changed, 386 insertions(+), 18 deletions(-) diff --git a/packages/gnarly-core/package.json b/packages/gnarly-core/package.json index 9d38fb2..fa6e4c7 100644 --- a/packages/gnarly-core/package.json +++ b/packages/gnarly-core/package.json @@ -41,6 +41,7 @@ "p-queue": "^2.4.2", "p-retry": "^2.0.0", "pg": "^7.4.1", + "pouchdb": "^7.0.0", "sequelize": "^4.35.2", "uuid": "^3.2.1", "web3-eth-abi": "^1.0.0-beta.34", diff --git a/yarn.lock b/yarn.lock index 9b40a1f..298fbd1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -649,6 +649,18 @@ abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" +abstract-leveldown@^4.0.0, abstract-leveldown@~4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-4.0.3.tgz#cb636f4965fbe117f5c8b76a7d51dd42aaed0580" + dependencies: + xtend "~4.0.0" + +abstract-leveldown@~5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz#f7128e1f86ccabf7d2893077ce5d06d798e386c6" + dependencies: + xtend "~4.0.0" + accepts@~1.3.5: version "1.3.5" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" @@ -770,6 +782,10 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +argsarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/argsarray/-/argsarray-0.0.1.tgz#6e7207b4ecdb39b0af88303fa5ae22bda8df61cb" + arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" @@ -917,6 +933,17 @@ binary-extensions@^1.0.0: version "1.11.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" +bindings@~1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7" + +bl@^1.0.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c" + dependencies: + readable-stream "^2.3.5" + safe-buffer "^5.1.1" + block-stream@*: version "0.0.9" resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" @@ -1020,10 +1047,29 @@ browserify-sha3@^0.0.1: dependencies: js-sha3 "^0.3.1" +buffer-alloc-unsafe@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" + +buffer-alloc@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" + dependencies: + buffer-alloc-unsafe "^1.1.0" + buffer-fill "^1.0.0" + buffer-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-1.0.0.tgz#59616b498304d556abd466966b22eeda3eca5fbe" +buffer-fill@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" + +buffer-from@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.0.tgz#87fcaa3a298358e0ade6e442cfce840740d1ad04" + buffer-from@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.0.0.tgz#4cb8832d23612589b0406e9e2956c17f06fdf531" @@ -1252,7 +1298,7 @@ cliui@^4.0.0: strip-ansi "^4.0.0" wrap-ansi "^2.0.0" -clone-buffer@^1.0.0: +clone-buffer@1.0.0, clone-buffer@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" @@ -1691,6 +1737,19 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" +deferred-leveldown@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-3.0.0.tgz#bff7241bf156aa3635f520bedf34330c408d3307" + dependencies: + abstract-leveldown "~4.0.0" + +deferred-leveldown@~4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz#0b0570087827bf480a23494b398f04c128c19a20" + dependencies: + abstract-leveldown "~5.0.0" + inherits "^2.0.3" + define-properties@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" @@ -1741,7 +1800,7 @@ detect-indent@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" -detect-libc@^1.0.2: +detect-libc@^1.0.2, detect-libc@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" @@ -1787,6 +1846,10 @@ dottie@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/dottie/-/dottie-2.0.0.tgz#da191981c8b8d713ca0115d5898cf397c2f0ddd0" +double-ended-queue@2.1.0-0: + version "2.1.0-0" + resolved "https://registry.yarnpkg.com/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz#103d3527fd31528f40188130c841efdd78264e5c" + duplexer3@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" @@ -1830,6 +1893,15 @@ encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" +encoding-down@~4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/encoding-down/-/encoding-down-4.0.1.tgz#15a544eb13d7feeabc9e6f433633d6c966f077c9" + dependencies: + abstract-leveldown "^4.0.0" + level-codec "^8.0.0" + level-errors "^1.0.4" + xtend "^4.0.1" + encoding@^0.1.11: version "0.1.12" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" @@ -1842,12 +1914,28 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: dependencies: once "^1.4.0" +end-stream@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/end-stream/-/end-stream-0.1.0.tgz#32003f3f438a2b0143168137f8fa6e9866c81ed5" + dependencies: + write-stream "~0.4.3" + +errno@~0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" + dependencies: + prr "~1.0.1" + error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" dependencies: is-arrayish "^0.2.1" +es6-denodeify@^0.1.1: + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-denodeify/-/es6-denodeify-0.1.5.tgz#31d4d5fe9c5503e125460439310e16a2a3f39c1f" + escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" @@ -1966,6 +2054,10 @@ expand-template@1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-1.0.3.tgz#6c303323177a62b1b22c070279f7861287b69b1a" +expand-template@^1.0.2: + version "1.1.1" + resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-1.1.1.tgz#981f188c0c3a87d2e28f559bc541426ff94f21dd" + express@^4.14.0: version "4.16.3" resolved "https://registry.yarnpkg.com/express/-/express-4.16.3.tgz#6af8a502350db3246ecc4becf6b5a34d22f7ed53" @@ -2059,6 +2151,10 @@ fast-equals@^1.5.3: version "1.5.3" resolved "https://registry.yarnpkg.com/fast-equals/-/fast-equals-1.5.3.tgz#22087aee55a87d440b881445f19424a2f4f4282e" +fast-future@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/fast-future/-/fast-future-1.0.2.tgz#8435a9aaa02d79248d17d704e76259301d99280a" + fast-glob@^2.0.2: version "2.2.2" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.2.tgz#71723338ac9b4e0e2fff1d6748a2a13d5ed352bf" @@ -2082,6 +2178,13 @@ fast-stringify@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/fast-stringify/-/fast-stringify-1.0.4.tgz#7279707663aea3efbed1d9f5da36d7adbeadf5b6" +fetch-cookie@0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/fetch-cookie/-/fetch-cookie-0.7.0.tgz#a6fc137ad8363aa89125864c6451b86ecb7de802" + dependencies: + es6-denodeify "^0.1.1" + tough-cookie "^2.3.1" + figures@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" @@ -2202,6 +2305,10 @@ from@~0: version "0.1.7" resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" +fs-constants@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" + fs-extra@4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.1.tgz#7fc0c6c8957f983f57f306a24e5b9ddd8d0dd880" @@ -2342,6 +2449,10 @@ gitconfiglocal@^1.0.0: dependencies: ini "^1.3.2" +github-from-package@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce" + glob-parent@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" @@ -2655,6 +2766,10 @@ ignore@^3.3.5: version "3.3.10" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" +immediate@3.0.6: + version "3.0.6" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" + immutable@3.8.2: version "3.8.2" resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.2.tgz#c2439951455bb39913daf281376f1530e104adf3" @@ -2699,7 +2814,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.3: +inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" @@ -2988,6 +3103,10 @@ is-windows@^1.0.1, is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + isarray@1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -3228,6 +3347,93 @@ lerna@^3.0.3: import-local "^1.0.0" npmlog "^4.1.2" +level-codec@7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-7.0.1.tgz#341f22f907ce0f16763f24bddd681e395a0fb8a7" + +level-codec@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-8.0.0.tgz#3a4a0de06dae20c2f5a57b3372c7651e67083e03" + +level-errors@^1.0.4, level-errors@~1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-1.1.2.tgz#4399c2f3d3ab87d0625f7e3676e2d807deff404d" + dependencies: + errno "~0.1.1" + +level-errors@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-2.0.0.tgz#2de5b566b62eef92f99e19be74397fbc512563fa" + dependencies: + errno "~0.1.1" + +level-iterator-stream@~2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-2.0.3.tgz#ccfff7c046dcf47955ae9a86f46dfa06a31688b4" + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.5" + xtend "^4.0.0" + +level-packager@^2.0.2: + version "2.1.1" + resolved "https://registry.yarnpkg.com/level-packager/-/level-packager-2.1.1.tgz#10b653decb67b0a09c4e961ae84f196edaad205a" + dependencies: + encoding-down "~4.0.0" + levelup "^2.0.0" + +level-write-stream@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/level-write-stream/-/level-write-stream-1.0.0.tgz#3f7fbb679a55137c0feb303dee766e12ee13c1dc" + dependencies: + end-stream "~0.1.0" + +level@3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/level/-/level-3.0.2.tgz#83c3d6e48c9e89abc4b6f5ca1c591f177ea2bd59" + dependencies: + level-packager "^2.0.2" + leveldown "^3.0.0" + opencollective-postinstall "^2.0.0" + +leveldown@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/leveldown/-/leveldown-3.0.0.tgz#a42ef5d4029f88ba538ed8da3e6c34c5b008ddd7" + dependencies: + abstract-leveldown "~4.0.0" + bindings "~1.3.0" + fast-future "~1.0.2" + nan "~2.8.0" + prebuild-install "^2.1.0" + +leveldown@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/leveldown/-/leveldown-3.0.2.tgz#d1fb708991c54c874ca1b0688644a25d926e6302" + dependencies: + abstract-leveldown "~4.0.0" + bindings "~1.3.0" + fast-future "~1.0.2" + nan "~2.10.0" + prebuild-install "^4.0.0" + +levelup@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/levelup/-/levelup-3.0.1.tgz#07794639fd0af185089130aaea09d03023637b8d" + dependencies: + deferred-leveldown "~4.0.0" + level-errors "~2.0.0" + level-iterator-stream "~2.0.0" + xtend "~4.0.0" + +levelup@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/levelup/-/levelup-2.0.2.tgz#83dd22ffd5ee14482143c37cddfb8457854d3727" + dependencies: + deferred-leveldown "~3.0.0" + level-errors "~1.1.0" + level-iterator-stream "~2.0.0" + xtend "~4.0.0" + levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" @@ -3329,6 +3535,10 @@ lru-cache@^4.0.1: pseudomap "^1.0.2" yallist "^2.1.2" +ltgt@2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5" + make-dir@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.2.0.tgz#6d6a49eead4aae296c53bbf3a1a008bd6c89469b" @@ -3629,10 +3839,14 @@ mute-stream@0.0.7, mute-stream@~0.0.4: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" -nan@2.10.0, nan@^2.9.2: +nan@2.10.0, nan@^2.9.2, nan@~2.10.0: version "2.10.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" +nan@~2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.8.0.tgz#ed715f3fe9de02b57a5e6252d90a96675e1f085a" + nano-json-stream-parser@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" @@ -3670,6 +3884,12 @@ nice-try@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.4.tgz#d93962f6c52f2c1558c0fbda6d512819f1efe1c4" +node-abi@^2.2.0: + version "2.4.3" + resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-2.4.3.tgz#43666b7b17e57863e572409edbb82115ac7af28b" + dependencies: + semver "^5.4.1" + node-fetch@^1.0.1: version "1.7.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" @@ -3677,6 +3897,10 @@ node-fetch@^1.0.1: encoding "^0.1.11" is-stream "^1.0.1" +node-fetch@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.2.0.tgz#4ee79bde909262f9775f731e3656d0db55ced5b5" + node-gyp@^3.6.2: version "3.8.0" resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.8.0.tgz#540304261c330e80d0d5edce253a68cb3964218c" @@ -3724,6 +3948,10 @@ nodemon@^1.14.12: undefsafe "^2.0.2" update-notifier "^2.3.0" +noop-logger@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/noop-logger/-/noop-logger-0.1.1.tgz#94a2b1633c4f1317553007d8966fd0e841b6a4c2" + "nopt@2 || 3": version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" @@ -3803,7 +4031,7 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" -"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.2, npmlog@^4.1.2: +"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.1, npmlog@^4.0.2, npmlog@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" dependencies: @@ -3918,6 +4146,10 @@ onetime@^2.0.0: dependencies: mimic-fn "^1.0.0" +opencollective-postinstall@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.0.tgz#5fe062f2706bb84150f7fb1af9f1277e46ec1388" + optimist@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" @@ -4265,6 +4497,70 @@ postgres-interval@^1.1.0: dependencies: xtend "^4.0.0" +pouchdb@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pouchdb/-/pouchdb-7.0.0.tgz#e95df9ef87127d0ea90222d073794bcb47c38648" + dependencies: + argsarray "0.0.1" + buffer-from "1.1.0" + clone-buffer "1.0.0" + double-ended-queue "2.1.0-0" + fetch-cookie "0.7.0" + immediate "3.0.6" + inherits "2.0.3" + level "3.0.2" + level-codec "7.0.1" + level-write-stream "1.0.0" + leveldown "3.0.0" + levelup "3.0.1" + ltgt "2.2.1" + node-fetch "^2.0.0" + readable-stream "1.0.33" + spark-md5 "3.0.0" + through2 "2.0.3" + uuid "3.2.1" + vuvuzela "1.0.3" + +prebuild-install@^2.1.0: + version "2.5.3" + resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-2.5.3.tgz#9f65f242782d370296353710e9bc843490c19f69" + dependencies: + detect-libc "^1.0.3" + expand-template "^1.0.2" + github-from-package "0.0.0" + minimist "^1.2.0" + mkdirp "^0.5.1" + node-abi "^2.2.0" + noop-logger "^0.1.1" + npmlog "^4.0.1" + os-homedir "^1.0.1" + pump "^2.0.1" + rc "^1.1.6" + simple-get "^2.7.0" + tar-fs "^1.13.0" + tunnel-agent "^0.6.0" + which-pm-runs "^1.0.0" + +prebuild-install@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-4.0.0.tgz#206ce8106ce5efa4b6cf062fc8a0a7d93c17f3a8" + dependencies: + detect-libc "^1.0.3" + expand-template "^1.0.2" + github-from-package "0.0.0" + minimist "^1.2.0" + mkdirp "^0.5.1" + node-abi "^2.2.0" + noop-logger "^0.1.1" + npmlog "^4.0.1" + os-homedir "^1.0.1" + pump "^2.0.1" + rc "^1.1.6" + simple-get "^2.7.0" + tar-fs "^1.13.0" + tunnel-agent "^0.6.0" + which-pm-runs "^1.0.0" + prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" @@ -4302,6 +4598,10 @@ proxy-addr@~2.0.3: forwarded "~0.1.2" ipaddr.js "1.6.0" +prr@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + ps-tree@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.1.0.tgz#b421b24140d6203f1ed3c76996b4427b08e8c014" @@ -4322,7 +4622,14 @@ pstree.remy@^1.1.0: dependencies: ps-tree "^1.1.0" -pump@^2.0.0: +pump@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/pump/-/pump-1.0.3.tgz#5dfe8311c33bbf6fc18261f9f34702c47c08a954" + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pump@^2.0.0, pump@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" dependencies: @@ -4458,7 +4765,16 @@ read@1, read@~1.0.1: dependencies: mute-stream "~0.0.4" -readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.5: +readable-stream@1.0.33: + version "1.0.33" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.33.tgz#3a360dd66c1b1d7fd4705389860eda1d0f61126c" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.3, readable-stream@^2.3.5: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" dependencies: @@ -4470,6 +4786,10 @@ readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable string_decoder "~1.1.1" util-deprecate "~1.0.1" +readable-stream@~0.0.2: + version "0.0.4" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-0.0.4.tgz#f32d76e3fb863344a548d79923007173665b3b8d" + readdir-scoped-modules@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz#9fafa37d286be5d92cbaebdee030dc9b5f406747" @@ -4803,7 +5123,7 @@ semver-diff@^2.0.0: dependencies: semver "^5.0.3" -"semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.5.0: +"semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0: version "5.5.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" @@ -5052,6 +5372,10 @@ source-map@~0.2.0: dependencies: amdefine ">=0.0.4" +spark-md5@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spark-md5/-/spark-md5-3.0.0.tgz#3722227c54e2faf24b1dc6d933cc144e6f71bfef" + spawn-command@^0.0.2-1: version "0.0.2-1" resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" @@ -5181,6 +5505,10 @@ string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" @@ -5289,6 +5617,27 @@ symbol-observable@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4" +tar-fs@^1.13.0: + version "1.16.3" + resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-1.16.3.tgz#966a628841da2c4010406a82167cbd5e0c72d509" + dependencies: + chownr "^1.0.1" + mkdirp "^0.5.1" + pump "^1.0.0" + tar-stream "^1.1.2" + +tar-stream@^1.1.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.1.tgz#f84ef1696269d6223ca48f6e1eeede3f7e81f395" + dependencies: + bl "^1.0.0" + buffer-alloc "^1.1.0" + end-of-stream "^1.0.0" + fs-constants "^1.0.0" + readable-stream "^2.3.0" + to-buffer "^1.1.0" + xtend "^4.0.0" + tar@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" @@ -5367,7 +5716,7 @@ through2-filter@^2.0.0: through2 "~2.0.0" xtend "~4.0.0" -through2@^2.0.0, through2@^2.0.2, through2@^2.0.3, through2@~2.0.0: +through2@2.0.3, through2@^2.0.0, through2@^2.0.2, through2@^2.0.3, through2@~2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" dependencies: @@ -5395,6 +5744,10 @@ to-absolute-glob@^2.0.0: is-absolute "^1.0.0" is-negated-glob "^1.0.0" +to-buffer@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" + to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" @@ -5437,19 +5790,19 @@ touch@^3.1.0: dependencies: nopt "~1.0.10" -tough-cookie@~2.3.0, tough-cookie@~2.3.3: - version "2.3.4" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" - dependencies: - punycode "^1.4.1" - -tough-cookie@~2.4.3: +tough-cookie@^2.3.1, tough-cookie@~2.4.3: version "2.4.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" dependencies: psl "^1.1.24" punycode "^1.4.1" +tough-cookie@~2.3.0, tough-cookie@~2.3.3: + version "2.3.4" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" + dependencies: + punycode "^1.4.1" + tree-kill@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.0.tgz#5846786237b4239014f05db156b643212d4c6f36" @@ -5696,7 +6049,7 @@ uuid@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" -uuid@^3.0.0, uuid@^3.0.1, uuid@^3.1.0, uuid@^3.2.1: +uuid@3.2.1, uuid@^3.0.0, uuid@^3.0.1, uuid@^3.1.0, uuid@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14" @@ -5789,6 +6142,10 @@ vinyl@^2.0.0, vinyl@^2.1.0: remove-trailing-separator "^1.0.1" replace-ext "^1.0.0" +vuvuzela@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/vuvuzela/-/vuvuzela-1.0.3.tgz#3be145e58271c73ca55279dd851f12a682114b0b" + wcwidth@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" @@ -5839,6 +6196,10 @@ which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" +which-pm-runs@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb" + which@1, which@^1.3.0: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" @@ -5930,6 +6291,12 @@ write-pkg@^3.1.0: sort-keys "^2.0.0" write-json-file "^2.2.0" +write-stream@~0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/write-stream/-/write-stream-0.4.3.tgz#83cc8c0347d0af6057a93862b4e3ae01de5c81c1" + dependencies: + readable-stream "~0.0.2" + ws@^3.0.0: version "3.3.3" resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" @@ -5973,7 +6340,7 @@ xregexp@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-4.0.0.tgz#e698189de49dd2a18cc5687b05e17c8e43943020" -xtend@^4.0.0, xtend@~4.0.0, xtend@~4.0.1: +xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.0, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" From 63c3c65086ca212940b1346c2b115b2f6362dc79 Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Sun, 12 Aug 2018 22:14:54 -0700 Subject: [PATCH 02/28] checkpoint: beginnings of pouchdb persist interface --- packages/gnarly-core/package.json | 5 + packages/gnarly-core/src/stores/pouchdb.ts | 132 ++++++++++ packages/gnarly-core/src/stores/sequelize.ts | 4 +- yarn.lock | 240 ++++++++++++++++++- 4 files changed, 377 insertions(+), 4 deletions(-) create mode 100644 packages/gnarly-core/src/stores/pouchdb.ts diff --git a/packages/gnarly-core/package.json b/packages/gnarly-core/package.json index fa6e4c7..bc0bdcb 100644 --- a/packages/gnarly-core/package.json +++ b/packages/gnarly-core/package.json @@ -42,6 +42,8 @@ "p-retry": "^2.0.0", "pg": "^7.4.1", "pouchdb": "^7.0.0", + "pouchdb-find": "^7.0.0", + "pouchdb-upsert": "^2.2.0", "sequelize": "^4.35.2", "uuid": "^3.2.1", "web3-eth-abi": "^1.0.0-beta.34", @@ -53,6 +55,9 @@ "@types/lodash.identity": "^3.0.3", "@types/lodash.isplainobject": "^4.0.3", "@types/node": "^10.5.7", + "@types/pouchdb": "^6.3.2", + "@types/pouchdb-find": "^6.3.3", + "@types/pouchdb-upsert": "^2.2.3", "bn-chai": "^1.0.1", "chai": "^4.1.2", "chai-spies": "^1.0.0", diff --git a/packages/gnarly-core/src/stores/pouchdb.ts b/packages/gnarly-core/src/stores/pouchdb.ts new file mode 100644 index 0000000..78c8548 --- /dev/null +++ b/packages/gnarly-core/src/stores/pouchdb.ts @@ -0,0 +1,132 @@ +import PouchDB = require('pouchdb') +PouchDB.plugin(require('pouchdb-upsert')) +PouchDB.plugin(require('pouchdb-find')) + +import { IJSONBlock } from '../models/Block' +import { + ITransaction, +} from '../ourbit/types' +import { IPersistInterface } from '../stores' +import { toBN } from '../utils' + +const sortByHexProp = (prop: string) => (a, b) => toBN(a[prop]).sub(toBN(b[prop])).toNumber() +const toJSONBlock = (block) => block as IJSONBlock + +const deleteWithQuery = async (db, selector) => { + const res = await db.find({ selector }) + await db.bulkDocs(res.docs.map((d) => ({ ...d, _deleted: true }))) +} + +// // https://pouchdb.com/api.html#batch_fetch +// const prefix = (p: string) => ({ +// startkey: `${p}`, +// endkey: `${p}\ufff0`, +// }) + +// jsonpatch path is _id? +// pouchdb relies heavily on unique identifiers that operate as the primary index +// so our use of `mid` in postgres will complement this nicely + +const reducerDb = (e) => `${e}/gnarly-reducers` +const historicalBlocksDb = (e) => `${e}/gnarly-historical-blocks` +const transactionsDb = (e) => `${e}/gnarly-transactions` + +export default class PouchDBPersistInterface implements IPersistInterface { + + private reducers: PouchDB.Database + private historicalBlocks: PouchDB.Database + private transactions: PouchDB.Database + + constructor ( + dbEndpoint: string, + ) { + try { + this.reducers = new PouchDB(reducerDb(dbEndpoint)) + this.historicalBlocks = new PouchDB(historicalBlocksDb(dbEndpoint)) + this.transactions = new PouchDB(transactionsDb(dbEndpoint)) + } catch (error) { + throw new Error(`Instantiating PouchDBs failed: ${error.stack}`) + } + } + + // reducer CRUD + public saveReducer = async (reducerKey: string): Promise => { + await this.reducers.putIfNotExists({ _id: reducerKey }) + } + public deleteReducer = async (reducerKey: string): Promise => { + await this.reducers.remove(await this.reducers.get(reducerKey)) + } + + // blockstream CRUD + public getHistoricalBlocks = async (reducerKey: string): Promise => { + const res = await this.historicalBlocks.find({ + selector: { + reducerKey: { $eq: reducerKey }, + }, + }) + + return res.docs.map(toJSONBlock).sort(sortByHexProp('number')) + } + + public saveHistoricalBlock = async (reducerKey: string, blockRetention: number, block: IJSONBlock): Promise => { + await this.historicalBlocks.putIfNotExists({ + _id: block.hash, + ...block, + reducerKey, + }) + + // @TODO (shrugs) - delete blocks after blockRetention for this reducer + } + + public deleteHistoricalBlock = async (reducerKey: string, blockHash: string): Promise => { + await deleteWithQuery(this.historicalBlocks, { + _id: { $eq: blockHash }, + reducerKey: { $eq: reducerKey }, + }) + } + + public deleteHistoricalBlocks = async (reducerKey: string): Promise => { + await deleteWithQuery(this.historicalBlocks, { + reducerKey: { $eq: reducerKey }, + }) + } + + // transaction CRUD + public getAllTransactionsTo = async (reducerKey: string, toTxId: null | string): Promise => { + // + } + public getLatestTransaction = async (reducerKey: string): Promise => { + // + } + public deleteTransaction = async (reducerKey: string, tx: ITransaction): Promise => { + // + } + public saveTransaction = async (reducerKey: string, tx: ITransaction): Promise => { + // + } + public getTransaction = async (reducerKey: string, txId: string): Promise => { + // + } + public getTransactionByBlockHash = async (reducerKey: string, blockHash: string): Promise => { + // + } + + // setup & setdown + public setup = async (): Promise => { + // implicitely create database if not exists + await this.reducers.info() + await this.historicalBlocks.info() + await this.transactions.info() + + // index historical blocks on reducerKeys + this.historicalBlocks.createIndex({ + index: { fields: ['reducerKey'] }, + }) + } + + public setdown = async (): Promise => { + await this.reducers.destroy() + await this.historicalBlocks.destroy() + await this.transactions.destroy() + } +} diff --git a/packages/gnarly-core/src/stores/sequelize.ts b/packages/gnarly-core/src/stores/sequelize.ts index 2b66252..016e980 100644 --- a/packages/gnarly-core/src/stores/sequelize.ts +++ b/packages/gnarly-core/src/stores/sequelize.ts @@ -126,7 +126,7 @@ async function* batch ( } } -class SequelizePersistInterface implements IPersistInterface { +export default class SequelizePersistInterface implements IPersistInterface { private Reducer private HistoricalBlock private Transaction @@ -381,5 +381,3 @@ class SequelizePersistInterface implements IPersistInterface { } } } - -export default SequelizePersistInterface diff --git a/yarn.lock b/yarn.lock index 298fbd1..e0a7b5a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -590,6 +590,10 @@ version "4.1.4" resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.1.4.tgz#5ca073b330d90b4066d6ce18f60d57f2084ce8ca" +"@types/debug@*": + version "0.0.30" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-0.0.30.tgz#dc1e40f7af3b9c815013a7860e6252f6352a84df" + "@types/geojson@^1.0.0": version "1.0.6" resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-1.0.6.tgz#3e02972728c69248c2af08d60a48cbb8680fffdf" @@ -626,6 +630,134 @@ version "9.6.12" resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.12.tgz#ab2d716505858ebc8ee94b347b5c9d311eb81b72" +"@types/pouchdb-adapter-fruitdown@*": + version "6.1.2" + resolved "https://registry.yarnpkg.com/@types/pouchdb-adapter-fruitdown/-/pouchdb-adapter-fruitdown-6.1.2.tgz#9cd8b8d40f8a50ab1f4ad60fa1646d7cbba4213f" + dependencies: + "@types/pouchdb-core" "*" + +"@types/pouchdb-adapter-http@*": + version "6.1.2" + resolved "https://registry.yarnpkg.com/@types/pouchdb-adapter-http/-/pouchdb-adapter-http-6.1.2.tgz#185c543d49479b12299cba3bce88b4b5abe16b3d" + dependencies: + "@types/pouchdb-core" "*" + +"@types/pouchdb-adapter-idb@*": + version "6.1.2" + resolved "https://registry.yarnpkg.com/@types/pouchdb-adapter-idb/-/pouchdb-adapter-idb-6.1.2.tgz#cef0e8025d02586771558f6b188517e5d65800b8" + dependencies: + "@types/pouchdb-core" "*" + +"@types/pouchdb-adapter-leveldb@*": + version "6.1.2" + resolved "https://registry.yarnpkg.com/@types/pouchdb-adapter-leveldb/-/pouchdb-adapter-leveldb-6.1.2.tgz#94b4949bc7954318451c4da3fc07f6b91004a398" + dependencies: + "@types/pouchdb-core" "*" + +"@types/pouchdb-adapter-localstorage@*": + version "6.1.2" + resolved "https://registry.yarnpkg.com/@types/pouchdb-adapter-localstorage/-/pouchdb-adapter-localstorage-6.1.2.tgz#3156b6e53131816b565a648ffb44cbbc4ae236af" + dependencies: + "@types/pouchdb-core" "*" + +"@types/pouchdb-adapter-memory@*": + version "6.1.2" + resolved "https://registry.yarnpkg.com/@types/pouchdb-adapter-memory/-/pouchdb-adapter-memory-6.1.2.tgz#93eca978b1aa0f96a020b4a92b43efb7e6a70a09" + dependencies: + "@types/pouchdb-core" "*" + +"@types/pouchdb-adapter-node-websql@*": + version "6.1.2" + resolved "https://registry.yarnpkg.com/@types/pouchdb-adapter-node-websql/-/pouchdb-adapter-node-websql-6.1.2.tgz#a0ca40ac19c9c66d9b381f68c90b57bbb3a21fbc" + dependencies: + "@types/pouchdb-adapter-websql" "*" + "@types/pouchdb-core" "*" + +"@types/pouchdb-adapter-websql@*": + version "6.1.2" + resolved "https://registry.yarnpkg.com/@types/pouchdb-adapter-websql/-/pouchdb-adapter-websql-6.1.2.tgz#54ba7ce20dee3426fa13cf2ab3e3d2d143243a95" + dependencies: + "@types/pouchdb-core" "*" + +"@types/pouchdb-browser@*": + version "6.1.2" + resolved "https://registry.yarnpkg.com/@types/pouchdb-browser/-/pouchdb-browser-6.1.2.tgz#57e645318dc90acb6a6620d5a700c41e7ec9cccd" + dependencies: + "@types/pouchdb-adapter-http" "*" + "@types/pouchdb-adapter-idb" "*" + "@types/pouchdb-adapter-websql" "*" + "@types/pouchdb-core" "*" + "@types/pouchdb-mapreduce" "*" + "@types/pouchdb-replication" "*" + +"@types/pouchdb-core@*": + version "6.4.2" + resolved "https://registry.yarnpkg.com/@types/pouchdb-core/-/pouchdb-core-6.4.2.tgz#22dce450e0b1f3c5aa7bbe2bfcb8db579c0be926" + dependencies: + "@types/debug" "*" + "@types/pouchdb-find" "*" + +"@types/pouchdb-find@*", "@types/pouchdb-find@^6.3.3": + version "6.3.3" + resolved "https://registry.yarnpkg.com/@types/pouchdb-find/-/pouchdb-find-6.3.3.tgz#dbad75ba362677d03027ac3e2e5d1361ff296152" + dependencies: + "@types/pouchdb-core" "*" + +"@types/pouchdb-http@*": + version "6.1.2" + resolved "https://registry.yarnpkg.com/@types/pouchdb-http/-/pouchdb-http-6.1.2.tgz#5875290f7cc502c35c015ed62ad2006c9edb8b57" + dependencies: + "@types/pouchdb-adapter-http" "*" + "@types/pouchdb-core" "*" + +"@types/pouchdb-mapreduce@*": + version "6.1.3" + resolved "https://registry.yarnpkg.com/@types/pouchdb-mapreduce/-/pouchdb-mapreduce-6.1.3.tgz#6db81f82567e5cdbf7c9d98a271296206f63b862" + dependencies: + "@types/pouchdb-core" "*" + +"@types/pouchdb-node@*": + version "6.1.2" + resolved "https://registry.yarnpkg.com/@types/pouchdb-node/-/pouchdb-node-6.1.2.tgz#476a98c6b09f17c69a1af173b826cb4b55de17ea" + dependencies: + "@types/pouchdb-adapter-http" "*" + "@types/pouchdb-adapter-leveldb" "*" + "@types/pouchdb-core" "*" + "@types/pouchdb-mapreduce" "*" + "@types/pouchdb-replication" "*" + +"@types/pouchdb-replication@*": + version "6.4.0" + resolved "https://registry.yarnpkg.com/@types/pouchdb-replication/-/pouchdb-replication-6.4.0.tgz#94c54e9a0e22643681958859050a98298be8663a" + dependencies: + "@types/pouchdb-core" "*" + "@types/pouchdb-find" "*" + +"@types/pouchdb-upsert@^2.2.3": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@types/pouchdb-upsert/-/pouchdb-upsert-2.2.3.tgz#73c1e62b0a3120b3848681e4568eef506d0001fc" + dependencies: + "@types/pouchdb-core" "*" + +"@types/pouchdb@^6.3.2": + version "6.3.2" + resolved "https://registry.yarnpkg.com/@types/pouchdb/-/pouchdb-6.3.2.tgz#fa6f70b98c55c7685867887350e44421d5446592" + dependencies: + "@types/pouchdb-adapter-fruitdown" "*" + "@types/pouchdb-adapter-http" "*" + "@types/pouchdb-adapter-idb" "*" + "@types/pouchdb-adapter-leveldb" "*" + "@types/pouchdb-adapter-localstorage" "*" + "@types/pouchdb-adapter-memory" "*" + "@types/pouchdb-adapter-node-websql" "*" + "@types/pouchdb-adapter-websql" "*" + "@types/pouchdb-browser" "*" + "@types/pouchdb-core" "*" + "@types/pouchdb-http" "*" + "@types/pouchdb-mapreduce" "*" + "@types/pouchdb-node" "*" + "@types/pouchdb-replication" "*" + "@types/uuid@^3.4.3": version "3.4.3" resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-3.4.3.tgz#121ace265f5569ce40f4f6d0ff78a338c732a754" @@ -2766,7 +2898,7 @@ ignore@^3.3.5: version "3.3.10" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" -immediate@3.0.6: +immediate@3.0.6, immediate@~3.0.5: version "3.0.6" resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" @@ -3441,6 +3573,12 @@ levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +lie@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" + dependencies: + immediate "~3.0.5" + load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" @@ -4497,6 +4635,106 @@ postgres-interval@^1.1.0: dependencies: xtend "^4.0.0" +pouchdb-abstract-mapreduce@7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pouchdb-abstract-mapreduce/-/pouchdb-abstract-mapreduce-7.0.0.tgz#946d79073c9795ca03c9b5c318a64372422e8740" + dependencies: + pouchdb-binary-utils "7.0.0" + pouchdb-collate "7.0.0" + pouchdb-collections "7.0.0" + pouchdb-errors "7.0.0" + pouchdb-fetch "7.0.0" + pouchdb-mapreduce-utils "7.0.0" + pouchdb-md5 "7.0.0" + pouchdb-utils "7.0.0" + +pouchdb-binary-utils@7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pouchdb-binary-utils/-/pouchdb-binary-utils-7.0.0.tgz#cb71a288b09572a231f6bab1b4aed201c4d219a7" + dependencies: + buffer-from "1.1.0" + +pouchdb-collate@7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pouchdb-collate/-/pouchdb-collate-7.0.0.tgz#4f9a0a03c236f1677a971c400b79b7baf6379a4d" + +pouchdb-collections@7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pouchdb-collections/-/pouchdb-collections-7.0.0.tgz#fd1f632337dc6301b0ff8649732ca79204e41780" + +pouchdb-errors@7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pouchdb-errors/-/pouchdb-errors-7.0.0.tgz#4e2a5a8b82af20cbe5f9970ca90b7ec74563caa0" + dependencies: + inherits "2.0.3" + +pouchdb-fetch@7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pouchdb-fetch/-/pouchdb-fetch-7.0.0.tgz#6b56cc49863837f8d5e38b0956ace03f1fcaf8e0" + dependencies: + fetch-cookie "0.7.0" + node-fetch "^2.0.0" + +pouchdb-find@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pouchdb-find/-/pouchdb-find-7.0.0.tgz#f390c3f7a9455e700eb178eb89b235aaf7dc3beb" + dependencies: + pouchdb-abstract-mapreduce "7.0.0" + pouchdb-collate "7.0.0" + pouchdb-errors "7.0.0" + pouchdb-fetch "7.0.0" + pouchdb-md5 "7.0.0" + pouchdb-selector-core "7.0.0" + pouchdb-utils "7.0.0" + +pouchdb-mapreduce-utils@7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pouchdb-mapreduce-utils/-/pouchdb-mapreduce-utils-7.0.0.tgz#ff342e9d515d4c9cf0b19ad85c78f10f2568493b" + dependencies: + argsarray "0.0.1" + inherits "2.0.3" + pouchdb-collections "7.0.0" + pouchdb-utils "7.0.0" + +pouchdb-md5@7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pouchdb-md5/-/pouchdb-md5-7.0.0.tgz#935dc6bb507a5f3978fb653ca5790331bae67c96" + dependencies: + pouchdb-binary-utils "7.0.0" + spark-md5 "3.0.0" + +pouchdb-promise@^6.1.2: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-promise/-/pouchdb-promise-6.4.3.tgz#74516f4acf74957b54debd0fb2c0e5b5a68ca7b3" + dependencies: + lie "3.1.1" + +pouchdb-selector-core@7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pouchdb-selector-core/-/pouchdb-selector-core-7.0.0.tgz#824bd0980bd9778b3ddef869306a6cdb928df703" + dependencies: + pouchdb-collate "7.0.0" + pouchdb-utils "7.0.0" + +pouchdb-upsert@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/pouchdb-upsert/-/pouchdb-upsert-2.2.0.tgz#42b15e420848f3b294c35060589fdb51cf7f7f5f" + dependencies: + pouchdb-promise "^6.1.2" + +pouchdb-utils@7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pouchdb-utils/-/pouchdb-utils-7.0.0.tgz#48bfced6665b8f5a2b2d2317e2aa57635ed1e88e" + dependencies: + argsarray "0.0.1" + clone-buffer "1.0.0" + immediate "3.0.6" + inherits "2.0.3" + pouchdb-collections "7.0.0" + pouchdb-errors "7.0.0" + pouchdb-md5 "7.0.0" + uuid "3.2.1" + pouchdb@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb/-/pouchdb-7.0.0.tgz#e95df9ef87127d0ea90222d073794bcb47c38648" From 095b3e747a2015d23c361f01b764a6cae4ee2065 Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Mon, 13 Aug 2018 13:10:16 -0700 Subject: [PATCH 03/28] feat: add ksuid, begin uuid refactor --- packages/gnarly-core/package.json | 3 +- packages/gnarly-core/src/stores/pouchdb.ts | 90 +++--- .../src/types/pouchdb-all-dbs.d.ts | 15 + yarn.lock | 296 +++++++++++++++++- 4 files changed, 357 insertions(+), 47 deletions(-) create mode 100644 packages/gnarly-core/src/types/pouchdb-all-dbs.d.ts diff --git a/packages/gnarly-core/package.json b/packages/gnarly-core/package.json index bc0bdcb..9c256aa 100644 --- a/packages/gnarly-core/package.json +++ b/packages/gnarly-core/package.json @@ -33,6 +33,7 @@ "debug": "^3.1.0", "ethereumjs-blockstream": "^3.1.0", "isomorphic-fetch": "^2.2.1", + "ksuid": "^1.1.2", "lodash.identity": "^3.0.0", "lodash.isplainobject": "^4.0.6", "moize": "^5.3.1", @@ -42,10 +43,10 @@ "p-retry": "^2.0.0", "pg": "^7.4.1", "pouchdb": "^7.0.0", + "pouchdb-all-dbs": "^1.0.2", "pouchdb-find": "^7.0.0", "pouchdb-upsert": "^2.2.0", "sequelize": "^4.35.2", - "uuid": "^3.2.1", "web3-eth-abi": "^1.0.0-beta.34", "web3-utils": "^1.0.0-beta.34" }, diff --git a/packages/gnarly-core/src/stores/pouchdb.ts b/packages/gnarly-core/src/stores/pouchdb.ts index 78c8548..b176ba4 100644 --- a/packages/gnarly-core/src/stores/pouchdb.ts +++ b/packages/gnarly-core/src/stores/pouchdb.ts @@ -1,4 +1,7 @@ +/* tslint:disable max-classes-per-file */ + import PouchDB = require('pouchdb') +require('pouchdb-all-dbs')(PouchDB) PouchDB.plugin(require('pouchdb-upsert')) PouchDB.plugin(require('pouchdb-find')) @@ -7,12 +10,16 @@ import { ITransaction, } from '../ourbit/types' import { IPersistInterface } from '../stores' -import { toBN } from '../utils' +import { forEach, toBN } from '../utils' + +// all databases should have --gnarly prefix so we can delete them and not destroy any user data +// that might be sitting around +const GNARLY_DB_PREFIX = '--gnarly' const sortByHexProp = (prop: string) => (a, b) => toBN(a[prop]).sub(toBN(b[prop])).toNumber() const toJSONBlock = (block) => block as IJSONBlock -const deleteWithQuery = async (db, selector) => { +const deleteWithQuery = async (db: PouchDB.Database, selector: object) => { const res = await db.find({ selector }) await db.bulkDocs(res.docs.map((d) => ({ ...d, _deleted: true }))) } @@ -27,23 +34,40 @@ const deleteWithQuery = async (db, selector) => { // pouchdb relies heavily on unique identifiers that operate as the primary index // so our use of `mid` in postgres will complement this nicely -const reducerDb = (e) => `${e}/gnarly-reducers` -const historicalBlocksDb = (e) => `${e}/gnarly-historical-blocks` -const transactionsDb = (e) => `${e}/gnarly-transactions` +const reducerDb = (e: string) => `${e}/${GNARLY_DB_PREFIX}-reducers` +const historicalBlocksDb = (e: string) => (key: string): PouchDB.Database => + new PouchDB(`${e}/${GNARLY_DB_PREFIX}-${key}-historical-blocks`) +const transactionsDb = (e: string) => (key: string): PouchDB.Database => + new PouchDB(`${e}/${GNARLY_DB_PREFIX}-${key}-transactions`) -export default class PouchDBPersistInterface implements IPersistInterface { +class DyanmicDict { + private cache: { [_: string]: T } = {} + + constructor ( + private dbGenerator: (key: string) => T, + ) { + } + + public get = (key: string) => { + if (this.cache[key]) { return this.cache[key] } + this.cache[key] = this.dbGenerator(key) + return this.cache[key] + } +} + +export default class PouchDBPersistInterface implements IPersistInterface { private reducers: PouchDB.Database - private historicalBlocks: PouchDB.Database - private transactions: PouchDB.Database + private historicalBlocks: DyanmicDict + private transactions: DyanmicDict constructor ( dbEndpoint: string, ) { try { this.reducers = new PouchDB(reducerDb(dbEndpoint)) - this.historicalBlocks = new PouchDB(historicalBlocksDb(dbEndpoint)) - this.transactions = new PouchDB(transactionsDb(dbEndpoint)) + this.historicalBlocks = new DyanmicDict(historicalBlocksDb(dbEndpoint)) + this.transactions = new DyanmicDict(transactionsDb(dbEndpoint)) } catch (error) { throw new Error(`Instantiating PouchDBs failed: ${error.stack}`) } @@ -59,36 +83,32 @@ export default class PouchDBPersistInterface implements IPersistInterface { // blockstream CRUD public getHistoricalBlocks = async (reducerKey: string): Promise => { - const res = await this.historicalBlocks.find({ - selector: { - reducerKey: { $eq: reducerKey }, - }, - }) - - return res.docs.map(toJSONBlock).sort(sortByHexProp('number')) + const res = await this.historicalBlocks.get(reducerKey).allDocs() + return res.rows + .map((r) => r.doc) + .map(toJSONBlock) + .sort(sortByHexProp('number')) } public saveHistoricalBlock = async (reducerKey: string, blockRetention: number, block: IJSONBlock): Promise => { - await this.historicalBlocks.putIfNotExists({ - _id: block.hash, - ...block, - reducerKey, + await this.historicalBlocks + .get(reducerKey) + .putIfNotExists({ + _id: block.hash, + ...block, }) // @TODO (shrugs) - delete blocks after blockRetention for this reducer } public deleteHistoricalBlock = async (reducerKey: string, blockHash: string): Promise => { - await deleteWithQuery(this.historicalBlocks, { + await deleteWithQuery(this.historicalBlocks.get(reducerKey), { _id: { $eq: blockHash }, - reducerKey: { $eq: reducerKey }, }) } public deleteHistoricalBlocks = async (reducerKey: string): Promise => { - await deleteWithQuery(this.historicalBlocks, { - reducerKey: { $eq: reducerKey }, - }) + await this.historicalBlocks.get(reducerKey).destroy() } // transaction CRUD @@ -113,20 +133,14 @@ export default class PouchDBPersistInterface implements IPersistInterface { // setup & setdown public setup = async (): Promise => { - // implicitely create database if not exists - await this.reducers.info() - await this.historicalBlocks.info() - await this.transactions.info() - - // index historical blocks on reducerKeys - this.historicalBlocks.createIndex({ - index: { fields: ['reducerKey'] }, - }) + // databases are implicitely created and schemaless, so this fn isn't really going to do anything } public setdown = async (): Promise => { - await this.reducers.destroy() - await this.historicalBlocks.destroy() - await this.transactions.destroy() + const dbs = await PouchDB.allDbs() + await forEach( + dbs.filter((db) => db.startsWith(GNARLY_DB_PREFIX)), + async (db) => await (new PouchDB(db)).destroy(), + ) } } diff --git a/packages/gnarly-core/src/types/pouchdb-all-dbs.d.ts b/packages/gnarly-core/src/types/pouchdb-all-dbs.d.ts new file mode 100644 index 0000000..93aec3f --- /dev/null +++ b/packages/gnarly-core/src/types/pouchdb-all-dbs.d.ts @@ -0,0 +1,15 @@ + +declare module 'pouchdb-all-dbs' { + const pouchdbAllDbs: (pouchDB: PouchDB.Static) => void; + export = pouchdbAllDbs; +} + +declare namespace PouchDB { + interface Static { + allDbs(callback: (err: any, dbs: string[]) => void): void; + allDbs(): Promise; + + resetAllDbs(callback: (err: any) => void): void; + resetAllDbs(): Promise; + } +} diff --git a/yarn.lock b/yarn.lock index e0a7b5a..689e14e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -810,6 +810,14 @@ acorn@5.5.3, acorn@^5.0.3: version "5.5.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.3.tgz#f473dd47e0277a08e28e9bec5aeeb04751f0b8c9" +acorn@^1.0.3: + version "1.2.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-1.2.2.tgz#c8ce27de0acc76d896d2b1fad3df588d9e82f014" + +acorn@^5.2.1: + version "5.7.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.1.tgz#f095829297706a7c9776958c0afc8930a9b9d9d8" + ajv@^4.9.1: version "4.11.8" resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" @@ -988,6 +996,14 @@ assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" +ast-types@0.8.15: + version "0.8.15" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.8.15.tgz#8eef0827f04dff0ec8857ba925abe3fea6194e52" + +ast-types@0.9.6: + version "0.9.6" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.6.tgz#102c9e9e9005d3e7e3829bf0c4fa24ee862ee9b9" + async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" @@ -1043,6 +1059,14 @@ balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" +base62@0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/base62/-/base62-0.1.1.tgz#7b4174c2f94449753b11c2651c083da841a7b084" + +base62@^1.1.0: + version "1.2.8" + resolved "https://registry.yarnpkg.com/base62/-/base62-1.2.8.tgz#1264cb0fb848d875792877479dbe8bae6bae3428" + base@^0.11.1: version "0.11.2" resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" @@ -1518,10 +1542,28 @@ commander@2.6.0: version "2.6.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.6.0.tgz#9df7e52fb2a0cb0fb89058ee80c3104225f37e1d" +commander@^2.5.0: + version "2.17.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" + commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" +commoner@^0.10.1: + version "0.10.8" + resolved "https://registry.yarnpkg.com/commoner/-/commoner-0.10.8.tgz#34fc3672cd24393e8bb47e70caa0293811f4f2c5" + dependencies: + commander "^2.5.0" + detective "^4.3.1" + glob "^5.0.15" + graceful-fs "^4.1.2" + iconv-lite "^0.4.5" + mkdirp "^0.5.0" + private "^0.1.6" + q "^1.1.2" + recast "^0.11.17" + compare-func@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-1.3.2.tgz#99dd0ba457e1f9bc722b12c08ec33eeab31fa648" @@ -1908,6 +1950,10 @@ define-property@^2.0.2: is-descriptor "^1.0.2" isobject "^3.0.1" +defined@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -1936,6 +1982,13 @@ detect-libc@^1.0.2, detect-libc@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" +detective@^4.3.1: + version "4.7.1" + resolved "https://registry.yarnpkg.com/detective/-/detective-4.7.1.tgz#0eca7314338442febb6d65da54c10bb1c82b246e" + dependencies: + acorn "^5.2.1" + defined "^1.0.0" + dezalgo@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.3.tgz#7f742de066fc748bc8db820569dddce49bf0d456" @@ -2064,6 +2117,40 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +es-abstract@^1.4.3: + version "1.12.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165" + dependencies: + es-to-primitive "^1.1.1" + function-bind "^1.1.1" + has "^1.0.1" + is-callable "^1.1.3" + is-regex "^1.0.4" + +es-to-primitive@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" + dependencies: + is-callable "^1.1.1" + is-date-object "^1.0.1" + is-symbol "^1.0.1" + +es3ify@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/es3ify/-/es3ify-0.1.4.tgz#ad9fa5df1ae34f3f31e1211b5818b2d51078dfd1" + dependencies: + esprima-fb "~3001.0001.0000-dev-harmony-fb" + jstransform "~3.0.0" + through "~2.3.4" + +es3ify@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/es3ify/-/es3ify-0.2.2.tgz#5dae3e650e5be3684b88066513d528d092629862" + dependencies: + esprima "^2.7.1" + jstransform "~11.0.0" + through "~2.3.4" + es6-denodeify@^0.1.1: version "0.1.5" resolved "https://registry.yarnpkg.com/es6-denodeify/-/es6-denodeify-0.1.5.tgz#31d4d5fe9c5503e125460439310e16a2a3f39c1f" @@ -2087,6 +2174,22 @@ escodegen@1.8.1: optionalDependencies: source-map "~0.2.0" +esmangle-evaluator@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/esmangle-evaluator/-/esmangle-evaluator-1.0.1.tgz#620d866ef4861b3311f75766d52a8572bb3c6336" + +esprima-fb@^15001.1.0-dev-harmony-fb: + version "15001.1.0-dev-harmony-fb" + resolved "https://registry.yarnpkg.com/esprima-fb/-/esprima-fb-15001.1.0-dev-harmony-fb.tgz#30a947303c6b8d5e955bee2b99b1d233206a6901" + +esprima-fb@~15001.1001.0-dev-harmony-fb: + version "15001.1001.0-dev-harmony-fb" + resolved "https://registry.yarnpkg.com/esprima-fb/-/esprima-fb-15001.1001.0-dev-harmony-fb.tgz#43beb57ec26e8cf237d3dd8b33e42533577f2659" + +esprima-fb@~3001.0001.0000-dev-harmony-fb, esprima-fb@~3001.1.0-dev-harmony-fb: + version "3001.1.0-dev-harmony-fb" + resolved "https://registry.yarnpkg.com/esprima-fb/-/esprima-fb-3001.0001.0000-dev-harmony-fb.tgz#b77d37abcd38ea0b77426bb8bc2922ce6b426411" + esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" @@ -2095,6 +2198,10 @@ esprima@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" +esprima@~3.1.0: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + estraverse@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" @@ -2275,6 +2382,15 @@ extsprintf@^1.2.0: version "1.4.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" +falafel@^1.0.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/falafel/-/falafel-1.2.0.tgz#c18d24ef5091174a497f318cd24b026a25cddab4" + dependencies: + acorn "^1.0.3" + foreach "^2.0.5" + isarray "0.0.1" + object-keys "^1.0.6" + fast-deep-equal@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" @@ -2490,7 +2606,7 @@ fstream@^1.0.0, fstream@^1.0.2: mkdirp ">=0.5 0" rimraf "2" -function-bind@^1.1.1: +function-bind@^1.0.2, function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" @@ -2622,6 +2738,16 @@ glob@7.1.2, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1, glob@^7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^5.0.15: + version "5.0.15" + resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "2 || 3" + once "^1.3.0" + path-is-absolute "^1.0.0" + global-dirs@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" @@ -2787,6 +2913,12 @@ has-values@^1.0.0: is-number "^3.0.0" kind-of "^4.0.0" +has@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + dependencies: + function-bind "^1.1.1" + hash.js@^1.0.0, hash.js@^1.0.3: version "1.1.3" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" @@ -2884,6 +3016,12 @@ iconv-lite@^0.4.17, iconv-lite@^0.4.4, iconv-lite@~0.4.13: dependencies: safer-buffer ">= 2.1.2 < 3" +iconv-lite@^0.4.5: + version "0.4.23" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" + dependencies: + safer-buffer ">= 2.1.2 < 3" + ignore-by-default@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" @@ -2967,6 +3105,13 @@ init-package-json@^1.10.3: validate-npm-package-license "^3.0.1" validate-npm-package-name "^3.0.0" +inline-process-browser@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/inline-process-browser/-/inline-process-browser-1.0.0.tgz#46a61b153dd3c9b1624b1a00626edb4f7f414f22" + dependencies: + falafel "^1.0.1" + through2 "^0.6.5" + inquirer@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-5.2.0.tgz#db350c2b73daca77ff1243962e9f22f099685726" @@ -3042,6 +3187,10 @@ is-builtin-module@^1.0.0: dependencies: builtin-modules "^1.0.0" +is-callable@^1.1.1, is-callable@^1.1.3: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" + is-ci@^1.0.10: version "1.1.0" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.1.0.tgz#247e4162e7860cebbdaf30b774d6b0ac7dcfe7a5" @@ -3060,6 +3209,10 @@ is-data-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + is-descriptor@^0.1.0: version "0.1.6" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" @@ -3189,6 +3342,12 @@ is-redirect@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" +is-regex@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + dependencies: + has "^1.0.1" + is-relative@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d" @@ -3207,6 +3366,10 @@ is-subset@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" +is-symbol@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" + is-text-path@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-text-path/-/is-text-path-1.0.1.tgz#4e1aa0fb51bfbcb3e92688001397202c1775b66e" @@ -3404,6 +3567,24 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" +jstransform@~11.0.0: + version "11.0.3" + resolved "https://registry.yarnpkg.com/jstransform/-/jstransform-11.0.3.tgz#09a78993e0ae4d4ef4487f6155a91f6190cb4223" + dependencies: + base62 "^1.1.0" + commoner "^0.10.1" + esprima-fb "^15001.1.0-dev-harmony-fb" + object-assign "^2.0.0" + source-map "^0.4.2" + +jstransform@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/jstransform/-/jstransform-3.0.0.tgz#a2591ab6cee8d97bf3be830dbfa2313b87cd640b" + dependencies: + base62 "0.1.1" + esprima-fb "~3001.1.0-dev-harmony-fb" + source-map "0.1.31" + keccakjs@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/keccakjs/-/keccakjs-0.2.1.tgz#1d633af907ef305bbf9f2fa616d56c44561dfa4d" @@ -3431,6 +3612,12 @@ kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" +ksuid@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/ksuid/-/ksuid-1.1.2.tgz#582ab1bc9fe36e6b9ff3c0fd85c76c67132150ec" + dependencies: + string.prototype.padstart "^3.0.0" + latest-version@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" @@ -3573,6 +3760,15 @@ levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +lie@3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/lie/-/lie-3.0.4.tgz#bc7ae1ebe7f1c8de39afdcd4f789076b47b0f634" + dependencies: + es3ify "^0.2.2" + immediate "~3.0.5" + inline-process-browser "^1.0.0" + unreachable-branch-transform "^0.3.0" + lie@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" @@ -3844,7 +4040,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" -minimatch@3.0.4, minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4: +"minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: @@ -4229,6 +4425,10 @@ oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" +object-assign@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-2.1.1.tgz#43c36e5d569ff8e4816c4efa8be02d26967c18aa" + object-assign@^4, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -4241,7 +4441,7 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-keys@^1.0.11, object-keys@^1.0.8: +object-keys@^1.0.11, object-keys@^1.0.6, object-keys@^1.0.8: version "1.0.12" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" @@ -4648,6 +4848,16 @@ pouchdb-abstract-mapreduce@7.0.0: pouchdb-md5 "7.0.0" pouchdb-utils "7.0.0" +pouchdb-all-dbs@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pouchdb-all-dbs/-/pouchdb-all-dbs-1.0.2.tgz#8fa1aa4b01665e00e0da9c61bf6dbb99eca05d3c" + dependencies: + argsarray "0.0.1" + es3ify "^0.1.3" + inherits "~2.0.1" + pouchdb-promise "5.4.3" + tiny-queue "^0.2.0" + pouchdb-binary-utils@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-binary-utils/-/pouchdb-binary-utils-7.0.0.tgz#cb71a288b09572a231f6bab1b4aed201c4d219a7" @@ -4703,6 +4913,12 @@ pouchdb-md5@7.0.0: pouchdb-binary-utils "7.0.0" spark-md5 "3.0.0" +pouchdb-promise@5.4.3: + version "5.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-promise/-/pouchdb-promise-5.4.3.tgz#331d670b1989d5a03f268811214f27f54150cb2b" + dependencies: + lie "3.0.4" + pouchdb-promise@^6.1.2: version "6.4.3" resolved "https://registry.yarnpkg.com/pouchdb-promise/-/pouchdb-promise-6.4.3.tgz#74516f4acf74957b54debd0fb2c0e5b5a68ca7b3" @@ -4807,6 +5023,10 @@ prepend-http@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" +private@^0.1.6, private@~0.1.5: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" @@ -4886,7 +5106,7 @@ punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" -q@^1.5.1: +q@^1.1.2, q@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" @@ -5012,6 +5232,15 @@ readable-stream@1.0.33: isarray "0.0.1" string_decoder "~0.10.x" +"readable-stream@>=1.0.33-1 <1.1.0-0": + version "1.0.34" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.3, readable-stream@^2.3.5: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" @@ -5046,6 +5275,24 @@ readdirp@^2.0.0: readable-stream "^2.0.2" set-immediate-shim "^1.0.1" +recast@^0.10.1: + version "0.10.43" + resolved "https://registry.yarnpkg.com/recast/-/recast-0.10.43.tgz#b95d50f6d60761a5f6252e15d80678168491ce7f" + dependencies: + ast-types "0.8.15" + esprima-fb "~15001.1001.0-dev-harmony-fb" + private "~0.1.5" + source-map "~0.5.0" + +recast@^0.11.17: + version "0.11.23" + resolved "https://registry.yarnpkg.com/recast/-/recast-0.11.23.tgz#451fd3004ab1e4df9b4e4b66376b2a21912462d3" + dependencies: + ast-types "0.9.6" + esprima "~3.1.0" + private "~0.1.5" + source-map "~0.5.0" + redent@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" @@ -5590,13 +5837,19 @@ source-map-url@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" -source-map@^0.4.4: +source-map@0.1.31: + version "0.1.31" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.31.tgz#9f704d0d69d9e138a81badf6ebb4fde33d151c61" + dependencies: + amdefine ">=0.0.4" + +source-map@^0.4.2, source-map@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" dependencies: amdefine ">=0.0.4" -source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.0, source-map@~0.5.1: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -5743,6 +5996,14 @@ string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string.prototype.padstart@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/string.prototype.padstart/-/string.prototype.padstart-3.0.0.tgz#5bcfad39f4649bb2d031292e19bcf0b510d4b242" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.4.3" + function-bind "^1.0.2" + string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" @@ -5961,7 +6222,14 @@ through2@2.0.3, through2@^2.0.0, through2@^2.0.2, through2@^2.0.3, through2@~2.0 readable-stream "^2.1.5" xtend "~4.0.1" -through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@~2.3, through@~2.3.1: +through2@^0.6.2, through2@^0.6.5: + version "0.6.5" + resolved "https://registry.yarnpkg.com/through2/-/through2-0.6.5.tgz#41ab9c67b29d57209071410e1d7a7a968cd3ad48" + dependencies: + readable-stream ">=1.0.33-1 <1.1.0-0" + xtend ">=4.0.0 <4.1.0-0" + +through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@~2.3, through@~2.3.1, through@~2.3.4: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -5969,6 +6237,10 @@ timed-out@^4.0.0, timed-out@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" +tiny-queue@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/tiny-queue/-/tiny-queue-0.2.1.tgz#25a67f2c6e253b2ca941977b5ef7442ef97a6046" + tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" @@ -6221,6 +6493,14 @@ unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" +unreachable-branch-transform@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/unreachable-branch-transform/-/unreachable-branch-transform-0.3.0.tgz#d99cc4c6e746d264928845b611db54b0f3474caa" + dependencies: + esmangle-evaluator "^1.0.0" + recast "^0.10.1" + through2 "^0.6.2" + unset-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" @@ -6578,7 +6858,7 @@ xregexp@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-4.0.0.tgz#e698189de49dd2a18cc5687b05e17c8e43943020" -xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.0, xtend@~4.0.1: +"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.0, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" From 76ef2e81887b85f7e055808c4d6f34aab059e6c9 Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Mon, 13 Aug 2018 13:18:53 -0700 Subject: [PATCH 04/28] feat: replace uuid with ksuid --- package.json | 1 - packages/gnarly-core/src/Blockstream.ts | 4 ++-- packages/gnarly-core/src/ourbit/Ourbit.ts | 7 +++---- packages/gnarly-core/src/utils.ts | 7 +++++-- packages/gnarly-core/test/Ourbit.spec.ts | 13 +++++++------ packages/gnarly-core/test/utils.spec.ts | 9 +++++---- yarn.lock | 6 ------ 7 files changed, 22 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index c1180ea..a57e2cc 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ "devDependencies": { "@types/mocha": "^2.2.48", "@types/node": "^9.4.0", - "@types/uuid": "^3.4.3", "coveralls": "^3.0.2", "lcov-result-merger": "^3.1.0", "lerna": "^3.0.3", diff --git a/packages/gnarly-core/src/Blockstream.ts b/packages/gnarly-core/src/Blockstream.ts index 2b10e91..52c376a 100644 --- a/packages/gnarly-core/src/Blockstream.ts +++ b/packages/gnarly-core/src/Blockstream.ts @@ -9,7 +9,6 @@ import { } from 'ethereumjs-blockstream' import 'isomorphic-fetch' import PQueue = require('p-queue') -import uuid = require('uuid') import { IJSONBlock } from './models/Block' import { IJSONLog } from './models/Log' @@ -17,6 +16,7 @@ import { IJSONLog } from './models/Log' import { timeout, toBN, + uuid, } from './utils' import { globalState } from './globalstate' @@ -163,7 +163,7 @@ class BlockStream { ) await this.processTransaction( - uuid.v4(), + uuid(), this.onNewBlock(block, this.syncing), { blockHash: block.hash, diff --git a/packages/gnarly-core/src/ourbit/Ourbit.ts b/packages/gnarly-core/src/ourbit/Ourbit.ts index c656db3..346d0c4 100644 --- a/packages/gnarly-core/src/ourbit/Ourbit.ts +++ b/packages/gnarly-core/src/ourbit/Ourbit.ts @@ -6,11 +6,10 @@ import { observe, unobserve, } from '@xlnt/fast-json-patch' -import uuid = require('uuid') import { globalState } from '../globalstate' import { ReducerContext } from '../reducer' -import { invertPatch, operationsOfPatches, toOperation } from '../utils' +import { invertPatch, operationsOfPatches, toOperation, uuid } from '../utils' import { IOperation, IPatch, @@ -67,7 +66,7 @@ class Ourbit { // watch for patches to the memory state const observer = observe(this.targetState, (ops) => { patches.push({ - id: uuid.v4(), + id: uuid(), operations: ops.map((op) => ({ ...op, volatile: false, @@ -84,7 +83,7 @@ class Ourbit { // collect any operations that are directly emitted this.context.setOpCollector((op: IOperation) => { patches.push({ - id: uuid.v4(), + id: uuid(), operations: [op], reason: this.context.getCurrentReason(), }) diff --git a/packages/gnarly-core/src/utils.ts b/packages/gnarly-core/src/utils.ts index 27b33b1..7c51818 100644 --- a/packages/gnarly-core/src/utils.ts +++ b/packages/gnarly-core/src/utils.ts @@ -1,10 +1,10 @@ import { Operation } from '@xlnt/fast-json-patch' import BN = require('bn.js') +import KSUID = require('ksuid') import _ = require('lodash') import memoize from 'moize' import numberToBN = require('number-to-bn') import pMap = require('p-map') -import uuid = require('uuid') import web3Utils = require('web3-utils') import IABIItem, { IABIItemInput } from './models/ABIItem' @@ -16,6 +16,9 @@ import { const API_CACHE_MAX_AGE = 1000 +// shrugs: I feel like using the sync randomness here isn't really a big deal, but we'll see +export const uuid = () => KSUID.randomSync().string + export const cacheApiRequest = (fn) => memoize(fn, { isPromise: true, maxAge: API_CACHE_MAX_AGE, @@ -123,7 +126,7 @@ export const appendTo = ( value: any, ): IOperation => { // forcefully add uuid to value - value.uuid = uuid.v4() + value.uuid = uuid() // for now, typeStores interpret an add operation without an index // as a normal sort of insert // so there's actually nothing special to do here diff --git a/packages/gnarly-core/test/Ourbit.spec.ts b/packages/gnarly-core/test/Ourbit.spec.ts index ceedc2b..f892946 100644 --- a/packages/gnarly-core/test/Ourbit.spec.ts +++ b/packages/gnarly-core/test/Ourbit.spec.ts @@ -1,7 +1,6 @@ import chai = require('chai') import 'mocha' -import uuid = require('uuid') import { globalState } from '../src/globalstate' import * as utils from '../src/utils' @@ -20,6 +19,8 @@ const TEST_KEY = 'test' const TEST_REASON = 'TEST_REASON' const TEST_META = {} +const TEST_UUID = utils.uuid() + describe('Ourbit', () => { let ourbit: Ourbit = null @@ -35,7 +36,7 @@ describe('Ourbit', () => { } beforeEach(() => { - sandbox.on(uuid, 'v4', () => 'uuid') + sandbox.on(utils, TEST_UUID, () => TEST_UUID) sandbox.on(globalState, [ 'setPatchGenerator', 'setOpCollector', @@ -46,7 +47,7 @@ describe('Ourbit', () => { id: '0x1', blockHash: '0x1', patches: [{ - id: 'uuid', + id: TEST_UUID, reason: undefined, operations: [{ op: 'add', @@ -104,7 +105,7 @@ describe('Ourbit', () => { it('should allow manual collection', async () => { tx.patches.push({ - id: 'uuid', + id: TEST_UUID, reason: undefined, operations: [{ op: 'replace', @@ -130,12 +131,12 @@ describe('Ourbit', () => { it('should accept volatile operations', async () => { targetState.domain = { array: [] } tx.patches.push({ - id: 'uuid', + id: TEST_UUID, reason: undefined, operations: [{ op: 'add', path: '/domain/uuid', - value: { uuid: 'uuid', value: 'value' }, + value: { uuid: TEST_UUID, value: 'value' }, volatile: true, }], }) diff --git a/packages/gnarly-core/test/utils.spec.ts b/packages/gnarly-core/test/utils.spec.ts index 2d00e3b..7234336 100644 --- a/packages/gnarly-core/test/utils.spec.ts +++ b/packages/gnarly-core/test/utils.spec.ts @@ -1,6 +1,5 @@ import chai = require('chai') import 'mocha' -import uuid = require('uuid') import { IABIItemInput } from '../src' @@ -12,6 +11,8 @@ const should = chai .use(require('chai-spies')) .should() +const TEST_UUID = utils.uuid() + const TRANSFER_ABI: IABIItemInput = { anonymous: false, inputs: [ @@ -25,7 +26,7 @@ const TRANSFER_ABI: IABIItemInput = { describe('utils', function () { before(function () { - chai.spy.on(uuid, 'v4', () => 'uuid') + chai.spy.on(utils, 'uuid', () => TEST_UUID) }) after(function () { @@ -195,9 +196,9 @@ describe('utils', function () { it('generates a valid op', async function () { const op = utils.appendTo('domain', { test: true }) op.op.should.equal('add') - op.path.should.equal('/domain/uuid') + op.path.should.equal(`/domain/${TEST_UUID}`) op.value.should.deep.equal({ - uuid: 'uuid', + uuid: TEST_UUID, test: true, }) op.volatile.should.equal(true) diff --git a/yarn.lock b/yarn.lock index 689e14e..bc7b2b2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -758,12 +758,6 @@ "@types/pouchdb-node" "*" "@types/pouchdb-replication" "*" -"@types/uuid@^3.4.3": - version "3.4.3" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-3.4.3.tgz#121ace265f5569ce40f4f6d0ff78a338c732a754" - dependencies: - "@types/node" "*" - "@xlnt/fast-json-patch@^2.0.8": version "2.0.8" resolved "https://registry.yarnpkg.com/@xlnt/fast-json-patch/-/fast-json-patch-2.0.8.tgz#f7fd252ec58213696e309397ef7a337dad94aaa4" From 0af001bd389bb993a54a8869db0b96528d3007f3 Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Mon, 13 Aug 2018 13:28:22 -0700 Subject: [PATCH 05/28] refactor: switch to ksuid which can be lixcographically sorted --- packages/gnarly-core/test/Blockstream.spec.ts | 4 ++++ packages/gnarly-core/test/Ourbit.spec.ts | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/gnarly-core/test/Blockstream.spec.ts b/packages/gnarly-core/test/Blockstream.spec.ts index 64c0e87..0912d18 100644 --- a/packages/gnarly-core/test/Blockstream.spec.ts +++ b/packages/gnarly-core/test/Blockstream.spec.ts @@ -275,5 +275,9 @@ describe('Blockstream', function () { ) }) }) + + context('when presented with hella blocks', function () { + it('should throttle to queue limit') + }) }) }) diff --git a/packages/gnarly-core/test/Ourbit.spec.ts b/packages/gnarly-core/test/Ourbit.spec.ts index f892946..524eea1 100644 --- a/packages/gnarly-core/test/Ourbit.spec.ts +++ b/packages/gnarly-core/test/Ourbit.spec.ts @@ -36,7 +36,7 @@ describe('Ourbit', () => { } beforeEach(() => { - sandbox.on(utils, TEST_UUID, () => TEST_UUID) + sandbox.on(utils, 'uuid', () => TEST_UUID) sandbox.on(globalState, [ 'setPatchGenerator', 'setOpCollector', @@ -135,7 +135,7 @@ describe('Ourbit', () => { reason: undefined, operations: [{ op: 'add', - path: '/domain/uuid', + path: `/domain/${TEST_UUID}`, value: { uuid: TEST_UUID, value: 'value' }, volatile: true, }], From 596d32013ca81b0005db2785788bb37fcc0012a9 Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Mon, 13 Aug 2018 14:13:38 -0700 Subject: [PATCH 06/28] feat: pouchdb implementation compiles and existing gnarly-bin works under manual test --- packages/gnarly-core/src/Blockstream.ts | 5 +- packages/gnarly-core/src/ourbit/Ourbit.ts | 2 +- .../src/stores/IPersistInterface.ts | 2 +- packages/gnarly-core/src/stores/pouchdb.ts | 61 +++++++++++++++---- packages/gnarly-core/src/stores/sequelize.ts | 4 +- 5 files changed, 57 insertions(+), 17 deletions(-) diff --git a/packages/gnarly-core/src/Blockstream.ts b/packages/gnarly-core/src/Blockstream.ts index 52c376a..c399089 100644 --- a/packages/gnarly-core/src/Blockstream.ts +++ b/packages/gnarly-core/src/Blockstream.ts @@ -132,7 +132,10 @@ class BlockStream { } public stop = async () => { - this.unsubscribeFromNewBlocks() + if (this.unsubscribeFromNewBlocks) { + this.unsubscribeFromNewBlocks() + } + if (this.streamer) { this.streamer.unsubscribeFromOnBlockAdded(this.onBlockAddedSubscriptionToken) this.streamer.unsubscribeFromOnBlockRemoved(this.onBlockRemovedSubscriptionToken) diff --git a/packages/gnarly-core/src/ourbit/Ourbit.ts b/packages/gnarly-core/src/ourbit/Ourbit.ts index 346d0c4..c320ec1 100644 --- a/packages/gnarly-core/src/ourbit/Ourbit.ts +++ b/packages/gnarly-core/src/ourbit/Ourbit.ts @@ -162,7 +162,7 @@ class Ourbit { // apply to store (mutable and volatile) await this.notifyPatches(tx.id, inversePatches) // delete transaction - await globalState.store.deleteTransaction(this.key, tx) + await globalState.store.deleteTransaction(this.key, tx.id) } } diff --git a/packages/gnarly-core/src/stores/IPersistInterface.ts b/packages/gnarly-core/src/stores/IPersistInterface.ts index bbcbf3b..7cbe9ea 100644 --- a/packages/gnarly-core/src/stores/IPersistInterface.ts +++ b/packages/gnarly-core/src/stores/IPersistInterface.ts @@ -17,7 +17,7 @@ export interface IPersistInterface { // transaction CRUD getAllTransactionsTo (reducerKey: string, toTxId: null | string): Promise getLatestTransaction (reducerKey: string): Promise - deleteTransaction (reducerKey: string, tx: ITransaction): Promise + deleteTransaction (reducerKey: string, txId: string): Promise saveTransaction (reducerKey: string, tx: ITransaction): Promise getTransaction (reducerKey: string, txId: string): Promise getTransactionByBlockHash (reducerKey: string, blockHash: string): Promise diff --git a/packages/gnarly-core/src/stores/pouchdb.ts b/packages/gnarly-core/src/stores/pouchdb.ts index b176ba4..6e22e15 100644 --- a/packages/gnarly-core/src/stores/pouchdb.ts +++ b/packages/gnarly-core/src/stores/pouchdb.ts @@ -18,12 +18,17 @@ const GNARLY_DB_PREFIX = '--gnarly' const sortByHexProp = (prop: string) => (a, b) => toBN(a[prop]).sub(toBN(b[prop])).toNumber() const toJSONBlock = (block) => block as IJSONBlock +const toTransaction = (tx) => tx as ITransaction const deleteWithQuery = async (db: PouchDB.Database, selector: object) => { const res = await db.find({ selector }) await db.bulkDocs(res.docs.map((d) => ({ ...d, _deleted: true }))) } +const deleteById = async (db: PouchDB.Database, id: string) => { + await db.remove(await db.get(id)) +} + // // https://pouchdb.com/api.html#batch_fetch // const prefix = (p: string) => ({ // startkey: `${p}`, @@ -77,8 +82,9 @@ export default class PouchDBPersistInterface implements IPersistInterface { public saveReducer = async (reducerKey: string): Promise => { await this.reducers.putIfNotExists({ _id: reducerKey }) } + public deleteReducer = async (reducerKey: string): Promise => { - await this.reducers.remove(await this.reducers.get(reducerKey)) + await deleteById(this.reducers, reducerKey) } // blockstream CRUD @@ -87,7 +93,7 @@ export default class PouchDBPersistInterface implements IPersistInterface { return res.rows .map((r) => r.doc) .map(toJSONBlock) - .sort(sortByHexProp('number')) + .sort(sortByHexProp('number')) // @TODO might be able to replace with ksuid allDocs } public saveHistoricalBlock = async (reducerKey: string, blockRetention: number, block: IJSONBlock): Promise => { @@ -102,9 +108,7 @@ export default class PouchDBPersistInterface implements IPersistInterface { } public deleteHistoricalBlock = async (reducerKey: string, blockHash: string): Promise => { - await deleteWithQuery(this.historicalBlocks.get(reducerKey), { - _id: { $eq: blockHash }, - }) + await deleteById(this.historicalBlocks.get(reducerKey), blockHash) } public deleteHistoricalBlocks = async (reducerKey: string): Promise => { @@ -113,22 +117,55 @@ export default class PouchDBPersistInterface implements IPersistInterface { // transaction CRUD public getAllTransactionsTo = async (reducerKey: string, toTxId: null | string): Promise => { - // + const res = await this.transactions.get(reducerKey).allDocs({ + include_docs: true, + endkey: toTxId, + }) + + return res.rows + .map((r) => r.doc) + .map(toJSONBlock) } + public getLatestTransaction = async (reducerKey: string): Promise => { - // + const res = await this.transactions.get(reducerKey).allDocs({ + include_docs: true, + limit: 1, + }) + + if (!res.rows.length) { + throw new Error(`Could not get latest transaction in ${reducerKey}`) + } + + return toTransaction(res.rows[0].doc) } - public deleteTransaction = async (reducerKey: string, tx: ITransaction): Promise => { - // + + public deleteTransaction = async (reducerKey: string, txId: string): Promise => { + await deleteById(this.transactions.get(reducerKey), txId) } + public saveTransaction = async (reducerKey: string, tx: ITransaction): Promise => { - // + await this.transactions.get(reducerKey).put({ + _id: tx.id, + ...tx, + }) } + public getTransaction = async (reducerKey: string, txId: string): Promise => { - // + const res = await this.transactions.get(reducerKey).get(txId) + return toTransaction(res) } + public getTransactionByBlockHash = async (reducerKey: string, blockHash: string): Promise => { - // + const res = await this.transactions.get(reducerKey).find({ + selector: { blockHash: { $eq: blockHash } }, + }) + + if (!res.docs.length) { + throw new Error(`Cound not find transaction in ${reducerKey} by blockHash ${blockHash}`) + } + + return toTransaction(res.docs[0]) } // setup & setdown diff --git a/packages/gnarly-core/src/stores/sequelize.ts b/packages/gnarly-core/src/stores/sequelize.ts index 016e980..1fd5489 100644 --- a/packages/gnarly-core/src/stores/sequelize.ts +++ b/packages/gnarly-core/src/stores/sequelize.ts @@ -302,10 +302,10 @@ export default class SequelizePersistInterface implements IPersistInterface { )) } - public deleteTransaction = async (reducerKey: string, tx: ITransaction) => { + public deleteTransaction = async (reducerKey: string, txId: string) => { // @TODO does this delete patches, etc as well? seems like not, by default return this.Transaction.destroy({ - where: { id: { [this.Sequelize.Op.eq]: tx.id } }, + where: { id: { [this.Sequelize.Op.eq]: txId } }, include: [{ model: this.Reducer, where: { id: { [this.Sequelize.Op.eq]: reducerKey } }, From 28c61b78d936b7d2454ae47c0ef750e0d2842c1a Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Mon, 13 Aug 2018 18:31:39 -0700 Subject: [PATCH 07/28] feat: implement pouchdb store --- packages/gnarly-bin/src/index.ts | 7 +- packages/gnarly-core/package.json | 1 - packages/gnarly-core/src/Blockstream.ts | 1 + packages/gnarly-core/src/ReducerRunner.ts | 7 +- packages/gnarly-core/src/ourbit/Ourbit.ts | 3 +- packages/gnarly-core/src/ourbit/types.ts | 12 +- packages/gnarly-core/src/stores/index.ts | 4 + packages/gnarly-core/src/stores/pouchdb.ts | 181 +++++++++++++----- packages/gnarly-core/src/stores/sequelize.ts | 1 + .../src/models/sequelize.ts | 2 +- .../gnarly-reducer-block-meta/src/reducer.ts | 2 - .../src/models/sequelize.ts | 2 +- .../src/models/sequelize.ts | 4 +- .../src/models/sequelize.ts | 2 +- 14 files changed, 161 insertions(+), 68 deletions(-) diff --git a/packages/gnarly-bin/src/index.ts b/packages/gnarly-bin/src/index.ts index dcb19e7..d12e292 100644 --- a/packages/gnarly-bin/src/index.ts +++ b/packages/gnarly-bin/src/index.ts @@ -10,6 +10,7 @@ const debug = makeDebug('gnarly') import Sequelize = require('sequelize') import Gnarly, { + PouchDBPersistInterface, SequelizePersistInterface, Web3Api, } from '@xlnt/gnarly-core' @@ -96,10 +97,8 @@ const main = async () => { eventsReducer, ] - const store = new SequelizePersistInterface( - Sequelize, - sequelize, - ) + const store = new PouchDBPersistInterface('http://127.0.0.1:5984') + // const store = new SequelizePersistInterface(Sequelize, sequelize) const ingestApi = new Web3Api(nodeEndpoint) diff --git a/packages/gnarly-core/package.json b/packages/gnarly-core/package.json index 9c256aa..990693e 100644 --- a/packages/gnarly-core/package.json +++ b/packages/gnarly-core/package.json @@ -43,7 +43,6 @@ "p-retry": "^2.0.0", "pg": "^7.4.1", "pouchdb": "^7.0.0", - "pouchdb-all-dbs": "^1.0.2", "pouchdb-find": "^7.0.0", "pouchdb-upsert": "^2.2.0", "sequelize": "^4.35.2", diff --git a/packages/gnarly-core/src/Blockstream.ts b/packages/gnarly-core/src/Blockstream.ts index c399089..51de415 100644 --- a/packages/gnarly-core/src/Blockstream.ts +++ b/packages/gnarly-core/src/Blockstream.ts @@ -170,6 +170,7 @@ class BlockStream { this.onNewBlock(block, this.syncing), { blockHash: block.hash, + blockNumber: block.number, }, ) diff --git a/packages/gnarly-core/src/ReducerRunner.ts b/packages/gnarly-core/src/ReducerRunner.ts index 1fef8f4..3651924 100644 --- a/packages/gnarly-core/src/ReducerRunner.ts +++ b/packages/gnarly-core/src/ReducerRunner.ts @@ -14,6 +14,7 @@ import { SetupFn, TypeStorer, } from './typeStore' +import { toBN } from './utils' // TODO: should be moved to bin const BLOCK_RETENTION = 100 @@ -79,7 +80,11 @@ export class ReducerRunner { mostRecentHistoricalBlock.hash, latestTransaction.blockHash, `We have a latestTransaction ${latestTransaction.id} with blockHash ${latestTransaction.blockHash} - but it doesn't match the most recent historical block ${mostRecentHistoricalBlock.hash}!`, + but it doesn't match the most recent historical block ${mostRecentHistoricalBlock.hash}! + + The historical chain is: + + ${historicalBlocks.map((b) => `${toBN(b.number).toString()} — ${b.hash}`).join('\n')}`, ) // let's re-hydrate local state by replaying transactions diff --git a/packages/gnarly-core/src/ourbit/Ourbit.ts b/packages/gnarly-core/src/ourbit/Ourbit.ts index c320ec1..6383e07 100644 --- a/packages/gnarly-core/src/ourbit/Ourbit.ts +++ b/packages/gnarly-core/src/ourbit/Ourbit.ts @@ -59,7 +59,7 @@ class Ourbit { public processTransaction = async ( txId: string, fn: () => Promise, - extra: ITxExtra = { blockHash: '' }, + extra: ITxExtra, ) => { const patches: IPatch[] = [] @@ -127,6 +127,7 @@ class Ourbit { totalPatches += tx.patches.length this.debug('[applyPatch] %s %d', tx.id, tx.patches.length) const allOperations = operationsOfPatches(tx.patches) + applyPatch(this.targetState, allOperations.map(toOperation)) }) } diff --git a/packages/gnarly-core/src/ourbit/types.ts b/packages/gnarly-core/src/ourbit/types.ts index c5c9516..4cb9a7a 100644 --- a/packages/gnarly-core/src/ourbit/types.ts +++ b/packages/gnarly-core/src/ourbit/types.ts @@ -40,20 +40,22 @@ export interface IPatch { } /** - * A transaction is a set of patches. + * A transaction is a set of patches with a unique id. */ -export interface ITransaction { +export interface IBasicTransaction { id: string - blockHash: string, patches: IPatch[] } -export type OpCollector = (op: IOperation) => void - export interface ITxExtra { blockHash: string + blockNumber: string } +export interface ITransaction extends IBasicTransaction, ITxExtra {} + +export type OpCollector = (op: IOperation) => void + /** * This function accept patches and persists them to a store. */ diff --git a/packages/gnarly-core/src/stores/index.ts b/packages/gnarly-core/src/stores/index.ts index e5443cb..d1c365a 100644 --- a/packages/gnarly-core/src/stores/index.ts +++ b/packages/gnarly-core/src/stores/index.ts @@ -3,6 +3,10 @@ export { makeSequelizeModels, } from './sequelize' +export { + default as PouchDBPersistInterface, +} from './pouchdb' + export { IPersistInterface, } from './IPersistInterface' diff --git a/packages/gnarly-core/src/stores/pouchdb.ts b/packages/gnarly-core/src/stores/pouchdb.ts index 6e22e15..db04654 100644 --- a/packages/gnarly-core/src/stores/pouchdb.ts +++ b/packages/gnarly-core/src/stores/pouchdb.ts @@ -1,30 +1,66 @@ /* tslint:disable max-classes-per-file */ import PouchDB = require('pouchdb') -require('pouchdb-all-dbs')(PouchDB) PouchDB.plugin(require('pouchdb-upsert')) PouchDB.plugin(require('pouchdb-find')) +import KSUID = require('ksuid') +import identity = require('lodash.identity') + import { IJSONBlock } from '../models/Block' import { ITransaction, } from '../ourbit/types' import { IPersistInterface } from '../stores' -import { forEach, toBN } from '../utils' +import { toBN } from '../utils' + +async function* batch ( + db: PouchDB.Database, + query: object = {}, + batchSize = 1000, + mapper: (v: any) => any = identity, +) { + let totalRows = 1 // should be 0 at first, but we want to trigger the first iteration + let lastId + + while (totalRows > 0) { + const opts = { + ...query, + startkey: lastId, + skip: 1, + limit: batchSize, + include_docs: true, + } + + const res = await db.allDocs(opts) + const gots = mapper(res.rows) + yield gots + + totalRows = gots.total_rows + if (totalRows === 0) { break } + lastId = res.rows[res.rows.length - 1].id + } +} // all databases should have --gnarly prefix so we can delete them and not destroy any user data // that might be sitting around const GNARLY_DB_PREFIX = '--gnarly' const sortByHexProp = (prop: string) => (a, b) => toBN(a[prop]).sub(toBN(b[prop])).toNumber() +const sortById = (a, b) => KSUID.parse(a._id).compare(KSUID.parse(b._id)) const toJSONBlock = (block) => block as IJSONBlock const toTransaction = (tx) => tx as ITransaction +const nonVolatile = (t) => !t.volatile -const deleteWithQuery = async (db: PouchDB.Database, selector: object) => { - const res = await db.find({ selector }) - await db.bulkDocs(res.docs.map((d) => ({ ...d, _deleted: true }))) +const destroyDb = async (db: PouchDB.Database) => { + await db.destroy() } +// const deleteWithQuery = async (db: PouchDB.Database, selector: object) => { +// const res = await db.find({ selector }) +// await db.bulkDocs(res.docs.map((d) => ({ ...d, _deleted: true }))) +// } + const deleteById = async (db: PouchDB.Database, id: string) => { await db.remove(await db.get(id)) } @@ -41,41 +77,49 @@ const deleteById = async (db: PouchDB.Database, id: string) => { const reducerDb = (e: string) => `${e}/${GNARLY_DB_PREFIX}-reducers` const historicalBlocksDb = (e: string) => (key: string): PouchDB.Database => - new PouchDB(`${e}/${GNARLY_DB_PREFIX}-${key}-historical-blocks`) + new PouchDB(`${e}/${GNARLY_DB_PREFIX}-historicalblocks-${key}`) const transactionsDb = (e: string) => (key: string): PouchDB.Database => - new PouchDB(`${e}/${GNARLY_DB_PREFIX}-${key}-transactions`) + new PouchDB(`${e}/${GNARLY_DB_PREFIX}-transactions-${key}`) class DyanmicDict { private cache: { [_: string]: T } = {} constructor ( - private dbGenerator: (key: string) => T, + private generator: (key: string) => T, + private resetFn: (thing: T) => Promise = identity, + private resetOnFirstInitialization: boolean = false, ) { } - public get = (key: string) => { + public get = async (key: string) => { if (this.cache[key]) { return this.cache[key] } - this.cache[key] = this.dbGenerator(key) + if (this.resetOnFirstInitialization) { + await this.resetFn(this.generator(key)) + } + + this.cache[key] = this.generator(key) return this.cache[key] } + + public invalidate = (key: string) => { + this.cache[key] = undefined + } + + public flush = () => { + this.cache = {} + } } export default class PouchDBPersistInterface implements IPersistInterface { private reducers: PouchDB.Database private historicalBlocks: DyanmicDict private transactions: DyanmicDict + private didSetDown: boolean = false constructor ( - dbEndpoint: string, + private dbEndpoint: string, ) { - try { - this.reducers = new PouchDB(reducerDb(dbEndpoint)) - this.historicalBlocks = new DyanmicDict(historicalBlocksDb(dbEndpoint)) - this.transactions = new DyanmicDict(transactionsDb(dbEndpoint)) - } catch (error) { - throw new Error(`Instantiating PouchDBs failed: ${error.stack}`) - } } // reducer CRUD @@ -89,75 +133,101 @@ export default class PouchDBPersistInterface implements IPersistInterface { // blockstream CRUD public getHistoricalBlocks = async (reducerKey: string): Promise => { - const res = await this.historicalBlocks.get(reducerKey).allDocs() - return res.rows + const db = await this.historicalBlocks.get(reducerKey) + const res = await db.allDocs({ include_docs: true, descending: true }) + + const blocks = res.rows .map((r) => r.doc) .map(toJSONBlock) - .sort(sortByHexProp('number')) // @TODO might be able to replace with ksuid allDocs + + blocks.sort(sortByHexProp('number')) // @TODO might be able to replace with ksuid allDocs + + return blocks } public saveHistoricalBlock = async (reducerKey: string, blockRetention: number, block: IJSONBlock): Promise => { - await this.historicalBlocks - .get(reducerKey) - .putIfNotExists({ - _id: block.hash, - ...block, + const db = await this.historicalBlocks.get(reducerKey) + await db.putIfNotExists({ + _id: block.hash, + hash: block.hash, + parentHash: block.parentHash, + number: block.number, + // ^ manually filter properties we care about from block }) // @TODO (shrugs) - delete blocks after blockRetention for this reducer } public deleteHistoricalBlock = async (reducerKey: string, blockHash: string): Promise => { - await deleteById(this.historicalBlocks.get(reducerKey), blockHash) + await deleteById(await this.historicalBlocks.get(reducerKey), blockHash) } public deleteHistoricalBlocks = async (reducerKey: string): Promise => { - await this.historicalBlocks.get(reducerKey).destroy() + const db = await this.historicalBlocks.get(reducerKey) + await db.destroy() + this.historicalBlocks.invalidate(reducerKey) } // transaction CRUD public getAllTransactionsTo = async (reducerKey: string, toTxId: null | string): Promise => { - const res = await this.transactions.get(reducerKey).allDocs({ - include_docs: true, - endkey: toTxId, - }) - - return res.rows - .map((r) => r.doc) - .map(toJSONBlock) + const db = await this.transactions.get(reducerKey) + + return batch(db, { endkey: toTxId }, 1000, (rows) => + rows + .map((r) => r.doc) + .map(toTransaction) + .map((tx: ITransaction) => ({ + ...tx, + patches: tx.patches.map((p) => ({ + ...p, + operations: p.operations.filter(nonVolatile), + })), + })), + // ^ in memory filter against volatile operations + ) } public getLatestTransaction = async (reducerKey: string): Promise => { - const res = await this.transactions.get(reducerKey).allDocs({ + // in pouch, our ksuids aren't sorting tot he specificity we want + // so pull the last ~10 and then sort by blocknumber + const db = await this.transactions.get(reducerKey) + const res = await db.allDocs({ include_docs: true, - limit: 1, + limit: 10, + descending: true, }) if (!res.rows.length) { throw new Error(`Could not get latest transaction in ${reducerKey}`) } - return toTransaction(res.rows[0].doc) + const txs = res.rows.map((r) => r.doc).map(toTransaction) + txs.sort(sortByHexProp('blockNumber')) + + return txs[txs.length - 1] } public deleteTransaction = async (reducerKey: string, txId: string): Promise => { - await deleteById(this.transactions.get(reducerKey), txId) + await deleteById(await this.transactions.get(reducerKey), txId) } public saveTransaction = async (reducerKey: string, tx: ITransaction): Promise => { - await this.transactions.get(reducerKey).put({ + const db = await this.transactions.get(reducerKey) + await db.put({ _id: tx.id, ...tx, }) } public getTransaction = async (reducerKey: string, txId: string): Promise => { - const res = await this.transactions.get(reducerKey).get(txId) + const db = await this.transactions.get(reducerKey) + const res = await db.get(txId) return toTransaction(res) } public getTransactionByBlockHash = async (reducerKey: string, blockHash: string): Promise => { - const res = await this.transactions.get(reducerKey).find({ + const db = await this.transactions.get(reducerKey) + const res = await db.find({ selector: { blockHash: { $eq: blockHash } }, }) @@ -170,14 +240,27 @@ export default class PouchDBPersistInterface implements IPersistInterface { // setup & setdown public setup = async (): Promise => { - // databases are implicitely created and schemaless, so this fn isn't really going to do anything + try { + if (this.didSetDown) { + await (new PouchDB(reducerDb(this.dbEndpoint))).destroy() + } + this.reducers = new PouchDB(reducerDb(this.dbEndpoint)) + this.historicalBlocks = new DyanmicDict(historicalBlocksDb(this.dbEndpoint), destroyDb, this.didSetDown) + this.transactions = new DyanmicDict(transactionsDb(this.dbEndpoint), destroyDb, this.didSetDown) + } catch (error) { + throw new Error(`Instantiating PouchDBs failed: ${error.stack}`) + } } public setdown = async (): Promise => { - const dbs = await PouchDB.allDbs() - await forEach( - dbs.filter((db) => db.startsWith(GNARLY_DB_PREFIX)), - async (db) => await (new PouchDB(db)).destroy(), - ) + this.didSetDown = true + + if (this.historicalBlocks) { + this.historicalBlocks.flush() + } + + if (this.transactions) { + this.transactions.flush() + } } } diff --git a/packages/gnarly-core/src/stores/sequelize.ts b/packages/gnarly-core/src/stores/sequelize.ts index 1fd5489..22d7683 100644 --- a/packages/gnarly-core/src/stores/sequelize.ts +++ b/packages/gnarly-core/src/stores/sequelize.ts @@ -23,6 +23,7 @@ export const makeSequelizeModels = ( id: { type: DataTypes.STRING, primaryKey: true }, mid: { type: DataTypes.INTEGER, autoIncrement: true }, blockHash: { type: DataTypes.STRING }, + blockNumber: { type: DataTypes.STRING }, }, { indexes: [ { fields: ['blockHash'] }, diff --git a/packages/gnarly-reducer-block-meta/src/models/sequelize.ts b/packages/gnarly-reducer-block-meta/src/models/sequelize.ts index 7c46c76..b60b076 100644 --- a/packages/gnarly-reducer-block-meta/src/models/sequelize.ts +++ b/packages/gnarly-reducer-block-meta/src/models/sequelize.ts @@ -40,7 +40,7 @@ const sequelizeModels = ( ], }) - Block.Patch = Block.belongsTo(Patch) + Block.Patch = Block.belongsTo(Patch, { constraints: false }) return { Block, diff --git a/packages/gnarly-reducer-block-meta/src/reducer.ts b/packages/gnarly-reducer-block-meta/src/reducer.ts index 0d12b08..1553b45 100644 --- a/packages/gnarly-reducer-block-meta/src/reducer.ts +++ b/packages/gnarly-reducer-block-meta/src/reducer.ts @@ -16,8 +16,6 @@ const makeReducer = ( emitBlock: (block: Block) => { emit(appendTo('blocks', { hash: block.hash, - transactionId: block.hash, - // ^ assumes that gnarly.transactionId === block.hash number: block.number.toString(), unsafeNumber: block.number.toString(), parentHash: block.parentHash, diff --git a/packages/gnarly-reducer-erc20/src/models/sequelize.ts b/packages/gnarly-reducer-erc20/src/models/sequelize.ts index 4b30c96..b094fbe 100644 --- a/packages/gnarly-reducer-erc20/src/models/sequelize.ts +++ b/packages/gnarly-reducer-erc20/src/models/sequelize.ts @@ -26,7 +26,7 @@ const sequelizeModels = (Sequelize: any, sequelize: any) => { }, ) - ERC20Balances.belongsTo(Patch) + ERC20Balances.Patch = ERC20Balances.belongsTo(Patch, { constraints: false }) return { ERC20Balances, diff --git a/packages/gnarly-reducer-erc721/src/models/sequelize.ts b/packages/gnarly-reducer-erc721/src/models/sequelize.ts index 5ae296b..78566d5 100644 --- a/packages/gnarly-reducer-erc721/src/models/sequelize.ts +++ b/packages/gnarly-reducer-erc721/src/models/sequelize.ts @@ -37,8 +37,8 @@ const sequelizeModels = ( order: { type: DataTypes.INTEGER }, }) - ERC721Tokens.belongsTo(Patch) - ERC721TokenOwners.belongsTo(Patch) + ERC721Tokens.Patch = ERC721Tokens.belongsTo(Patch, { constraints: false }) + ERC721TokenOwners.Patch = ERC721TokenOwners.belongsTo(Patch, { constraints: false }) // token has many owners ERC721Tokens.hasMany(ERC721TokenOwners, { diff --git a/packages/gnarly-reducer-events/src/models/sequelize.ts b/packages/gnarly-reducer-events/src/models/sequelize.ts index 3ddbca1..65d0126 100644 --- a/packages/gnarly-reducer-events/src/models/sequelize.ts +++ b/packages/gnarly-reducer-events/src/models/sequelize.ts @@ -26,7 +26,7 @@ const sequelizeModels = ( ], }) - Events.Patch = Events.belongsTo(Patch) + Events.Patch = Events.belongsTo(Patch, { constraints: false }) return { Events, From 75c462ea9d0d46c49a814a7d2f37105fd419799c Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Mon, 20 Aug 2018 15:06:31 -0700 Subject: [PATCH 08/28] fix: minor fix for error formatting --- packages/gnarly-core/src/ReducerRunner.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/gnarly-core/src/ReducerRunner.ts b/packages/gnarly-core/src/ReducerRunner.ts index 3651924..5bebad6 100644 --- a/packages/gnarly-core/src/ReducerRunner.ts +++ b/packages/gnarly-core/src/ReducerRunner.ts @@ -76,7 +76,7 @@ export class ReducerRunner { try { const mostRecentHistoricalBlock = historicalBlocks[historicalBlocks.length - 1] - assert.equal( + assert.strictEqual( mostRecentHistoricalBlock.hash, latestTransaction.blockHash, `We have a latestTransaction ${latestTransaction.id} with blockHash ${latestTransaction.blockHash} @@ -84,7 +84,7 @@ export class ReducerRunner { The historical chain is: - ${historicalBlocks.map((b) => `${toBN(b.number).toString()} — ${b.hash}`).join('\n')}`, +${historicalBlocks.map((b) => `${toBN(b.number).toString()} — ${b.hash}`).join('\n')}`, ) // let's re-hydrate local state by replaying transactions From 34a2739e05b0f95346c5d95b3015ef548ddb3625 Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Mon, 20 Aug 2018 18:20:11 -0700 Subject: [PATCH 09/28] checkpoint: test reducers and historical blocks --- .gitignore | 1 + .travis.yml | 4 + packages/gnarly-core/package.json | 3 +- packages/gnarly-core/src/stores/pouchdb.ts | 68 +- packages/gnarly-core/src/stores/sequelize.ts | 3 +- .../gnarly-core/src/typeStore/Sequelize.ts | 2 +- packages/gnarly-core/src/utils.ts | 4 +- packages/gnarly-core/test/Blockstream.spec.ts | 24 +- packages/gnarly-core/test/Ourbit.spec.ts | 26 +- .../test/mocks/MockPersistInterface.ts | 10 +- .../gnarly-core/test/stores/AllStores.spec.ts | 47 + .../test/stores/PersistInterface.behavior.ts | 216 ++ packages/gnarly-core/test/utils/index.ts | 27 + yarn.lock | 2559 ++++++++++++++++- 14 files changed, 2828 insertions(+), 166 deletions(-) create mode 100644 packages/gnarly-core/test/stores/AllStores.spec.ts create mode 100644 packages/gnarly-core/test/stores/PersistInterface.behavior.ts diff --git a/.gitignore b/.gitignore index 67dff6e..5ca885d 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,4 @@ lib .nyc_output lcov.info .coveralls.yml +*.sqlite diff --git a/.travis.yml b/.travis.yml index 44c2855..c39d9b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +7,13 @@ node_js: cache: directories: - node_modules +services: + - postgresql + - couchdb matrix: fast_finish: true before_script: + - psql -c 'create database travis_ci_test;' -U postgres - lerna bootstrap - travis_retry yarn run build-ts after_success: diff --git a/packages/gnarly-core/package.json b/packages/gnarly-core/package.json index 990693e..8705906 100644 --- a/packages/gnarly-core/package.json +++ b/packages/gnarly-core/package.json @@ -34,8 +34,6 @@ "ethereumjs-blockstream": "^3.1.0", "isomorphic-fetch": "^2.2.1", "ksuid": "^1.1.2", - "lodash.identity": "^3.0.0", - "lodash.isplainobject": "^4.0.6", "moize": "^5.3.1", "number-to-bn": "^1.7.0", "p-map": "^1.2.0", @@ -64,6 +62,7 @@ "concurrently": "^3.5.1", "mocha": "^5.0.4", "nyc": "^12.0.2", + "pouchdb-server": "^4.1.0", "rosie": "^2.0.1", "source-map-support": "^0.5.6", "ts-node": "^7.0.1", diff --git a/packages/gnarly-core/src/stores/pouchdb.ts b/packages/gnarly-core/src/stores/pouchdb.ts index db04654..74bbb74 100644 --- a/packages/gnarly-core/src/stores/pouchdb.ts +++ b/packages/gnarly-core/src/stores/pouchdb.ts @@ -4,16 +4,17 @@ import PouchDB = require('pouchdb') PouchDB.plugin(require('pouchdb-upsert')) PouchDB.plugin(require('pouchdb-find')) -import KSUID = require('ksuid') -import identity = require('lodash.identity') +// import KSUID = require('ksuid') +import { identity } from 'lodash' import { IJSONBlock } from '../models/Block' import { ITransaction, } from '../ourbit/types' import { IPersistInterface } from '../stores' -import { toBN } from '../utils' +import { forEach, toBN, uuid } from '../utils' +// https://pouchdb.com/api.html#batch_fetch async function* batch ( db: PouchDB.Database, query: object = {}, @@ -42,12 +43,12 @@ async function* batch ( } } -// all databases should have --gnarly prefix so we can delete them and not destroy any user data +// all databases have --gnarly prefix so we can delete them and not destroy any user data // that might be sitting around const GNARLY_DB_PREFIX = '--gnarly' const sortByHexProp = (prop: string) => (a, b) => toBN(a[prop]).sub(toBN(b[prop])).toNumber() -const sortById = (a, b) => KSUID.parse(a._id).compare(KSUID.parse(b._id)) +// const sortById = (a, b) => KSUID.parse(a._id).compare(KSUID.parse(b._id)) const toJSONBlock = (block) => block as IJSONBlock const toTransaction = (tx) => tx as ITransaction const nonVolatile = (t) => !t.volatile @@ -56,36 +57,26 @@ const destroyDb = async (db: PouchDB.Database) => { await db.destroy() } -// const deleteWithQuery = async (db: PouchDB.Database, selector: object) => { -// const res = await db.find({ selector }) -// await db.bulkDocs(res.docs.map((d) => ({ ...d, _deleted: true }))) -// } +const deleteWithQuery = async (db: PouchDB.Database, selector: object) => { + const res = await db.find({ selector }) + await db.bulkDocs(res.docs.map((d) => ({ ...d, _deleted: true }))) +} const deleteById = async (db: PouchDB.Database, id: string) => { await db.remove(await db.get(id)) } -// // https://pouchdb.com/api.html#batch_fetch -// const prefix = (p: string) => ({ -// startkey: `${p}`, -// endkey: `${p}\ufff0`, -// }) - -// jsonpatch path is _id? -// pouchdb relies heavily on unique identifiers that operate as the primary index -// so our use of `mid` in postgres will complement this nicely - const reducerDb = (e: string) => `${e}/${GNARLY_DB_PREFIX}-reducers` -const historicalBlocksDb = (e: string) => (key: string): PouchDB.Database => +const historicalBlocksDb = (e: string) => async (key: string): Promise => new PouchDB(`${e}/${GNARLY_DB_PREFIX}-historicalblocks-${key}`) -const transactionsDb = (e: string) => (key: string): PouchDB.Database => +const transactionsDb = (e: string) => async (key: string): Promise => new PouchDB(`${e}/${GNARLY_DB_PREFIX}-transactions-${key}`) class DyanmicDict { private cache: { [_: string]: T } = {} constructor ( - private generator: (key: string) => T, + private generator: (key: string) => Promise, private resetFn: (thing: T) => Promise = identity, private resetOnFirstInitialization: boolean = false, ) { @@ -95,19 +86,22 @@ class DyanmicDict { if (this.cache[key]) { return this.cache[key] } if (this.resetOnFirstInitialization) { - await this.resetFn(this.generator(key)) + await this.resetFn(await this.generator(key)) } - this.cache[key] = this.generator(key) + this.cache[key] = await this.generator(key) return this.cache[key] } - public invalidate = (key: string) => { - this.cache[key] = undefined + public invalidate = async (key: string) => { + if (this.cache[key]) { + await this.resetFn(this.cache[key]) + this.cache[key] = undefined + } } - public flush = () => { - this.cache = {} + public flush = async () => { + await forEach(Object.keys(this.cache), (k) => this.invalidate(k)) } } @@ -148,24 +142,26 @@ export default class PouchDBPersistInterface implements IPersistInterface { public saveHistoricalBlock = async (reducerKey: string, blockRetention: number, block: IJSONBlock): Promise => { const db = await this.historicalBlocks.get(reducerKey) await db.putIfNotExists({ - _id: block.hash, + _id: uuid(), hash: block.hash, parentHash: block.parentHash, number: block.number, // ^ manually filter properties we care about from block }) - // @TODO (shrugs) - delete blocks after blockRetention for this reducer + // god, this is the worst hack ever, but I'm tired of dealing with pouchdb's weird schema + const allBlocks = await this.getHistoricalBlocks(reducerKey) + const blocksToDelete = allBlocks.slice(0, -1 * blockRetention) + // ^ all blocks before blockRetention + await db.bulkDocs(blocksToDelete.map((r) => ({ ...r, _deleted: true }))) } public deleteHistoricalBlock = async (reducerKey: string, blockHash: string): Promise => { - await deleteById(await this.historicalBlocks.get(reducerKey), blockHash) + await deleteWithQuery(await this.historicalBlocks.get(reducerKey), { hash: { $eq: blockHash } }) } public deleteHistoricalBlocks = async (reducerKey: string): Promise => { - const db = await this.historicalBlocks.get(reducerKey) - await db.destroy() - this.historicalBlocks.invalidate(reducerKey) + await this.historicalBlocks.invalidate(reducerKey) } // transaction CRUD @@ -256,11 +252,11 @@ export default class PouchDBPersistInterface implements IPersistInterface { this.didSetDown = true if (this.historicalBlocks) { - this.historicalBlocks.flush() + await this.historicalBlocks.flush() } if (this.transactions) { - this.transactions.flush() + await this.transactions.flush() } } } diff --git a/packages/gnarly-core/src/stores/sequelize.ts b/packages/gnarly-core/src/stores/sequelize.ts index 22d7683..df7e039 100644 --- a/packages/gnarly-core/src/stores/sequelize.ts +++ b/packages/gnarly-core/src/stores/sequelize.ts @@ -1,4 +1,4 @@ -import identity = require('lodash.identity') +import { identity } from 'lodash' const plain = true @@ -367,6 +367,7 @@ export default class SequelizePersistInterface implements IPersistInterface { } } + // just get the tx object, no children private getPlainTransaction = async (reducerKey: string, txId: string): Promise => { try { return (await this.Transaction.findOne({ diff --git a/packages/gnarly-core/src/typeStore/Sequelize.ts b/packages/gnarly-core/src/typeStore/Sequelize.ts index ef0c98f..f7a0869 100644 --- a/packages/gnarly-core/src/typeStore/Sequelize.ts +++ b/packages/gnarly-core/src/typeStore/Sequelize.ts @@ -1,7 +1,7 @@ import makeDebug = require('debug') const debug = makeDebug('gnarly-core:store:sequelize') -import isPlainObject = require('lodash.isplainobject') +import { isPlainObject } from 'lodash' import { IOperation, IPatch } from '../ourbit/types' import { diff --git a/packages/gnarly-core/src/utils.ts b/packages/gnarly-core/src/utils.ts index 7c51818..35a835b 100644 --- a/packages/gnarly-core/src/utils.ts +++ b/packages/gnarly-core/src/utils.ts @@ -1,7 +1,7 @@ import { Operation } from '@xlnt/fast-json-patch' import BN = require('bn.js') import KSUID = require('ksuid') -import _ = require('lodash') +import { flatMap } from 'lodash' import memoize from 'moize' import numberToBN = require('number-to-bn') import pMap = require('p-map') @@ -117,7 +117,7 @@ export const invertPatch = (patch: IPatch): IPatch => ({ export const operationsOfPatch = (patch: IPatch): IOperation[] => patch.operations export const operationsOfPatches = (patches: IPatch[]): IOperation[] => - _.flatMap(patches, operationsOfPatch) + flatMap(patches, operationsOfPatch) export const toOperation = (operation: IOperation): Operation => operation as Operation diff --git a/packages/gnarly-core/test/Blockstream.spec.ts b/packages/gnarly-core/test/Blockstream.spec.ts index 0912d18..46d2c08 100644 --- a/packages/gnarly-core/test/Blockstream.spec.ts +++ b/packages/gnarly-core/test/Blockstream.spec.ts @@ -6,31 +6,9 @@ import { globalState } from '../src/globalstate' import { IJSONBlock } from '../src/models/Block' import { forEach, timeout, toBN, toHex } from '../src/utils' -import IJSONBlockFactory from './factories/IJSONBlockFactory' import MockIngestApi from './mocks/MockIngestApi' import MockPersistInterface from './mocks/MockPersistInterface' - -const blockAfter = (block: IJSONBlock, fork: number = 1) => IJSONBlockFactory.build({ - hash: toHex(toBN(block.hash).add(toBN(1 + 10 * fork))), - number: toHex(toBN(block.number).add(toBN(1))), - parentHash: block.hash, - nonce: toHex(toBN(block.hash).add(toBN(1 + 10 * fork))), -}) - -const genesis = () => [IJSONBlockFactory.build({ - hash: '0x1', - number: '0x1', - parentHash: '0x0', - nonce: '0x1', -})] - -const buildChain = (from: IJSONBlock[], len: number = 10, fork: number = 1) => { - const chain = [...from] - for (let i = 0; i < len; i++) { - chain.push(blockAfter(chain[chain.length - 1], fork)) - } - return chain -} +import { buildChain, genesis } from './utils' const RETENTION = 20 const MOCK_REDUCER_KEY = 'test' diff --git a/packages/gnarly-core/test/Ourbit.spec.ts b/packages/gnarly-core/test/Ourbit.spec.ts index 524eea1..d50ef04 100644 --- a/packages/gnarly-core/test/Ourbit.spec.ts +++ b/packages/gnarly-core/test/Ourbit.spec.ts @@ -5,7 +5,7 @@ import { globalState } from '../src/globalstate' import * as utils from '../src/utils' import Ourbit, { - ITransaction, + ITransaction, ITxExtra, } from '../src/ourbit' import { ReducerContext } from '../src/reducer' import MockPersistInterface from './mocks/MockPersistInterface' @@ -21,6 +21,8 @@ const TEST_META = {} const TEST_UUID = utils.uuid() +const extraFor = (tx): ITxExtra => ({ blockHash: tx.blockHash, blockNumber: tx.blockNumber }) + describe('Ourbit', () => { let ourbit: Ourbit = null @@ -32,7 +34,7 @@ describe('Ourbit', () => { const produceFirstPatch = async () => { await ourbit.processTransaction(tx.id, async () => { targetState.key = 'value' - }, { blockHash: tx.blockHash }) + }, extraFor(tx)) } beforeEach(() => { @@ -46,6 +48,7 @@ describe('Ourbit', () => { tx = { id: '0x1', blockHash: '0x1', + blockNumber: '0x0', patches: [{ id: TEST_UUID, reason: undefined, @@ -80,17 +83,6 @@ describe('Ourbit', () => { globalState.store.saveTransaction.should.have.been.called.with(TEST_KEY, tx) }) - it('should process a transaction with default values', async () => { - await ourbit.processTransaction(tx.id, async () => { - targetState.key = 'value' - }) - - const txWithoutBlockHash = tx - tx.blockHash = '' - - globalState.store.saveTransaction.should.have.been.called.with(TEST_KEY, txWithoutBlockHash) - }) - it('should include a reason if provided', async () => { tx.patches[0].reason = { key: TEST_REASON, meta: TEST_META } @@ -98,7 +90,7 @@ describe('Ourbit', () => { context.because(TEST_REASON, TEST_META, () => { targetState.key = 'value' }) - }, { blockHash: tx.blockHash }) + }, extraFor(tx)) globalState.store.saveTransaction.should.have.been.called.with(TEST_KEY, tx) }) @@ -123,7 +115,7 @@ describe('Ourbit', () => { context.operation(() => { targetState.key = 'newValue' }) - }, { blockHash: tx.blockHash }) + }, extraFor(tx)) globalState.store.saveTransaction.should.have.been.called.with(TEST_KEY, tx) }) @@ -148,7 +140,7 @@ describe('Ourbit', () => { context.emit(utils.appendTo('domain', { value: 'value', })) - }, { blockHash: tx.blockHash }) + }, extraFor(tx)) globalState.store.saveTransaction.should.have.been.called.with(TEST_KEY, tx) }) @@ -159,7 +151,7 @@ describe('Ourbit', () => { await ourbit.processTransaction('0x2', async () => { targetState.key = 'newValue' - }, { blockHash: '0x2' }) + }, { blockHash: '0x2', blockNumber: '0x2' }) await ourbit.rollbackTransaction('0x2') targetState.should.deep.equal({ key: 'value' }) diff --git a/packages/gnarly-core/test/mocks/MockPersistInterface.ts b/packages/gnarly-core/test/mocks/MockPersistInterface.ts index 93b81cc..f983005 100644 --- a/packages/gnarly-core/test/mocks/MockPersistInterface.ts +++ b/packages/gnarly-core/test/mocks/MockPersistInterface.ts @@ -1,4 +1,4 @@ -import _ = require('lodash') +import { find, findIndex } from 'lodash' import { IJSONBlock } from '../../src/models/Block' import { ITransaction, @@ -76,8 +76,8 @@ export default class MockPersistInterface implements IPersistInterface { return this.transactions[this.transactions.length - 1] } - public async deleteTransaction (reducerKey: string, tx: ITransaction) { - const i = _.findIndex(this.transactions, (t) => t.id === tx.id) + public async deleteTransaction (reducerKey: string, txId: string) { + const i = findIndex(this.transactions, (t) => t.id === txId) this.transactions.splice(i, 1) return } @@ -88,10 +88,10 @@ export default class MockPersistInterface implements IPersistInterface { } public async getTransaction (reducerKey: string, txId: string): Promise { - return _.find(this.transactions, (t) => t.id === txId) + return find(this.transactions, (t) => t.id === txId) } public async getTransactionByBlockHash (reducerKey: string, blockHash: string): Promise { - return _.find(this.transactions, (t) => t.blockHash === blockHash) + return find(this.transactions, (t) => t.blockHash === blockHash) } } diff --git a/packages/gnarly-core/test/stores/AllStores.spec.ts b/packages/gnarly-core/test/stores/AllStores.spec.ts new file mode 100644 index 0000000..fde7199 --- /dev/null +++ b/packages/gnarly-core/test/stores/AllStores.spec.ts @@ -0,0 +1,47 @@ +import { exec } from 'child_process' +import Sequelize = require('sequelize') + +import PouchDBPersistInterface from '../../src/stores/pouchdb' +import SequelizePersistInterface from '../../src/stores/sequelize' +import { timeout } from '../../src/utils' + +import shouldBehaveLikePersistInterface from './PersistInterface.behavior' + +describe('All Stores', function () { + const pouchDBServerStore = new PouchDBPersistInterface('http://127.0.0.1:5985') + const defaultPouchStore = new PouchDBPersistInterface('http://127.0.0.1:5984') + + const sequelize = new Sequelize('postgres://postgres@127.0.0.1:5432/travis_ci_test', { + logging: false, + }) + const sequelizeStore = new SequelizePersistInterface(Sequelize, sequelize) + + describe('PouchDB Store (pouchdb-server)', function () { + this.timeout(9000) + before(async function () { + this.child = exec('pouchdb-server -p 5985 -m -d /tmp') + this.child.on('error', (error) => { + console.log(`child error:\n${error}`) + }) + await timeout(1000) + }) + + after(async function () { + await this.child.kill() + }) + + shouldBehaveLikePersistInterface(pouchDBServerStore) + }) + + describe('PouchDB Store (default)', function () { + this.timeout(9000) + // assumes pouchdb-server/CouchDB available on default port + shouldBehaveLikePersistInterface(defaultPouchStore) + }) + + describe.only('Sequelize Store (Postgres)', function () { + this.timeout(2000) + // assumes postgres is running locally on default port + shouldBehaveLikePersistInterface(sequelizeStore) + }) +}) diff --git a/packages/gnarly-core/test/stores/PersistInterface.behavior.ts b/packages/gnarly-core/test/stores/PersistInterface.behavior.ts new file mode 100644 index 0000000..f9e0564 --- /dev/null +++ b/packages/gnarly-core/test/stores/PersistInterface.behavior.ts @@ -0,0 +1,216 @@ +import chai = require('chai') +import { pickBy } from 'lodash' +import 'mocha' + +const should = chai + .use(require('chai-spies')) + .should() + +import { forEach } from '../../src/utils' + +import { IPersistInterface } from '../../src/stores' +import { buildChain, genesis } from '../utils' + +const MOCK_REDUCER_KEY = 'test' +const MOCK_RETENTION = 10 + +const onlyKeys = (keys: string[]) => (thing: object) => pickBy(thing, (value, key) => keys.includes(key)) + +const historialBlockKeys = [ + 'hash', + 'number', + 'parentHash', +] + +const blocksShouldEqual = (as, bs) => as.map(onlyKeys(historialBlockKeys)) + .should.deep.equal( + bs.map(onlyKeys(historialBlockKeys)), + ) + +const shouldBehaveAsStore = (store: IPersistInterface) => { + const saveAllHistoricalBlocks = async (blocks) => forEach(blocks, (block) => + store.saveHistoricalBlock(MOCK_REDUCER_KEY, MOCK_RETENTION, block), + ) + + beforeEach(async function () { + // implicitly tests setup and setdown + await store.setdown() + await store.setup() + }) + + context('reducers', function () { + describe('saveReducer', function () { + it('should save reducer information', async function () { + await store.saveReducer(MOCK_REDUCER_KEY) + }) + }) + + describe('deleteReducer', function () { + it('should delete reducer information', async function () { + await store.saveReducer(MOCK_REDUCER_KEY) + await store.deleteReducer(MOCK_REDUCER_KEY) + }) + }) + }) + + context('with reducer', function () { + beforeEach(async function () { + await store.saveReducer(MOCK_REDUCER_KEY) + }) + afterEach(async function () { + await store.deleteReducer(MOCK_REDUCER_KEY) + }) + + context('historical blocks', function () { + describe('saveHistoricalBlock & getHistoricalBlocks', function () { + beforeEach(async function () { + this.historicalBlocks = buildChain(genesis(), 8) + this.lastBlock = this.historicalBlocks[this.historicalBlocks.length - 1] + }) + + it('should return empty array if no historical blocks', async function () { + const blocks = await store.getHistoricalBlocks(MOCK_REDUCER_KEY) + blocks.length.should.equal(0) + }) + + it('should save one historical block', async function () { + await store.saveHistoricalBlock(MOCK_REDUCER_KEY, MOCK_RETENTION, this.lastBlock) + const blocks = await store.getHistoricalBlocks(MOCK_REDUCER_KEY) + blocks.length.should.equal(1) + blocksShouldEqual(blocks, [this.lastBlock]) + }) + + it('should save many historical blocks', async function () { + await saveAllHistoricalBlocks(this.historicalBlocks) + + const blocks = await store.getHistoricalBlocks(MOCK_REDUCER_KEY) + blocks.length.should.equal(this.historicalBlocks.length) + blocksShouldEqual(blocks, this.historicalBlocks) + }) + }) + + describe('deleteHistoricalBlock', function () { + beforeEach(async function () { + this.historicalBlocks = buildChain(genesis(), 8) + this.lastBlock = this.historicalBlocks[this.historicalBlocks.length - 1] + await saveAllHistoricalBlocks(this.historicalBlocks) + }) + + it('should delete a single historical block', async function () { + await store.deleteHistoricalBlock(MOCK_REDUCER_KEY, this.lastBlock.hash) + const blocks = await store.getHistoricalBlocks(MOCK_REDUCER_KEY) + blocksShouldEqual(blocks, this.historicalBlocks.slice(0, -1)) + }) + }) + + describe('deleteHistoricalBlocks', function () { + beforeEach(async function () { + this.historicalBlocks = buildChain(genesis(), 8) + await saveAllHistoricalBlocks(this.historicalBlocks) + }) + + it('should delete all historical blocks', async function () { + await store.deleteHistoricalBlocks(MOCK_REDUCER_KEY) + const blocks = await store.getHistoricalBlocks(MOCK_REDUCER_KEY) + blocks.length.should.equal(0) + }) + }) + + context('integration', function () { + context('with historical blocks below retention', async function () { + beforeEach(async function () { + this.historicalBlocks = buildChain(genesis(), MOCK_RETENTION - 1) + }) + + it('should still have the same number of blocks', async function () { + await saveAllHistoricalBlocks(this.historicalBlocks) + const blocks = await store.getHistoricalBlocks(MOCK_REDUCER_KEY) + blocks.length.should.equal(this.historicalBlocks.length) + }) + }) + + context('with historical blocks above retention', async function () { + beforeEach(async function () { + this.historicalBlocks = buildChain(genesis(), MOCK_RETENTION + 1) + }) + + it('should delete historical blocks beyond retention', async function () { + await saveAllHistoricalBlocks(this.historicalBlocks) + const blocks = await store.getHistoricalBlocks(MOCK_REDUCER_KEY) + blocks.length.should.equal(MOCK_RETENTION) + + blocksShouldEqual(blocks, this.historicalBlocks.slice(-1 * MOCK_RETENTION)) + }) + }) + + it('should go through happy path with reverts', async function () { + // save initial 8 blocks + const base = buildChain(genesis(), 6) + const fork1 = buildChain(base, 2) + const fork2 = buildChain(base, MOCK_RETENTION) + await saveAllHistoricalBlocks(fork1) + + // should be fork1 + blocksShouldEqual(await store.getHistoricalBlocks(MOCK_REDUCER_KEY), fork1) + + // delete extra fork1 blocks + await forEach(fork1.slice(-2), (block) => store.deleteHistoricalBlock(MOCK_REDUCER_KEY, block.hash)) + + // should be base + blocksShouldEqual(await store.getHistoricalBlocks(MOCK_REDUCER_KEY), base) + + // add fork2 blocks which goes above retention + await saveAllHistoricalBlocks(fork2.slice(-1 * MOCK_RETENTION)) + + // should be last retention blocks of fork2 + blocksShouldEqual(await store.getHistoricalBlocks(MOCK_REDUCER_KEY), fork2.slice(-1 * MOCK_RETENTION)) + + // nuke all of them + await store.deleteHistoricalBlocks(MOCK_REDUCER_KEY) + + // should be empty + blocksShouldEqual(await store.getHistoricalBlocks(MOCK_REDUCER_KEY), []) + }) + }) + }) + + context('transactions', function () { + describe('getAllTransactionsTo', function () { + it('should throw error when given unknown txId') + it('should return an AsyncIteratorable set of tx batches') + it('should return all transactions up to an existing txId (inclusive) ordered correctly') + it('should include patches ordered correctly') + it('should not include volatile operations') + it('should include operations ordered correctly') + }) + + describe('getLatestTransaction', function () { + it('should throw if there are no transactions') + it('should return the latest transaction') + }) + + describe('deleteTransaction', function () { + it('should not error on unknown transaction') + it('should delete a specific transaction') + }) + + describe('saveTransaction', function () { + it('should save a specific transaction') + }) + + describe('getTransaction', function () { + it('should throw error for unknown txId') + it('should return a specific transaction by id') + it('should include volatile operations') + }) + + describe('getTransactionByBlockHash', function () { + it('should throw error for unknown blockHash') + it('should return a specific transaction by blockHash') + it('should include volatile operations') + }) + }) + }) +} + +export default shouldBehaveAsStore diff --git a/packages/gnarly-core/test/utils/index.ts b/packages/gnarly-core/test/utils/index.ts index 66b334b..f06cbb8 100644 --- a/packages/gnarly-core/test/utils/index.ts +++ b/packages/gnarly-core/test/utils/index.ts @@ -1,5 +1,10 @@ import chai = require('chai') +import { IJSONBlock } from '../../src/models/Block' +import { toBN, toHex } from '../../src/utils' + +import IJSONBlockFactory from '../factories/IJSONBlockFactory' + export const expectThrow = async (p) => { try { await p @@ -8,3 +13,25 @@ export const expectThrow = async (p) => { chai.expect(true).to.equal(true) } } + +export const blockAfter = (block: IJSONBlock, fork: number = 1) => IJSONBlockFactory.build({ + hash: toHex(toBN(block.hash).add(toBN(1 + 10 * fork))), + number: toHex(toBN(block.number).add(toBN(1))), + parentHash: block.hash, + nonce: toHex(toBN(block.hash).add(toBN(1 + 10 * fork))), +}) + +export const genesis = () => [IJSONBlockFactory.build({ + hash: '0x1', + number: '0x1', + parentHash: '0x0', + nonce: '0x1', +})] + +export const buildChain = (from: IJSONBlock[], len: number = 10, fork: number = 1) => { + const chain = [...from] + for (let i = 0; i < len; i++) { + chain.push(blockAfter(chain[chain.length - 1], fork)) + } + return chain +} diff --git a/yarn.lock b/yarn.lock index bc7b2b2..7345b81 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8,6 +8,12 @@ dependencies: "@babel/highlight" "7.0.0-beta.51" +"@babel/code-frame@^7.0.0-beta.35": + version "7.0.0-rc.1" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-rc.1.tgz#5c2154415d6c09959a71845ef519d11157e95d10" + dependencies: + "@babel/highlight" "7.0.0-rc.1" + "@babel/generator@7.0.0-beta.51": version "7.0.0-beta.51" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.51.tgz#6c7575ffde761d07485e04baedc0392c6d9e30f6" @@ -46,6 +52,14 @@ esutils "^2.0.2" js-tokens "^3.0.0" +"@babel/highlight@7.0.0-rc.1": + version "7.0.0-rc.1" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-rc.1.tgz#e0ca4731fa4786f7b9500421d6ff5e5a7753e81e" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + "@babel/parser@7.0.0-beta.51": version "7.0.0-beta.51" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.0.0-beta.51.tgz#27cec2df409df60af58270ed8f6aa55409ea86f6" @@ -82,6 +96,18 @@ lodash "^4.17.5" to-fast-properties "^2.0.0" +"@gerhobbelt/linewrap@0.2.2-3": + version "0.2.2-3" + resolved "https://registry.yarnpkg.com/@gerhobbelt/linewrap/-/linewrap-0.2.2-3.tgz#49d5667922ad02bd0a37084fb8f31309a382f829" + +"@gerhobbelt/nomnom@^1.8.4-24": + version "1.8.4-24" + resolved "https://registry.yarnpkg.com/@gerhobbelt/nomnom/-/nomnom-1.8.4-24.tgz#d03a5e3093f5f68fb5217b1d1e4d7d67d017bf22" + dependencies: + "@gerhobbelt/linewrap" "0.2.2-3" + chalk "2.1.0" + exit "0.1.2" + "@lerna/add@^3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.0.0.tgz#90e660d55d18ee3f2dfd65aae5d07e0c71b29cdf" @@ -771,16 +797,32 @@ JSONStream@^1.0.4: jsonparse "^1.2.0" through ">=2.2.7 <3" +abab@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f" + abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" +abstract-leveldown@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.4.1.tgz#b3bfedb884eb693a12775f0c55e9f0a420ccee64" + dependencies: + xtend "~4.0.0" + abstract-leveldown@^4.0.0, abstract-leveldown@~4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-4.0.3.tgz#cb636f4965fbe117f5c8b76a7d51dd42aaed0580" dependencies: xtend "~4.0.0" +abstract-leveldown@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-3.0.0.tgz#5cb89f958a44f526779d740d1440e743e0c30a57" + dependencies: + xtend "~4.0.0" + abstract-leveldown@~5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz#f7128e1f86ccabf7d2893077ce5d06d798e386c6" @@ -794,6 +836,12 @@ accepts@~1.3.5: mime-types "~2.1.18" negotiator "0.6.1" +acorn-globals@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.1.0.tgz#ab716025dbe17c54d3ef81d32ece2b2d99fe2538" + dependencies: + acorn "^5.0.0" + acorn-object-rest-spread@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/acorn-object-rest-spread/-/acorn-object-rest-spread-1.1.0.tgz#78699aefdd18ec3182caadadf52e2697c048f476" @@ -808,7 +856,7 @@ acorn@^1.0.3: version "1.2.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-1.2.2.tgz#c8ce27de0acc76d896d2b1fad3df588d9e82f014" -acorn@^5.2.1: +acorn@^5.0.0, acorn@^5.2.1, acorn@^5.5.3: version "5.7.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.1.tgz#f095829297706a7c9776958c0afc8930a9b9d9d8" @@ -870,7 +918,7 @@ ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" -ansi-styles@^3.1.0, ansi-styles@^3.2.1: +ansi-styles@^3.1.0, ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" dependencies: @@ -895,7 +943,13 @@ append-transform@^0.4.0: dependencies: default-require-extensions "^1.0.0" -aproba@^1.0.3: +append-transform@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-1.0.0.tgz#046a52ae582a228bd72f58acfbe2967c678759ab" + dependencies: + default-require-extensions "^2.0.0" + +aproba@^1.0.1, aproba@^1.0.3: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" @@ -920,11 +974,17 @@ argsarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/argsarray/-/argsarray-0.0.1.tgz#6e7207b4ecdb39b0af88303fa5ae22bda8df61cb" +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" -arr-flatten@^1.1.0: +arr-flatten@^1.0.1, arr-flatten@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" @@ -936,6 +996,10 @@ array-differ@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33be402b8bb8e564bb2b5d4031" +array-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + array-find-index@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" @@ -958,6 +1022,10 @@ array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" @@ -998,6 +1066,10 @@ ast-types@0.9.6: version "0.9.6" resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.6.tgz#102c9e9e9005d3e7e3829bf0c4fa24ee862ee9b9" +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" @@ -1010,6 +1082,12 @@ async@^1.4.0: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" +async@^2.1.4: + version "2.6.1" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" + dependencies: + lodash "^4.17.10" + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -1018,6 +1096,10 @@ atob@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.1.tgz#ae2d5a729477f289d60dd7f96a6314a22dd6c22a" +attempt-x@^1.1.0, attempt-x@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/attempt-x/-/attempt-x-1.1.3.tgz#9ac844c75bca2c4e9e30d8d5c01f41eeb481a8b7" + aws-sign2@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" @@ -1034,7 +1116,7 @@ aws4@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" -babel-code-frame@^6.22.0: +babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" dependencies: @@ -1042,6 +1124,99 @@ babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.2" +babel-core@^6.0.0, babel-core@^6.26.0: + version "6.26.3" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.1" + debug "^2.6.9" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.8" + slash "^1.0.0" + source-map "^0.5.7" + +babel-generator@^6.18.0, babel-generator@^6.26.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-jest@^23.4.2: + version "23.4.2" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-23.4.2.tgz#f276de67798a5d68f2d6e87ff518c2f6e1609877" + dependencies: + babel-plugin-istanbul "^4.1.6" + babel-preset-jest "^23.2.0" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-istanbul@^4.1.6: + version "4.1.6" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz#36c59b2192efce81c5b378321b74175add1c9a45" + dependencies: + babel-plugin-syntax-object-rest-spread "^6.13.0" + find-up "^2.1.0" + istanbul-lib-instrument "^1.10.1" + test-exclude "^4.2.1" + +babel-plugin-jest-hoist@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.2.0.tgz#e61fae05a1ca8801aadee57a6d66b8cefaf44167" + +babel-plugin-syntax-object-rest-spread@^6.13.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + +babel-preset-jest@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-23.2.0.tgz#8ec7a03a138f001a1a8fb1e8113652bf1a55da46" + dependencies: + babel-plugin-jest-hoist "^23.2.0" + babel-plugin-syntax-object-rest-spread "^6.13.0" + +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + babel-runtime@6.25.0: version "6.25.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.25.0.tgz#33b98eaa5d482bb01a8d1aa6b437ad2b01aec41c" @@ -1049,6 +1224,50 @@ babel-runtime@6.25.0: core-js "^2.4.0" regenerator-runtime "^0.10.0" +babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.0.0, babel-traverse@^6.18.0, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.0.0, babel-types@^6.18.0, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" @@ -1061,6 +1280,10 @@ base62@^1.1.0: version "1.2.8" resolved "https://registry.yarnpkg.com/base62/-/base62-1.2.8.tgz#1264cb0fb848d875792877479dbe8bae6bae3428" +base64url@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/base64url/-/base64url-3.0.0.tgz#f2ba30b15f80413d88e3e6116c4f3f7f61e28a2a" + base@^0.11.1: version "0.11.2" resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" @@ -1073,6 +1296,22 @@ base@^0.11.1: mixin-deep "^1.2.0" pascalcase "^0.1.1" +basic-auth-token@^0.4.2: + version "0.4.2" + resolved "https://registry.yarnpkg.com/basic-auth-token/-/basic-auth-token-0.4.2.tgz#fc56e66e9dd69c462c3ce5ab7a6b535b35d63a56" + +basic-auth@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/basic-auth/-/basic-auth-2.0.0.tgz#015db3f353e02e56377755f962742e8981e7bbba" + dependencies: + safe-buffer "5.1.1" + +basic-authorization-header@^0.2.7: + version "0.2.7" + resolved "https://registry.yarnpkg.com/basic-authorization-header/-/basic-authorization-header-0.2.7.tgz#233c9ead813cd2074d7298b25826c086028b770d" + dependencies: + basic-auth-token "^0.4.2" + bcrypt-pbkdf@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" @@ -1100,7 +1339,7 @@ block-stream@*: dependencies: inherits "~2.0.0" -bluebird@^3.4.6, bluebird@^3.5.0: +bluebird@^3.4.6, bluebird@^3.4.7, bluebird@^3.5.0: version "3.5.1" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" @@ -1131,6 +1370,21 @@ body-parser@1.18.2, body-parser@^1.16.0: raw-body "2.3.2" type-is "~1.6.15" +body-parser@^1.16.1: + version "1.18.3" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.3.tgz#5b292198ffdd553b3a0f20ded0592b956955c8b4" + dependencies: + bytes "3.0.0" + content-type "~1.0.4" + debug "2.6.9" + depd "~1.1.2" + http-errors "~1.6.3" + iconv-lite "0.4.23" + on-finished "~2.3.0" + qs "6.5.2" + raw-body "2.3.3" + type-is "~1.6.16" + boom@2.x.x: version "2.10.1" resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" @@ -1168,6 +1422,14 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + braces@^2.3.0, braces@^2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" @@ -1187,6 +1449,16 @@ brorand@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" +browser-process-hrtime@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz#425d68a58d3447f02a04aa894187fce8af8b7b8e" + +browser-resolve@^1.11.3: + version "1.11.3" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" + dependencies: + resolve "1.1.7" + browser-stdout@1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" @@ -1197,6 +1469,12 @@ browserify-sha3@^0.0.1: dependencies: js-sha3 "^0.3.1" +bser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + dependencies: + node-int64 "^0.4.0" + buffer-alloc-unsafe@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" @@ -1216,6 +1494,12 @@ buffer-fill@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" +buffer-from@0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-0.1.1.tgz#57b18b1da0a19ec06f33837a5275a242351bd75e" + dependencies: + is-array-buffer-x "^1.0.13" + buffer-from@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.0.tgz#87fcaa3a298358e0ade6e442cfce840740d1ad04" @@ -1270,6 +1554,10 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" +cached-constructors-x@^1.0.0, cached-constructors-x@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/cached-constructors-x/-/cached-constructors-x-1.0.2.tgz#d8a7b79b43fdcf13fd861bb763f38b627b0ccf91" + caching-transform@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-1.0.1.tgz#6dbdb2f20f8d8fbce79f3e94e9d1742dcdf5c0a1" @@ -1282,6 +1570,10 @@ call-me-maybe@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" @@ -1309,6 +1601,12 @@ camelcase@^4.0.0, camelcase@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" +capture-exit@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-1.2.0.tgz#1c5fcc489fd0ab00d4f1ac7ae1072e3173fbab6f" + dependencies: + rsvp "^3.3.3" + capture-stack-trace@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz#4a6fa07399c26bba47f0b2496b4d0fb408c5550d" @@ -1511,6 +1809,10 @@ color-name@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" +colors@^1.0.3: + version "1.3.1" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.1.tgz#4accdb89cf2cabc7f982771925e9468784f32f3d" + columnify@^1.5.4: version "1.5.4" resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb" @@ -1565,10 +1867,32 @@ compare-func@^1.3.1: array-ify "^1.0.0" dot-prop "^3.0.0" +compare-versions@^3.1.0: + version "3.3.1" + resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.3.1.tgz#1ede3172b713c15f7c7beb98cb74d2d82576dad3" + component-emitter@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" +compressible@~2.0.14: + version "2.0.14" + resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.14.tgz#326c5f507fbb055f54116782b969a81b67a29da7" + dependencies: + mime-db ">= 1.34.0 < 2" + +compression@^1.6.2: + version "1.7.3" + resolved "https://registry.yarnpkg.com/compression/-/compression-1.7.3.tgz#27e0e176aaf260f7f2c2813c3e440adb9f1993db" + dependencies: + accepts "~1.3.5" + bytes "3.0.0" + compressible "~2.0.14" + debug "2.6.9" + on-headers "~1.0.1" + safe-buffer "5.1.2" + vary "~1.1.2" + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -1701,10 +2025,17 @@ conventional-recommended-bump@^2.0.6: meow "^4.0.0" q "^1.5.1" -convert-source-map@^1.5.0, convert-source-map@^1.5.1: +convert-source-map@^1.4.0, convert-source-map@^1.5.0, convert-source-map@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" +cookie-parser@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/cookie-parser/-/cookie-parser-1.4.3.tgz#0fe31fa19d000b95f4aadf1f53fdc2b8a203baa5" + dependencies: + cookie "0.3.1" + cookie-signature "1.0.6" + cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" @@ -1721,6 +2052,10 @@ core-js@^2.4.0: version "2.5.6" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.6.tgz#0fe6d45bf3cac3ac364a9d72de7576f4eb221b9d" +core-js@^2.5.0: + version "2.5.7" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" + core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -1732,6 +2067,10 @@ cors@^2.8.1: object-assign "^4" vary "^1" +corser@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/corser/-/corser-2.0.1.tgz#8eda252ecaab5840dcd975ceb90d9370c819ff87" + cosmiconfig@^5.0.2: version "5.0.6" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.0.6.tgz#dca6cf680a0bd03589aff684700858c81abeeb39" @@ -1740,6 +2079,53 @@ cosmiconfig@^5.0.2: js-yaml "^3.9.0" parse-json "^4.0.0" +couchdb-calculate-session-id@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/couchdb-calculate-session-id/-/couchdb-calculate-session-id-1.1.3.tgz#b755e2c88ce1d67170dd258b398a6665f09202ba" + dependencies: + aproba "^1.0.1" + base64url "^3.0.0" + crypto-lite "^0.2.0" + +couchdb-eval@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/couchdb-eval/-/couchdb-eval-4.1.0.tgz#ee32f9f413e0e7e3ce4d3431a1b60bad0fa1342f" + dependencies: + extend "^3.0.0" + pouchdb-plugin-error "4.1.0" + +couchdb-log-parse@^0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/couchdb-log-parse/-/couchdb-log-parse-0.0.4.tgz#7594c6a7b481effc7647c711760dfc090658a326" + +couchdb-objects@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/couchdb-objects/-/couchdb-objects-4.1.0.tgz#3735870b0a6dc2ed2a839f3545a24d5ea38c623e" + dependencies: + extend "^3.0.0" + header-case-normalizer "^1.0.3" + is-empty "^1.2.0" + pouchdb-promise "^6.4.1" + random-uuid-v4 "0.0.7" + +couchdb-render@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/couchdb-render/-/couchdb-render-4.1.0.tgz#2882e4f9b8daa6bfcb95d2d7ddb5d308524e1b66" + dependencies: + couchdb-eval "4.1.0" + couchdb-resp-completer "4.1.0" + extend "^3.0.0" + is-empty "^1.2.0" + pouchdb-plugin-error "4.1.0" + +couchdb-resp-completer@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/couchdb-resp-completer/-/couchdb-resp-completer-4.1.0.tgz#51bc69de7030c527dbde3ce6e2aa761f25403f54" + dependencies: + extend "^3.0.0" + is-empty "^1.2.0" + pouchdb-plugin-error "4.1.0" + coveralls@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.0.2.tgz#f5a0bcd90ca4e64e088b710fa8dda640aea4884f" @@ -1794,10 +2180,24 @@ cryptiles@3.x.x: dependencies: boom "5.x.x" +crypto-lite@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/crypto-lite/-/crypto-lite-0.2.0.tgz#3a14cf63038461a5eb85945de78bf04de4daaf73" + crypto-random-string@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": + version "0.3.4" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.4.tgz#8cd52e8a3acfd68d3aed38ee0a640177d2f9d797" + +cssstyle@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.1.1.tgz#18b038a9c44d65f7a8e428a653b9f6fe42faf5fb" + dependencies: + cssom "0.3.x" + currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" @@ -1816,6 +2216,14 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" +data-urls@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.0.1.tgz#d416ac3896918f29ca84d81085bc3705834da579" + dependencies: + abab "^2.0.0" + whatwg-mimetype "^2.1.0" + whatwg-url "^7.0.0" + date-fns@^1.23.0: version "1.29.0" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6" @@ -1828,7 +2236,7 @@ debug-log@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" -debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.9: +debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: @@ -1889,6 +2297,10 @@ deep-extend@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.5.1.tgz#b894a9dd90d3023fbf1c55a394fb858eb2066f1f" +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" @@ -1899,12 +2311,24 @@ default-require-extensions@^1.0.0: dependencies: strip-bom "^2.0.0" +default-require-extensions@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-2.0.0.tgz#f5f8fbb18a7d6d50b21f641f649ebb522cfe24f7" + dependencies: + strip-bom "^3.0.0" + defaults@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" dependencies: clone "^1.0.2" +deferred-leveldown@~2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-2.0.3.tgz#91fbc7699ac85f3920df035792d96d97cbf50c0f" + dependencies: + abstract-leveldown "~3.0.0" + deferred-leveldown@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-3.0.0.tgz#bff7241bf156aa3635f520bedf34330c408d3307" @@ -1956,6 +2380,10 @@ delegates@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" +denodeify@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/denodeify/-/denodeify-1.2.1.tgz#3a36287f5034e699e7577901052c2e6c94251631" + depd@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359" @@ -1968,6 +2396,12 @@ destroy@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + dependencies: + repeating "^2.0.0" + detect-indent@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" @@ -1976,6 +2410,10 @@ detect-libc@^1.0.2, detect-libc@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" +detect-newline@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" + detective@^4.3.1: version "4.7.1" resolved "https://registry.yarnpkg.com/detective/-/detective-4.7.1.tgz#0eca7314338442febb6d65da54c10bb1c82b246e" @@ -2005,6 +2443,12 @@ dom-walk@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018" +domexception@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" + dependencies: + webidl-conversions "^4.0.2" + dot-prop@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-3.0.0.tgz#1b708af094a49c9a0e7dbcad790aba539dac1177" @@ -2099,6 +2543,12 @@ end-stream@~0.1.0: dependencies: write-stream "~0.4.3" +equals@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/equals/-/equals-1.0.5.tgz#212062dde5e1a510d955f13598efcc6a621b6ace" + dependencies: + jkroso-type "1" + errno@~0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" @@ -2111,7 +2561,7 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.4.3: +es-abstract@^1.4.3, es-abstract@^1.5.1: version "1.12.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165" dependencies: @@ -2168,6 +2618,17 @@ escodegen@1.8.1: optionalDependencies: source-map "~0.2.0" +escodegen@^1.9.1: + version "1.11.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.0.tgz#b27a9389481d5bfd5bec76f7bb1eb3f8f4556589" + dependencies: + esprima "^3.1.3" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + esmangle-evaluator@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/esmangle-evaluator/-/esmangle-evaluator-1.0.1.tgz#620d866ef4861b3311f75766d52a8572bb3c6336" @@ -2188,18 +2649,22 @@ esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" +esprima@^3.1.3, esprima@~3.1.0: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + esprima@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" -esprima@~3.1.0: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - estraverse@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" +estraverse@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" @@ -2247,6 +2712,12 @@ event-stream@~3.3.0: stream-combiner "~0.0.4" through "~2.3.1" +exec-sh@^0.2.0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.2.tgz#2a5e7ffcbd7d0ba2755bdecb16e5a427dfbdec36" + dependencies: + merge "^1.2.0" + execa@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.10.0.tgz#ff456a8f53f90f8eccc71a96d11bdfc7f082cb50" @@ -2271,6 +2742,16 @@ execa@^0.7.0: signal-exit "^3.0.0" strip-eof "^1.0.0" +exit@0.1.2, exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + expand-brackets@^2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" @@ -2283,6 +2764,12 @@ expand-brackets@^2.1.4: snapdragon "^0.8.1" to-regex "^3.0.1" +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + expand-template@1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-1.0.3.tgz#6c303323177a62b1b22c070279f7861287b69b1a" @@ -2291,7 +2778,53 @@ expand-template@^1.0.2: version "1.1.1" resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-1.1.1.tgz#981f188c0c3a87d2e28f559bc541426ff94f21dd" -express@^4.14.0: +expect@^23.5.0: + version "23.5.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-23.5.0.tgz#18999a0eef8f8acf99023fde766d9c323c2562ed" + dependencies: + ansi-styles "^3.2.0" + jest-diff "^23.5.0" + jest-get-type "^22.1.0" + jest-matcher-utils "^23.5.0" + jest-message-util "^23.4.0" + jest-regex-util "^23.3.0" + +express-pouchdb@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/express-pouchdb/-/express-pouchdb-4.1.0.tgz#cc8771aa90cb252b77175a229c35054b6286e92e" + dependencies: + basic-auth "^2.0.0" + body-parser "^1.16.1" + compression "^1.6.2" + cookie-parser "^1.4.3" + denodeify "^1.2.1" + express "^4.14.1" + extend "^3.0.0" + header-case-normalizer "^1.0.3" + mkdirp "^0.5.0" + multiparty "^4.1.3" + on-finished "^2.3.0" + pouchdb-all-dbs "^1.0.2" + pouchdb-auth "4.1.0" + pouchdb-collections "^6.4.1" + pouchdb-fauxton "^0.0.6" + pouchdb-find "^6.4.1" + pouchdb-list "4.1.0" + pouchdb-promise "^6.4.1" + pouchdb-replicator "4.1.0" + pouchdb-rewrite "4.1.0" + pouchdb-security "4.1.0" + pouchdb-show "4.1.0" + pouchdb-size "4.1.0" + pouchdb-update "4.1.0" + pouchdb-validation "4.1.0" + pouchdb-vhost "4.1.0" + pouchdb-wrappers "4.1.0" + raw-body "^2.2.0" + sanitize-filename "^1.6.1" + uuid "^3.0.1" + +express@^4.14.0, express@^4.14.1: version "4.16.3" resolved "https://registry.yarnpkg.com/express/-/express-4.16.3.tgz#6af8a502350db3246ecc4becf6b5a34d22f7ed53" dependencies: @@ -2355,6 +2888,12 @@ external-editor@^2.1.0: iconv-lite "^0.4.17" tmp "^0.0.33" +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + extglob@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" @@ -2420,6 +2959,18 @@ fast-stringify@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/fast-stringify/-/fast-stringify-1.0.4.tgz#7279707663aea3efbed1d9f5da36d7adbeadf5b6" +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + dependencies: + bser "^2.0.0" + +fd-slicer@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" + dependencies: + pend "~1.2.0" + fetch-cookie@0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/fetch-cookie/-/fetch-cookie-0.7.0.tgz#a6fc137ad8363aa89125864c6451b86ecb7de802" @@ -2433,6 +2984,27 @@ figures@^2.0.0: dependencies: escape-string-regexp "^1.0.5" +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + +fileset@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0" + dependencies: + glob "^7.0.3" + minimatch "^3.0.3" + +fill-range@^2.1.0: + version "2.2.4" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^3.0.0" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + fill-range@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" @@ -2494,10 +3066,16 @@ for-each@^0.3.2: dependencies: is-function "~1.0.0" -for-in@^1.0.2: +for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + dependencies: + for-in "^1.0.1" + foreach@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" @@ -2591,7 +3169,22 @@ fsevents@^1.1.2: nan "^2.9.2" node-pre-gyp "^0.9.0" -fstream@^1.0.0, fstream@^1.0.2: +fsevents@^1.2.3: + version "1.2.4" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" + dependencies: + nan "^2.9.2" + node-pre-gyp "^0.10.0" + +fstream-ignore@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" + dependencies: + fstream "^1.0.0" + inherits "2" + minimatch "^3.0.0" + +fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: version "1.0.11" resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" dependencies: @@ -2604,6 +3197,14 @@ function-bind@^1.0.2, function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + +gar@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/gar/-/gar-1.0.3.tgz#cd6e954dff11821697a9ed5852c7ac5f18df02ce" + gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -2625,7 +3226,14 @@ get-caller-file@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" -get-func-name@^2.0.0: +get-folder-size@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-folder-size/-/get-folder-size-2.0.0.tgz#f0ecb4aa30ea855e051366714eaabcc41cf9d43f" + dependencies: + gar "^1.0.2" + tiny-each-async "2.0.3" + +get-func-name@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" @@ -2695,6 +3303,19 @@ github-from-package@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce" +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + glob-parent@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" @@ -2759,6 +3380,10 @@ globals@^11.1.0: version "11.7.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.7.0.tgz#a583faa43055b1aca771914bf68258e2fc125673" +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + globby@6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" @@ -2809,7 +3434,11 @@ growl@1.10.5, "growl@~> 1.10.0": version "1.10.5" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" -handlebars@^4.0.11, handlebars@^4.0.2: +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" + +handlebars@^4.0.11, handlebars@^4.0.2, handlebars@^4.0.3: version "4.0.11" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc" dependencies: @@ -2872,10 +3501,28 @@ has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" +has-own-property-x@^3.1.1: + version "3.2.0" + resolved "https://registry.yarnpkg.com/has-own-property-x/-/has-own-property-x-3.2.0.tgz#1c4b112a577c8cb5805469556e54b6e959e4ded9" + dependencies: + cached-constructors-x "^1.0.0" + to-object-x "^1.5.0" + to-property-key-x "^2.0.2" + +has-symbol-support-x@^1.4.1, has-symbol-support-x@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" + has-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" +has-to-string-tag-x@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d" + dependencies: + has-symbol-support-x "^1.4.1" + has-unicode@^2.0.0, has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -2920,7 +3567,7 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.0" -hawk@~3.1.3: +hawk@3.1.3, hawk@~3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" dependencies: @@ -2942,6 +3589,10 @@ he@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" +header-case-normalizer@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/header-case-normalizer/-/header-case-normalizer-1.0.3.tgz#fb1d4c8d0c6169dcab4f7c7e21b186a6a22ac0c1" + hmac-drbg@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" @@ -2958,6 +3609,13 @@ hoek@4.x.x: version "4.2.1" resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + hosted-git-info@^2.1.4: version "2.6.0" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.6.0.tgz#23235b29ab230c576aab0d4f13fc046b0b038222" @@ -2966,6 +3624,12 @@ hosted-git-info@^2.6.0: version "2.7.1" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" +html-encoding-sniffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" + dependencies: + whatwg-encoding "^1.0.1" + http-errors@1.6.2: version "1.6.2" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736" @@ -2975,7 +3639,7 @@ http-errors@1.6.2: setprototypeof "1.0.3" statuses ">= 1.3.1 < 2" -http-errors@~1.6.2: +http-errors@1.6.3, http-errors@~1.6.2, http-errors@~1.6.3: version "1.6.3" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" dependencies: @@ -2984,6 +3648,26 @@ http-errors@~1.6.2: setprototypeof "1.1.0" statuses ">= 1.4.0 < 2" +http-errors@~1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.0.tgz#b6d36492a201c7888bdcb5dd0471140423c4ad2a" + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.0" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +http-pouchdb@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/http-pouchdb/-/http-pouchdb-4.1.0.tgz#d73c5551a6c8fa6cb4124f758b00428a81049622" + dependencies: + basic-authorization-header "^0.2.7" + bluebird "^3.4.7" + extend "^3.0.0" + pouchdb-wrappers "4.1.0" + xhr2 "^0.1.3" + http-signature@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" @@ -3004,15 +3688,15 @@ iconv-lite@0.4.19: version "0.4.19" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" -iconv-lite@^0.4.17, iconv-lite@^0.4.4, iconv-lite@~0.4.13: - version "0.4.22" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.22.tgz#c6b16b9d05bc6c307dc9303a820412995d2eea95" +iconv-lite@0.4.23, iconv-lite@^0.4.5: + version "0.4.23" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" dependencies: safer-buffer ">= 2.1.2 < 3" -iconv-lite@^0.4.5: - version "0.4.23" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" +iconv-lite@^0.4.17, iconv-lite@^0.4.4, iconv-lite@~0.4.13: + version "0.4.22" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.22.tgz#c6b16b9d05bc6c307dc9303a820412995d2eea95" dependencies: safer-buffer ">= 2.1.2 < 3" @@ -3034,6 +3718,10 @@ immediate@3.0.6, immediate@~3.0.5: version "3.0.6" resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" +immediate@^3.2.2, immediate@^3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.2.3.tgz#d140fa8f614659bd6541233097ddaac25cdd991c" + immutable@3.8.2: version "3.8.2" resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.2.tgz#c2439951455bb39913daf281376f1530e104adf3" @@ -3067,6 +3755,10 @@ indent-string@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" +infinity-x@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/infinity-x/-/infinity-x-1.0.2.tgz#374a4d5c8a9b98d2f61b782fc63892598de2f14c" + inflection@1.12.0: version "1.12.0" resolved "https://registry.yarnpkg.com/inflection/-/inflection-1.12.0.tgz#a200935656d6f5f6bc4dc7502e1aecb703228416" @@ -3124,7 +3816,7 @@ inquirer@^5.1.0: strip-ansi "^4.0.0" through "^2.3.6" -invariant@^2.2.0: +invariant@^2.2.0, invariant@^2.2.2, invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" dependencies: @@ -3157,6 +3849,16 @@ is-accessor-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" +is-array-buffer-x@^1.0.13: + version "1.7.0" + resolved "https://registry.yarnpkg.com/is-array-buffer-x/-/is-array-buffer-x-1.7.0.tgz#4b0b10427b64aa3437767adf4fc07702c59b2371" + dependencies: + attempt-x "^1.1.0" + has-to-string-tag-x "^1.4.1" + is-object-like-x "^1.5.1" + object-get-own-property-descriptor-x "^3.2.0" + to-string-tag-x "^1.4.1" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -3227,6 +3929,20 @@ is-directory@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + +is-empty@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/is-empty/-/is-empty-1.2.0.tgz#de9bb5b278738a05a0b09a57e1fb4d4a341a9f6b" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -3237,10 +3953,27 @@ is-extendable@^1.0.1: dependencies: is-plain-object "^2.0.4" +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" +is-falsey-x@^1.0.0, is-falsey-x@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-falsey-x/-/is-falsey-x-1.0.3.tgz#d8bb6d77c15fb2b99d81d10a7351641495fb36e2" + dependencies: + to-boolean-x "^1.0.2" + +is-finite-x@^3.0.2: + version "3.0.4" + resolved "https://registry.yarnpkg.com/is-finite-x/-/is-finite-x-3.0.4.tgz#320c97bab8aacc7e3cfa34aa58c432762c491b4e" + dependencies: + infinity-x "^1.0.1" + is-nan-x "^1.0.2" + is-finite@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" @@ -3257,10 +3990,33 @@ is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" +is-function-x@^3.2.0, is-function-x@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/is-function-x/-/is-function-x-3.3.0.tgz#7d16bc113853db206d5e40a8b32caf99bd4ff7c0" + dependencies: + attempt-x "^1.1.1" + has-to-string-tag-x "^1.4.1" + is-falsey-x "^1.0.1" + is-primitive "^2.0.0" + normalize-space-x "^3.0.0" + replace-comments-x "^2.0.0" + to-boolean-x "^1.0.1" + to-string-tag-x "^1.4.2" + is-function@^1.0.1, is-function@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" +is-generator-fn@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-1.0.0.tgz#969d49e1bb3329f6bb7f09089be26578b2ddd46a" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + is-glob@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" @@ -3277,6 +4033,16 @@ is-hex-prefixed@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" +is-index-x@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-index-x/-/is-index-x-1.1.0.tgz#43dac97b3a04f30191530833f45ac35001682ee2" + dependencies: + math-clamp-x "^1.2.0" + max-safe-integer "^1.0.1" + to-integer-x "^3.0.0" + to-number-x "^2.0.0" + to-string-symbols-supported-x "^1.0.0" + is-installed-globally@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.1.0.tgz#0dfd98f5a9111716dd535dda6492f67bf3d25a80" @@ -3284,14 +4050,31 @@ is-installed-globally@^0.1.0: global-dirs "^0.1.0" is-path-inside "^1.0.0" +is-nan-x@^1.0.1, is-nan-x@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-nan-x/-/is-nan-x-1.0.3.tgz#1c7fca40fc1b830a36e8800b37513a81f91fcc58" + is-negated-glob@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-negated-glob/-/is-negated-glob-1.0.0.tgz#6910bca5da8c95e784b5751b976cf5a10fee36d2" +is-nil-x@^1.4.1, is-nil-x@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/is-nil-x/-/is-nil-x-1.4.2.tgz#a45e798d1e490d38db4570f2457245da21493e97" + dependencies: + lodash.isnull "^3.0.0" + validate.io-undefined "^1.0.3" + is-npm@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" @@ -3306,6 +4089,13 @@ is-obj@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" +is-object-like-x@^1.5.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/is-object-like-x/-/is-object-like-x-1.7.1.tgz#f440ce811fb31278e4ed0b34f2d5a277d87b4481" + dependencies: + is-function-x "^3.3.0" + is-primitive "^3.0.0" + is-odd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-2.0.0.tgz#7646624671fd7ea558ccd9a2795182f2958f1b24" @@ -3328,6 +4118,18 @@ is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + +is-primitive@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-3.0.1.tgz#98c4db1abff185485a657fc2905052b940524d05" + is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" @@ -3356,6 +4158,10 @@ is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" +is-string@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.4.tgz#cc3a9b69857d621e963725a24caeec873b826e64" + is-subset@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" @@ -3425,6 +4231,23 @@ isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" +istanbul-api@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.3.1.tgz#4c3b05d18c0016d1022e079b98dc82c40f488954" + dependencies: + async "^2.1.4" + compare-versions "^3.1.0" + fileset "^2.0.2" + istanbul-lib-coverage "^1.2.0" + istanbul-lib-hook "^1.2.0" + istanbul-lib-instrument "^1.10.1" + istanbul-lib-report "^1.1.4" + istanbul-lib-source-maps "^1.2.4" + istanbul-reports "^1.3.0" + js-yaml "^3.7.0" + mkdirp "^0.5.1" + once "^1.4.0" + istanbul-lib-coverage@^1.1.2, istanbul-lib-coverage@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz#f7d8f2e42b97e37fe796114cb0f9d68b5e3a4341" @@ -3439,6 +4262,24 @@ istanbul-lib-hook@^1.1.0: dependencies: append-transform "^0.4.0" +istanbul-lib-hook@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.2.1.tgz#f614ec45287b2a8fc4f07f5660af787575601805" + dependencies: + append-transform "^1.0.0" + +istanbul-lib-instrument@^1.10.1: + version "1.10.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz#724b4b6caceba8692d3f1f9d0727e279c401af7b" + dependencies: + babel-generator "^6.18.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + babylon "^6.18.0" + istanbul-lib-coverage "^1.2.0" + semver "^5.3.0" + istanbul-lib-instrument@^2.1.0: version "2.3.2" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-2.3.2.tgz#b287cbae2b5f65f3567b05e2e29b275eaf92d25e" @@ -3460,7 +4301,16 @@ istanbul-lib-report@^1.1.3: path-parse "^1.0.5" supports-color "^3.1.2" -istanbul-lib-source-maps@^1.2.5: +istanbul-lib-report@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.4.tgz#e886cdf505c4ebbd8e099e4396a90d0a28e2acb5" + dependencies: + istanbul-lib-coverage "^1.2.0" + mkdirp "^0.5.1" + path-parse "^1.0.5" + supports-color "^3.1.2" + +istanbul-lib-source-maps@^1.2.4, istanbul-lib-source-maps@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.5.tgz#ffe6be4e7ab86d3603e4290d54990b14506fc9b1" dependencies: @@ -3470,12 +4320,312 @@ istanbul-lib-source-maps@^1.2.5: rimraf "^2.6.1" source-map "^0.5.3" +istanbul-reports@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.3.0.tgz#2f322e81e1d9520767597dca3c20a0cce89a3554" + dependencies: + handlebars "^4.0.3" + istanbul-reports@^1.4.1: version "1.5.0" resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.5.0.tgz#c6c2867fa65f59eb7dcedb7f845dfc76aaee70f9" dependencies: handlebars "^4.0.11" +jest-changed-files@^23.4.2: + version "23.4.2" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-23.4.2.tgz#1eed688370cd5eebafe4ae93d34bb3b64968fe83" + dependencies: + throat "^4.0.0" + +jest-cli@^23.5.0: + version "23.5.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-23.5.0.tgz#d316b8e34a38a610a1efc4f0403d8ef8a55e4492" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.2" + graceful-fs "^4.1.11" + import-local "^1.0.0" + is-ci "^1.0.10" + istanbul-api "^1.3.1" + istanbul-lib-coverage "^1.2.0" + istanbul-lib-instrument "^1.10.1" + istanbul-lib-source-maps "^1.2.4" + jest-changed-files "^23.4.2" + jest-config "^23.5.0" + jest-environment-jsdom "^23.4.0" + jest-get-type "^22.1.0" + jest-haste-map "^23.5.0" + jest-message-util "^23.4.0" + jest-regex-util "^23.3.0" + jest-resolve-dependencies "^23.5.0" + jest-runner "^23.5.0" + jest-runtime "^23.5.0" + jest-snapshot "^23.5.0" + jest-util "^23.4.0" + jest-validate "^23.5.0" + jest-watcher "^23.4.0" + jest-worker "^23.2.0" + micromatch "^2.3.11" + node-notifier "^5.2.1" + prompts "^0.1.9" + realpath-native "^1.0.0" + rimraf "^2.5.4" + slash "^1.0.0" + string-length "^2.0.0" + strip-ansi "^4.0.0" + which "^1.2.12" + yargs "^11.0.0" + +jest-config@^23.5.0: + version "23.5.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-23.5.0.tgz#3770fba03f7507ee15f3b8867c742e48f31a9773" + dependencies: + babel-core "^6.0.0" + babel-jest "^23.4.2" + chalk "^2.0.1" + glob "^7.1.1" + jest-environment-jsdom "^23.4.0" + jest-environment-node "^23.4.0" + jest-get-type "^22.1.0" + jest-jasmine2 "^23.5.0" + jest-regex-util "^23.3.0" + jest-resolve "^23.5.0" + jest-util "^23.4.0" + jest-validate "^23.5.0" + micromatch "^2.3.11" + pretty-format "^23.5.0" + +jest-diff@^23.5.0: + version "23.5.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-23.5.0.tgz#250651a433dd0050290a07642946cc9baaf06fba" + dependencies: + chalk "^2.0.1" + diff "^3.2.0" + jest-get-type "^22.1.0" + pretty-format "^23.5.0" + +jest-docblock@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-23.2.0.tgz#f085e1f18548d99fdd69b20207e6fd55d91383a7" + dependencies: + detect-newline "^2.1.0" + +jest-each@^23.5.0: + version "23.5.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-23.5.0.tgz#77f7e2afe6132a80954b920006e78239862b10ba" + dependencies: + chalk "^2.0.1" + pretty-format "^23.5.0" + +jest-environment-jsdom@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-23.4.0.tgz#056a7952b3fea513ac62a140a2c368c79d9e6023" + dependencies: + jest-mock "^23.2.0" + jest-util "^23.4.0" + jsdom "^11.5.1" + +jest-environment-node@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-23.4.0.tgz#57e80ed0841dea303167cce8cd79521debafde10" + dependencies: + jest-mock "^23.2.0" + jest-util "^23.4.0" + +jest-get-type@^22.1.0: + version "22.4.3" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.4.3.tgz#e3a8504d8479342dd4420236b322869f18900ce4" + +jest-haste-map@^23.5.0: + version "23.5.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-23.5.0.tgz#d4ca618188bd38caa6cb20349ce6610e194a8065" + dependencies: + fb-watchman "^2.0.0" + graceful-fs "^4.1.11" + invariant "^2.2.4" + jest-docblock "^23.2.0" + jest-serializer "^23.0.1" + jest-worker "^23.2.0" + micromatch "^2.3.11" + sane "^2.0.0" + +jest-jasmine2@^23.5.0: + version "23.5.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-23.5.0.tgz#05fe7f1788e650eeb5a03929e6461ea2e9f3db53" + dependencies: + babel-traverse "^6.0.0" + chalk "^2.0.1" + co "^4.6.0" + expect "^23.5.0" + is-generator-fn "^1.0.0" + jest-diff "^23.5.0" + jest-each "^23.5.0" + jest-matcher-utils "^23.5.0" + jest-message-util "^23.4.0" + jest-snapshot "^23.5.0" + jest-util "^23.4.0" + pretty-format "^23.5.0" + +jest-leak-detector@^23.5.0: + version "23.5.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-23.5.0.tgz#14ac2a785bd625160a2ea968fd5d98b7dcea3e64" + dependencies: + pretty-format "^23.5.0" + +jest-matcher-utils@^23.5.0: + version "23.5.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-23.5.0.tgz#0e2ea67744cab78c9ab15011c4d888bdd3e49e2a" + dependencies: + chalk "^2.0.1" + jest-get-type "^22.1.0" + pretty-format "^23.5.0" + +jest-message-util@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-23.4.0.tgz#17610c50942349508d01a3d1e0bda2c079086a9f" + dependencies: + "@babel/code-frame" "^7.0.0-beta.35" + chalk "^2.0.1" + micromatch "^2.3.11" + slash "^1.0.0" + stack-utils "^1.0.1" + +jest-mock@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-23.2.0.tgz#ad1c60f29e8719d47c26e1138098b6d18b261134" + +jest-regex-util@^23.3.0: + version "23.3.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-23.3.0.tgz#5f86729547c2785c4002ceaa8f849fe8ca471bc5" + +jest-resolve-dependencies@^23.5.0: + version "23.5.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-23.5.0.tgz#10c4d135beb9d2256de1fedc7094916c3ad74af7" + dependencies: + jest-regex-util "^23.3.0" + jest-snapshot "^23.5.0" + +jest-resolve@^23.5.0: + version "23.5.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-23.5.0.tgz#3b8e7f67e84598f0caf63d1530bd8534a189d0e6" + dependencies: + browser-resolve "^1.11.3" + chalk "^2.0.1" + realpath-native "^1.0.0" + +jest-runner@^23.5.0: + version "23.5.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-23.5.0.tgz#570f7a044da91648b5bb9b6baacdd511076c71d7" + dependencies: + exit "^0.1.2" + graceful-fs "^4.1.11" + jest-config "^23.5.0" + jest-docblock "^23.2.0" + jest-haste-map "^23.5.0" + jest-jasmine2 "^23.5.0" + jest-leak-detector "^23.5.0" + jest-message-util "^23.4.0" + jest-runtime "^23.5.0" + jest-util "^23.4.0" + jest-worker "^23.2.0" + source-map-support "^0.5.6" + throat "^4.0.0" + +jest-runtime@^23.5.0: + version "23.5.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-23.5.0.tgz#eb503525a196dc32f2f9974e3482d26bdf7b63ce" + dependencies: + babel-core "^6.0.0" + babel-plugin-istanbul "^4.1.6" + chalk "^2.0.1" + convert-source-map "^1.4.0" + exit "^0.1.2" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.1.11" + jest-config "^23.5.0" + jest-haste-map "^23.5.0" + jest-message-util "^23.4.0" + jest-regex-util "^23.3.0" + jest-resolve "^23.5.0" + jest-snapshot "^23.5.0" + jest-util "^23.4.0" + jest-validate "^23.5.0" + micromatch "^2.3.11" + realpath-native "^1.0.0" + slash "^1.0.0" + strip-bom "3.0.0" + write-file-atomic "^2.1.0" + yargs "^11.0.0" + +jest-serializer@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-23.0.1.tgz#a3776aeb311e90fe83fab9e533e85102bd164165" + +jest-snapshot@^23.5.0: + version "23.5.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-23.5.0.tgz#cc368ebd8513e1175e2a7277f37a801b7358ae79" + dependencies: + babel-types "^6.0.0" + chalk "^2.0.1" + jest-diff "^23.5.0" + jest-matcher-utils "^23.5.0" + jest-message-util "^23.4.0" + jest-resolve "^23.5.0" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + pretty-format "^23.5.0" + semver "^5.5.0" + +jest-util@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-23.4.0.tgz#4d063cb927baf0a23831ff61bec2cbbf49793561" + dependencies: + callsites "^2.0.0" + chalk "^2.0.1" + graceful-fs "^4.1.11" + is-ci "^1.0.10" + jest-message-util "^23.4.0" + mkdirp "^0.5.1" + slash "^1.0.0" + source-map "^0.6.0" + +jest-validate@^23.5.0: + version "23.5.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.5.0.tgz#f5df8f761cf43155e1b2e21d6e9de8a2852d0231" + dependencies: + chalk "^2.0.1" + jest-get-type "^22.1.0" + leven "^2.1.0" + pretty-format "^23.5.0" + +jest-watcher@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-23.4.0.tgz#d2e28ce74f8dad6c6afc922b92cabef6ed05c91c" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.1" + string-length "^2.0.0" + +jest-worker@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-23.2.0.tgz#faf706a8da36fae60eb26957257fa7b5d8ea02b9" + dependencies: + merge-stream "^1.0.1" + +jest@^23.1.0: + version "23.5.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-23.5.0.tgz#80de353d156ea5ea4a7332f7962ac79135fbc62e" + dependencies: + import-local "^1.0.0" + jest-cli "^23.5.0" + +jkroso-type@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/jkroso-type/-/jkroso-type-1.1.1.tgz#bc4ced6d6c45fe0745282bafc86a9f8c4fc9ce61" + js-sha3@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.3.1.tgz#86122802142f0828502a0d1dee1d95e253bb0243" @@ -3506,6 +4656,41 @@ jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" +jsdom@^11.5.1: + version "11.12.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8" + dependencies: + abab "^2.0.0" + acorn "^5.5.3" + acorn-globals "^4.1.0" + array-equal "^1.0.0" + cssom ">= 0.3.2 < 0.4.0" + cssstyle "^1.0.0" + data-urls "^1.0.0" + domexception "^1.0.1" + escodegen "^1.9.1" + html-encoding-sniffer "^1.0.2" + left-pad "^1.3.0" + nwsapi "^2.0.7" + parse5 "4.0.0" + pn "^1.1.0" + request "^2.87.0" + request-promise-native "^1.0.5" + sax "^1.2.4" + symbol-tree "^3.2.2" + tough-cookie "^2.3.4" + w3c-hr-time "^1.0.1" + webidl-conversions "^4.0.2" + whatwg-encoding "^1.0.3" + whatwg-mimetype "^2.1.0" + whatwg-url "^6.4.1" + ws "^5.2.0" + xml-name-validator "^3.0.0" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + jsesc@^2.5.1: version "2.5.1" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe" @@ -3532,6 +4717,10 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" +json5@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + jsonfile@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-3.0.1.tgz#a5ecc6f65f53f662c4415c7675a0331d0992ec66" @@ -3586,6 +4775,10 @@ keccakjs@^0.2.1: browserify-sha3 "^0.0.1" sha3 "^1.1.0" +killable@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.0.tgz#da8b84bd47de5395878f95d64d02f2449fe05e6b" + kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -3606,6 +4799,10 @@ kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" +kleur@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-2.0.1.tgz#7cc64b0d188d0dcbc98bdcdfdda2cc10619ddce8" + ksuid@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/ksuid/-/ksuid-1.1.2.tgz#582ab1bc9fe36e6b9ff3c0fd85c76c67132150ec" @@ -3652,6 +4849,10 @@ lead@^1.0.0: dependencies: flush-write-stream "^1.0.2" +left-pad@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" + lerna@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/lerna/-/lerna-3.0.3.tgz#130b98e51ac4d2889fad7a753f934ddd4440072f" @@ -3701,6 +4902,13 @@ level-write-stream@1.0.0: dependencies: end-stream "~0.1.0" +level@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/level/-/level-2.1.1.tgz#6c9d459dc6a417ef1f53c58e3cb23180b0734926" + dependencies: + level-packager "^2.0.2" + leveldown "^2.1.1" + level@3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/level/-/level-3.0.2.tgz#83c3d6e48c9e89abc4b6f5ca1c591f177ea2bd59" @@ -3709,6 +4917,16 @@ level@3.0.2: leveldown "^3.0.0" opencollective-postinstall "^2.0.0" +leveldown@2.1.1, leveldown@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/leveldown/-/leveldown-2.1.1.tgz#2f4d786dfe6ba3ecc63409784ce29eca110413bf" + dependencies: + abstract-leveldown "~3.0.0" + bindings "~1.3.0" + fast-future "~1.0.2" + nan "~2.8.0" + prebuild-install "^2.1.0" + leveldown@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/leveldown/-/leveldown-3.0.0.tgz#a42ef5d4029f88ba538ed8da3e6c34c5b008ddd7" @@ -3729,6 +4947,15 @@ leveldown@^3.0.0: nan "~2.10.0" prebuild-install "^4.0.0" +levelup@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/levelup/-/levelup-2.0.1.tgz#3dc91b3e632d37c9e546239c864118b004c9f860" + dependencies: + deferred-leveldown "~2.0.2" + level-errors "~1.1.0" + level-iterator-stream "~2.0.0" + xtend "~4.0.0" + levelup@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/levelup/-/levelup-3.0.1.tgz#07794639fd0af185089130aaea09d03023637b8d" @@ -3747,6 +4974,10 @@ levelup@^2.0.0: level-iterator-stream "~2.0.0" xtend "~4.0.0" +leven@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" @@ -3806,13 +5037,13 @@ lodash._reinterpolate@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" -lodash.identity@^3.0.0: +lodash.isnull@^3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash.identity/-/lodash.identity-3.0.0.tgz#ad7bc6a4e647d79c972e1b80feef7af156267876" + resolved "https://registry.yarnpkg.com/lodash.isnull/-/lodash.isnull-3.0.0.tgz#fafbe59ea1dca27eed786534039dd84c2e07c56e" -lodash.isplainobject@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" +lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" lodash.template@^4.0.2: version "4.4.0" @@ -3827,7 +5058,7 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "~3.0.0" -lodash@^4.17.1, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.5.1: +lodash@^4.13.1, lodash@^4.17.1, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.5.1: version "4.17.10" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" @@ -3863,10 +5094,18 @@ lru-cache@^4.0.1: pseudomap "^1.0.2" yallist "^2.1.2" +ltgt@2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.0.tgz#b65ba5fcb349a29924c8e333f7c6a5562f2e4842" + ltgt@2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5" +ltgt@~2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.1.3.tgz#10851a06d9964b971178441c23c9e52698eece34" + make-dir@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.2.0.tgz#6d6a49eead4aae296c53bbf3a1a008bd6c89469b" @@ -3877,6 +5116,12 @@ make-error@^1.1.1: version "1.3.4" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.4.tgz#19978ed575f9e9545d2ff8c13e33b5d18a67d535" +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + dependencies: + tmpl "1.0.x" + map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" @@ -3899,11 +5144,32 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" -md5-hex@^1.2.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-1.3.0.tgz#d2c4afe983c4370662179b8cad145219135046c4" +math-clamp-x@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/math-clamp-x/-/math-clamp-x-1.2.0.tgz#8b537be0645bbba7ee73ee16091e7d6018c5edcf" dependencies: - md5-o-matic "^0.1.1" + to-number-x "^2.0.0" + +math-random@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" + +math-sign-x@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/math-sign-x/-/math-sign-x-3.0.0.tgz#d5286022b48e150c384729a86042e0835264c3ed" + dependencies: + is-nan-x "^1.0.1" + to-number-x "^2.0.0" + +max-safe-integer@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/max-safe-integer/-/max-safe-integer-1.0.1.tgz#f38060be2c563d8c02e6d48af39122fd83b6f410" + +md5-hex@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-1.3.0.tgz#d2c4afe983c4370662179b8cad145219135046c4" + dependencies: + md5-o-matic "^0.1.1" md5-o-matic@^0.1.1: version "0.1.1" @@ -3919,6 +5185,16 @@ mem@^1.1.0: dependencies: mimic-fn "^1.0.0" +memdown@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/memdown/-/memdown-1.2.4.tgz#cd9a34aaf074d53445a271108eb4b8dd4ec0f27f" + dependencies: + abstract-leveldown "2.4.1" + functional-red-black-tree "^1.0.1" + immediate "^3.2.3" + inherits "~2.0.1" + ltgt "~2.1.3" + meow@^3.3.0: version "3.7.0" resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" @@ -3958,10 +5234,20 @@ merge-source-map@^1.1.0: dependencies: source-map "^0.6.1" +merge-stream@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" + dependencies: + readable-stream "^2.0.1" + merge2@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.2.tgz#03212e3da8d86c4d8523cebd6318193414f94e34" +merge@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" + methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" @@ -3970,6 +5256,24 @@ micro-memoize@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/micro-memoize/-/micro-memoize-2.0.3.tgz#5122131971eae6c69249a8a63a91b7b5cee20111" +micromatch@^2.3.11: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -3988,6 +5292,10 @@ micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: snapdragon "^0.8.1" to-regex "^3.0.2" +"mime-db@>= 1.34.0 < 2": + version "1.36.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.36.0.tgz#5020478db3c7fe93aad7bbcc4dcf869c43363397" + mime-db@~1.33.0: version "1.33.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db" @@ -4034,7 +5342,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" -"minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4: +"minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: @@ -4051,7 +5359,7 @@ minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@1.2.0, minimist@^1.1.3, minimist@^1.2.0: +minimist@1.2.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" @@ -4147,6 +5455,10 @@ ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" +ms@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + multimatch@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b" @@ -4156,6 +5468,15 @@ multimatch@^2.1.0: arrify "^1.0.0" minimatch "^3.0.0" +multiparty@^4.1.3: + version "4.2.1" + resolved "https://registry.yarnpkg.com/multiparty/-/multiparty-4.2.1.tgz#d9b6c46d8b8deab1ee70c734b0af771dd46e0b13" + dependencies: + fd-slicer "1.1.0" + http-errors "~1.7.0" + safe-buffer "5.1.2" + uid-safe "2.1.5" + multistream@2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/multistream/-/multistream-2.1.0.tgz#625c267d5c44424ad6294788b5bb4da3dcb32f1d" @@ -4167,10 +5488,18 @@ mute-stream@0.0.7, mute-stream@~0.0.4: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" +nan-x@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/nan-x/-/nan-x-1.0.2.tgz#5f34e9d3115242486219eee3c8bc49fd2425b19a" + nan@2.10.0, nan@^2.9.2, nan@~2.10.0: version "2.10.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" +nan@~2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.7.0.tgz#d95bf721ec877e08db276ed3fc6eb78f9083ad46" + nan@~2.8.0: version "2.8.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.8.0.tgz#ed715f3fe9de02b57a5e6252d90a96675e1f085a" @@ -4196,6 +5525,10 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + needle@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.1.tgz#b5e325bd3aae8c2678902fa296f729455d1d3a7d" @@ -4204,6 +5537,14 @@ needle@^2.2.0: iconv-lite "^0.4.4" sax "^1.2.4" +needle@^2.2.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.2.tgz#1120ca4c41f2fcc6976fd28a8968afe239929418" + dependencies: + debug "^2.1.2" + iconv-lite "^0.4.4" + sax "^1.2.4" + negotiator@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" @@ -4246,6 +5587,34 @@ node-gyp@^3.6.2: tar "^2.0.0" which "1" +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + +node-notifier@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.2.1.tgz#fa313dd08f5517db0e2502e5758d664ac69f9dea" + dependencies: + growly "^1.3.0" + semver "^5.4.1" + shellwords "^0.1.1" + which "^1.3.0" + +node-pre-gyp@^0.10.0: + version "0.10.3" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.1" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.2.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + node-pre-gyp@^0.9.0: version "0.9.1" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.9.1.tgz#f11c07516dd92f87199dbc7e1838eab7cd56c9e0" @@ -4261,6 +5630,22 @@ node-pre-gyp@^0.9.0: semver "^5.3.0" tar "^4" +node-pre-gyp@~0.6.38: + version "0.6.39" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz#c00e96860b23c0e1420ac7befc5044e1d78d8649" + dependencies: + detect-libc "^1.0.2" + hawk "3.1.3" + mkdirp "^0.5.1" + nopt "^4.0.1" + npmlog "^4.0.2" + rc "^1.1.7" + request "2.81.0" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^2.2.1" + tar-pack "^3.4.0" + nodemon@^1.14.12: version "1.17.4" resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-1.17.4.tgz#243ff9c69ffbf1175f2460f9b023f35a072c15e9" @@ -4276,6 +5661,10 @@ nodemon@^1.14.12: undefsafe "^2.0.2" update-notifier "^2.3.0" +noop-fn@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/noop-fn/-/noop-fn-1.0.0.tgz#5f33d47f13d2150df93e0cb036699e982f78ffbf" + noop-logger@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/noop-logger/-/noop-logger-0.1.1.tgz#94a2b1633c4f1317553007d8966fd0e841b6a4c2" @@ -4308,12 +5697,20 @@ normalize-package-data@^2.0.0, normalize-package-data@^2.3.0, normalize-package- semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -normalize-path@^2.1.1: +normalize-path@^2.0.1, normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" dependencies: remove-trailing-separator "^1.0.1" +normalize-space-x@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-space-x/-/normalize-space-x-3.0.0.tgz#17907d6c7c724a4f9567471cbb319553bc0f8882" + dependencies: + cached-constructors-x "^1.0.0" + trim-x "^3.0.0" + white-space-x "^3.0.0" + now-and-later@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/now-and-later/-/now-and-later-2.0.0.tgz#bc61cbb456d79cb32207ce47ca05136ff2e7d6ee" @@ -4379,6 +5776,10 @@ number-to-bn@1.7.0, number-to-bn@^1.7.0: bn.js "4.11.6" strip-hex-prefix "1.0.0" +nwsapi@^2.0.7: + version "2.0.8" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.0.8.tgz#e3603579b7e162b3dbedae4fb24e46f771d8fa24" + nyc@^12.0.2: version "12.0.2" resolved "https://registry.yarnpkg.com/nyc/-/nyc-12.0.2.tgz#8a4a4ed690966c11ec587ff87eea0c12c974ba99" @@ -4435,6 +5836,21 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" +object-get-own-property-descriptor-x@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/object-get-own-property-descriptor-x/-/object-get-own-property-descriptor-x-3.2.0.tgz#464585ad03e66108ed166c99325b8d2c5ba93712" + dependencies: + attempt-x "^1.1.0" + has-own-property-x "^3.1.1" + has-symbol-support-x "^1.4.1" + is-falsey-x "^1.0.0" + is-index-x "^1.0.0" + is-primitive "^2.0.0" + is-string "^1.0.4" + property-is-enumerable-x "^1.1.0" + to-object-x "^1.4.1" + to-property-key-x "^2.0.1" + object-keys@^1.0.11, object-keys@^1.0.6, object-keys@^1.0.8: version "1.0.12" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" @@ -4454,19 +5870,37 @@ object.assign@^4.0.4: has-symbols "^1.0.0" object-keys "^1.0.11" +object.getownpropertydescriptors@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.1" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" dependencies: isobject "^3.0.1" -on-finished@~2.3.0: +on-finished@^2.3.0, on-finished@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" dependencies: ee-first "1.1.1" -once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0: +on-headers@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.1.tgz#928f5d0f470d49342651ea6794b0857c100693f7" + +once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.3.3, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: @@ -4612,6 +6046,15 @@ parse-github-repo-url@^1.3.0: version "1.4.1" resolved "https://registry.yarnpkg.com/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz#9e7d8bb252a6cb6ba42595060b7bf6df3dbc1f50" +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + parse-headers@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/parse-headers/-/parse-headers-2.0.1.tgz#6ae83a7aa25a9d9b700acc28698cd1f1ed7e9536" @@ -4619,6 +6062,15 @@ parse-headers@^2.0.0: for-each "^0.3.2" trim "0.0.1" +parse-int-x@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/parse-int-x/-/parse-int-x-2.0.0.tgz#9f979d4115930df2f4706a41810b9c712405552f" + dependencies: + cached-constructors-x "^1.0.0" + nan-x "^1.0.0" + to-string-x "^1.4.2" + trim-left-x "^3.0.0" + parse-json@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" @@ -4632,6 +6084,10 @@ parse-json@^4.0.0: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" +parse5@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" + parseurl@~1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" @@ -4654,7 +6110,7 @@ path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" -path-is-absolute@^1.0.0: +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -4698,6 +6154,10 @@ pause-stream@0.0.11: dependencies: through "~2.3" +pend@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" + performance-now@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" @@ -4807,6 +6267,10 @@ pkg@^4.3.1: simple-bufferstream "1.0.0" stream-meter "1.0.4" +pn@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -4829,6 +6293,18 @@ postgres-interval@^1.1.0: dependencies: xtend "^4.0.0" +pouchdb-abstract-mapreduce@6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-abstract-mapreduce/-/pouchdb-abstract-mapreduce-6.4.3.tgz#0310053812d16ff9545a3db43f5e38a67a0133d7" + dependencies: + pouchdb-binary-utils "6.4.3" + pouchdb-collate "6.4.3" + pouchdb-collections "6.4.3" + pouchdb-mapreduce-utils "6.4.3" + pouchdb-md5 "6.4.3" + pouchdb-promise "6.4.3" + pouchdb-utils "6.4.3" + pouchdb-abstract-mapreduce@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-abstract-mapreduce/-/pouchdb-abstract-mapreduce-7.0.0.tgz#946d79073c9795ca03c9b5c318a64372422e8740" @@ -4842,6 +6318,100 @@ pouchdb-abstract-mapreduce@7.0.0: pouchdb-md5 "7.0.0" pouchdb-utils "7.0.0" +pouchdb-adapter-http@^6.4.1: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-adapter-http/-/pouchdb-adapter-http-6.4.3.tgz#0bc713e4d5f5b7bbaa4dc509d417d38b7733a71f" + dependencies: + argsarray "0.0.1" + pouchdb-ajax "6.4.3" + pouchdb-binary-utils "6.4.3" + pouchdb-errors "6.4.3" + pouchdb-promise "6.4.3" + pouchdb-utils "6.4.3" + +pouchdb-adapter-leveldb-core@6.4.3, pouchdb-adapter-leveldb-core@^6.4.1: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-adapter-leveldb-core/-/pouchdb-adapter-leveldb-core-6.4.3.tgz#0b623fc12e63acbf5606508ba2008e501803076a" + dependencies: + argsarray "0.0.1" + buffer-from "0.1.1" + double-ended-queue "2.1.0-0" + levelup "2.0.1" + pouchdb-adapter-utils "6.4.3" + pouchdb-binary-utils "6.4.3" + pouchdb-collections "6.4.3" + pouchdb-errors "6.4.3" + pouchdb-json "6.4.3" + pouchdb-md5 "6.4.3" + pouchdb-merge "6.4.3" + pouchdb-promise "6.4.3" + pouchdb-utils "6.4.3" + sublevel-pouchdb "6.4.3" + through2 "2.0.3" + +pouchdb-adapter-leveldb@^6.4.1: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-adapter-leveldb/-/pouchdb-adapter-leveldb-6.4.3.tgz#0fe0f69b090df849c15b54e09a0e20db13cfa581" + dependencies: + level "2.1.1" + level-write-stream "1.0.0" + leveldown "2.1.1" + pouchdb-adapter-leveldb-core "6.4.3" + pouchdb-merge "6.4.3" + pouchdb-utils "6.4.3" + through2 "2.0.3" + +pouchdb-adapter-memory@^6.4.1: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-adapter-memory/-/pouchdb-adapter-memory-6.4.3.tgz#06edb687be9d063b27e9b58ca30ea1a08a9b94f4" + dependencies: + memdown "1.2.4" + pouchdb-adapter-leveldb-core "6.4.3" + pouchdb-utils "6.4.3" + +pouchdb-adapter-node-websql@^6.4.1: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-adapter-node-websql/-/pouchdb-adapter-node-websql-6.4.3.tgz#0e6cc29945f363f0130a798ffc15c3483058ceff" + dependencies: + pouchdb-adapter-websql-core "6.4.3" + pouchdb-utils "6.4.3" + websql "0.4.4" + +pouchdb-adapter-utils@6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-adapter-utils/-/pouchdb-adapter-utils-6.4.3.tgz#384bb1bcd37dc7d473016eb450cec53d665bcae4" + dependencies: + pouchdb-binary-utils "6.4.3" + pouchdb-collections "6.4.3" + pouchdb-errors "6.4.3" + pouchdb-md5 "6.4.3" + pouchdb-merge "6.4.3" + pouchdb-promise "6.4.3" + pouchdb-utils "6.4.3" + +pouchdb-adapter-websql-core@6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-adapter-websql-core/-/pouchdb-adapter-websql-core-6.4.3.tgz#8f992a46ca8a6870440d0c8699cfaa7ac1c382c4" + dependencies: + pouchdb-adapter-utils "6.4.3" + pouchdb-binary-utils "6.4.3" + pouchdb-collections "6.4.3" + pouchdb-errors "6.4.3" + pouchdb-json "6.4.3" + pouchdb-merge "6.4.3" + pouchdb-utils "6.4.3" + +pouchdb-ajax@6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-ajax/-/pouchdb-ajax-6.4.3.tgz#642aea957925cb9fcd6493d2f39820c34bca3e88" + dependencies: + buffer-from "0.1.1" + pouchdb-binary-utils "6.4.3" + pouchdb-errors "6.4.3" + pouchdb-promise "6.4.3" + pouchdb-utils "6.4.3" + request "2.83.0" + pouchdb-all-dbs@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pouchdb-all-dbs/-/pouchdb-all-dbs-1.0.2.tgz#8fa1aa4b01665e00e0da9c61bf6dbb99eca05d3c" @@ -4852,26 +6422,117 @@ pouchdb-all-dbs@^1.0.2: pouchdb-promise "5.4.3" tiny-queue "^0.2.0" +pouchdb-auth@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/pouchdb-auth/-/pouchdb-auth-4.1.0.tgz#a3dc3c2d6e62a5d898ae79f177bebe02ddf1b12d" + dependencies: + base64url "^3.0.0" + couchdb-calculate-session-id "^1.1.0" + crypto-lite "^0.2.0" + pouchdb-bulkdocs-wrapper "4.1.0" + pouchdb-plugin-error "4.1.0" + pouchdb-promise "^6.4.1" + pouchdb-req-http-query "4.1.0" + pouchdb-system-db "4.1.0" + pouchdb-validation "4.1.0" + pouchdb-wrappers "4.1.0" + promise-nodify "^1.0.2" + secure-random "^1.1.1" + +pouchdb-binary-utils@6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-binary-utils/-/pouchdb-binary-utils-6.4.3.tgz#ba6d9b9d289a359d47b53c1ec017fd9715a777a9" + dependencies: + buffer-from "0.1.1" + pouchdb-binary-utils@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-binary-utils/-/pouchdb-binary-utils-7.0.0.tgz#cb71a288b09572a231f6bab1b4aed201c4d219a7" dependencies: buffer-from "1.1.0" +pouchdb-bulkdocs-wrapper@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/pouchdb-bulkdocs-wrapper/-/pouchdb-bulkdocs-wrapper-4.1.0.tgz#d3ab9e06b7c10f0292a70a3d5ec0bc4b55327b3b" + dependencies: + pouchdb-promise "^6.4.1" + +pouchdb-changes-filter@6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-changes-filter/-/pouchdb-changes-filter-6.4.3.tgz#01fcf9dbc9d742fe5060624bb39bc459a3d11a1a" + dependencies: + pouchdb-errors "6.4.3" + pouchdb-selector-core "6.4.3" + pouchdb-utils "6.4.3" + +pouchdb-changeslike-wrapper@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/pouchdb-changeslike-wrapper/-/pouchdb-changeslike-wrapper-4.1.0.tgz#5aecab31006acd2dbc96da7eaa99b1da42379510" + +pouchdb-checkpointer@6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-checkpointer/-/pouchdb-checkpointer-6.4.3.tgz#af0e429ca3fe8b86000412f4fc6e9ea98d956992" + dependencies: + pouchdb-collate "6.4.3" + pouchdb-promise "6.4.3" + pouchdb-utils "6.4.3" + +pouchdb-collate@6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-collate/-/pouchdb-collate-6.4.3.tgz#55a77a1a3e1c2cf86fe4d02aea171e10c2a3f944" + pouchdb-collate@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-collate/-/pouchdb-collate-7.0.0.tgz#4f9a0a03c236f1677a971c400b79b7baf6379a4d" +pouchdb-collections@6.4.3, pouchdb-collections@^6.4.1: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-collections/-/pouchdb-collections-6.4.3.tgz#2b70ca3143134c361dba6e466518b4f4d8e92ff4" + pouchdb-collections@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-collections/-/pouchdb-collections-7.0.0.tgz#fd1f632337dc6301b0ff8649732ca79204e41780" +pouchdb-collections@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/pouchdb-collections/-/pouchdb-collections-1.0.1.tgz#fe63a17da977611abef7cb8026cb1a9553fd8359" + +pouchdb-core@^6.4.1: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-core/-/pouchdb-core-6.4.3.tgz#8a25d60f95b6861191228327e56c04a661389426" + dependencies: + argsarray "0.0.1" + inherits "2.0.3" + pouchdb-changes-filter "6.4.3" + pouchdb-collections "6.4.3" + pouchdb-debug "6.4.3" + pouchdb-errors "6.4.3" + pouchdb-merge "6.4.3" + pouchdb-promise "6.4.3" + pouchdb-utils "6.4.3" + +pouchdb-debug@6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-debug/-/pouchdb-debug-6.4.3.tgz#d5ee0d0f638c455ef947fe6658030db1480c72c0" + dependencies: + debug "3.1.0" + +pouchdb-errors@6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-errors/-/pouchdb-errors-6.4.3.tgz#9fa4a13f64ee50c8d593e3235b18b1458977f8d1" + dependencies: + inherits "2.0.3" + pouchdb-errors@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-errors/-/pouchdb-errors-7.0.0.tgz#4e2a5a8b82af20cbe5f9970ca90b7ec74563caa0" dependencies: inherits "2.0.3" +pouchdb-fauxton@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/pouchdb-fauxton/-/pouchdb-fauxton-0.0.6.tgz#fcfae265a3d621e913ebd035eec338a4efa92aa1" + pouchdb-fetch@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-fetch/-/pouchdb-fetch-7.0.0.tgz#6b56cc49863837f8d5e38b0956ace03f1fcaf8e0" @@ -4879,6 +6540,17 @@ pouchdb-fetch@7.0.0: fetch-cookie "0.7.0" node-fetch "^2.0.0" +pouchdb-find@^6.4.1: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-find/-/pouchdb-find-6.4.3.tgz#1d0128306071434a5e397bb14ce69c831356c95e" + dependencies: + pouchdb-abstract-mapreduce "6.4.3" + pouchdb-collate "6.4.3" + pouchdb-md5 "6.4.3" + pouchdb-promise "6.4.3" + pouchdb-selector-core "6.4.3" + pouchdb-utils "6.4.3" + pouchdb-find@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-find/-/pouchdb-find-7.0.0.tgz#f390c3f7a9455e700eb178eb89b235aaf7dc3beb" @@ -4891,6 +6563,41 @@ pouchdb-find@^7.0.0: pouchdb-selector-core "7.0.0" pouchdb-utils "7.0.0" +pouchdb-generate-replication-id@6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-generate-replication-id/-/pouchdb-generate-replication-id-6.4.3.tgz#a11806f511991389c641e81ed46e7460f75bc570" + dependencies: + pouchdb-collate "6.4.3" + pouchdb-md5 "6.4.3" + pouchdb-promise "6.4.3" + +pouchdb-json@6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-json/-/pouchdb-json-6.4.3.tgz#a1702c8eb9d656f6566920aaec9fb3e7e1265132" + dependencies: + vuvuzela "1.0.3" + +pouchdb-list@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/pouchdb-list/-/pouchdb-list-4.1.0.tgz#a333c3066987c0d8e50c57a5aec2d3c20150bbe0" + dependencies: + couchdb-objects "4.1.0" + couchdb-render "4.1.0" + extend "^3.0.0" + pouchdb-plugin-error "4.1.0" + pouchdb-promise "^6.4.1" + pouchdb-req-http-query "4.1.0" + promise-nodify "^1.0.2" + +pouchdb-mapreduce-utils@6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-mapreduce-utils/-/pouchdb-mapreduce-utils-6.4.3.tgz#1245e1ca4d3f216d336030c669dd97d6597442e4" + dependencies: + argsarray "0.0.1" + inherits "2.0.3" + pouchdb-collections "6.4.3" + pouchdb-utils "6.4.3" + pouchdb-mapreduce-utils@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-mapreduce-utils/-/pouchdb-mapreduce-utils-7.0.0.tgz#ff342e9d515d4c9cf0b19ad85c78f10f2568493b" @@ -4900,6 +6607,21 @@ pouchdb-mapreduce-utils@7.0.0: pouchdb-collections "7.0.0" pouchdb-utils "7.0.0" +pouchdb-mapreduce@^6.4.1: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-mapreduce/-/pouchdb-mapreduce-6.4.3.tgz#941bcda91356196cc32fbb7eb769650e857cc280" + dependencies: + pouchdb-abstract-mapreduce "6.4.3" + pouchdb-mapreduce-utils "6.4.3" + pouchdb-utils "6.4.3" + +pouchdb-md5@6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-md5/-/pouchdb-md5-6.4.3.tgz#d414315366e4bb428fb6048a25655b1eca591797" + dependencies: + pouchdb-binary-utils "6.4.3" + spark-md5 "3.0.0" + pouchdb-md5@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-md5/-/pouchdb-md5-7.0.0.tgz#935dc6bb507a5f3978fb653ca5790331bae67c96" @@ -4907,18 +6629,98 @@ pouchdb-md5@7.0.0: pouchdb-binary-utils "7.0.0" spark-md5 "3.0.0" +pouchdb-merge@6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-merge/-/pouchdb-merge-6.4.3.tgz#4ef901f4aaa27be6aec0108998a127fe55bb0628" + +pouchdb-plugin-error@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/pouchdb-plugin-error/-/pouchdb-plugin-error-4.1.0.tgz#eda55021865971b226f7c63d609202473238bbba" + pouchdb-promise@5.4.3: version "5.4.3" resolved "https://registry.yarnpkg.com/pouchdb-promise/-/pouchdb-promise-5.4.3.tgz#331d670b1989d5a03f268811214f27f54150cb2b" dependencies: lie "3.0.4" -pouchdb-promise@^6.1.2: +pouchdb-promise@6.4.3, pouchdb-promise@^6.1.2, pouchdb-promise@^6.4.1: version "6.4.3" resolved "https://registry.yarnpkg.com/pouchdb-promise/-/pouchdb-promise-6.4.3.tgz#74516f4acf74957b54debd0fb2c0e5b5a68ca7b3" dependencies: lie "3.1.1" +pouchdb-replication@^6.4.1: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-replication/-/pouchdb-replication-6.4.3.tgz#33718e2b100883707d56a9cc0ec7acba1a7355dd" + dependencies: + inherits "2.0.3" + pouchdb-checkpointer "6.4.3" + pouchdb-errors "6.4.3" + pouchdb-generate-replication-id "6.4.3" + pouchdb-promise "6.4.3" + pouchdb-utils "6.4.3" + +pouchdb-replicator@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/pouchdb-replicator/-/pouchdb-replicator-4.1.0.tgz#4ef205d5ca0c28eb11aa84d85160a9437385ca61" + dependencies: + equals "^1.0.5" + extend "^3.0.0" + pouchdb-plugin-error "4.1.0" + pouchdb-promise "^6.4.1" + pouchdb-system-db "4.1.0" + pouchdb-validation "4.1.0" + promise-nodify "^1.0.2" + random-uuid-v4 "0.0.7" + +pouchdb-req-http-query@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/pouchdb-req-http-query/-/pouchdb-req-http-query-4.1.0.tgz#0946bcb7b64b6ad2ff43cf37cbc9484430675467" + dependencies: + extend "^3.0.0" + header-case-normalizer "^1.0.3" + pouchdb-plugin-error "4.1.0" + pouchdb-promise "^6.4.1" + xmlhttprequest-cookie "^0.9.2" + +pouchdb-rewrite@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/pouchdb-rewrite/-/pouchdb-rewrite-4.1.0.tgz#94eedc185de0972453f7002b0ecf5fb7216c5d4e" + dependencies: + couchdb-objects "4.1.0" + extend "^3.0.0" + pouchdb-plugin-error "4.1.0" + pouchdb-req-http-query "4.1.0" + pouchdb-route "4.1.0" + promise-nodify "^1.0.2" + +pouchdb-route@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/pouchdb-route/-/pouchdb-route-4.1.0.tgz#2a30d6d87453b8dd7f6276dce6ff8032e650df90" + dependencies: + extend "^3.0.0" + pouchdb-plugin-error "4.1.0" + +pouchdb-security@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/pouchdb-security/-/pouchdb-security-4.1.0.tgz#795d9b79998c04505279399ef0da87acd0393655" + dependencies: + extend "^3.0.0" + pouchdb-bulkdocs-wrapper "4.1.0" + pouchdb-changeslike-wrapper "4.1.0" + pouchdb-plugin-error "4.1.0" + pouchdb-promise "^6.4.1" + pouchdb-req-http-query "4.1.0" + pouchdb-wrappers "4.1.0" + promise-nodify "^1.0.2" + +pouchdb-selector-core@6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-selector-core/-/pouchdb-selector-core-6.4.3.tgz#03a9cfd9284589baf836f3005ff15cf5e0eaf705" + dependencies: + pouchdb-collate "6.4.3" + pouchdb-utils "6.4.3" + pouchdb-selector-core@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-selector-core/-/pouchdb-selector-core-7.0.0.tgz#824bd0980bd9778b3ddef869306a6cdb928df703" @@ -4926,24 +6728,131 @@ pouchdb-selector-core@7.0.0: pouchdb-collate "7.0.0" pouchdb-utils "7.0.0" +pouchdb-server@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/pouchdb-server/-/pouchdb-server-4.1.0.tgz#4514474658123383d710002f2016533d3be7af00" + dependencies: + "@gerhobbelt/nomnom" "^1.8.4-24" + colors "^1.0.3" + corser "~2.0.0" + couchdb-log-parse "^0.0.4" + express "^4.14.1" + express-pouchdb "4.1.0" + http-pouchdb "4.1.0" + killable "^1.0.0" + mkdirp "^0.5.0" + object-assign "^4.1.0" + pouchdb-adapter-http "^6.4.1" + pouchdb-adapter-leveldb-core "^6.4.1" + pouchdb-adapter-memory "^6.4.1" + pouchdb-core "^6.4.1" + pouchdb-mapreduce "^6.4.1" + pouchdb-promise "^6.4.1" + pouchdb-replication "^6.4.1" + serve-favicon "~2.5.0" + tail "^1.2.1" + wordwrap "1.0.0" + optionalDependencies: + pouchdb-adapter-leveldb "^6.4.1" + pouchdb-adapter-node-websql "^6.4.1" + +pouchdb-show@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/pouchdb-show/-/pouchdb-show-4.1.0.tgz#e7235545e20d8e1591299812ad7019c06a3130e0" + dependencies: + couchdb-objects "4.1.0" + couchdb-render "4.1.0" + pouchdb-plugin-error "4.1.0" + pouchdb-promise "^6.4.1" + pouchdb-req-http-query "4.1.0" + promise-nodify "^1.0.2" + +pouchdb-size@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/pouchdb-size/-/pouchdb-size-4.1.0.tgz#d72a277b25e1b466bd63045c45e317c39c653d9e" + dependencies: + bluebird "^3.4.7" + get-folder-size "^2.0.0" + pouchdb-wrappers "4.1.0" + promise-nodify "^1.0.2" + +pouchdb-system-db@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/pouchdb-system-db/-/pouchdb-system-db-4.1.0.tgz#ad7a7d0076216b4da290b41615bbe79f5f477080" + dependencies: + pouchdb-changeslike-wrapper "4.1.0" + pouchdb-plugin-error "4.1.0" + pouchdb-security "4.1.0" + pouchdb-wrappers "4.1.0" + +pouchdb-update@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/pouchdb-update/-/pouchdb-update-4.1.0.tgz#2374e412f64969ea745d9cb31d0faf82542638ef" + dependencies: + couchdb-eval "4.1.0" + couchdb-objects "4.1.0" + couchdb-resp-completer "4.1.0" + pouchdb-plugin-error "4.1.0" + pouchdb-promise "^6.4.1" + pouchdb-req-http-query "4.1.0" + promise-nodify "^1.0.2" + pouchdb-upsert@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/pouchdb-upsert/-/pouchdb-upsert-2.2.0.tgz#42b15e420848f3b294c35060589fdb51cf7f7f5f" dependencies: pouchdb-promise "^6.1.2" +pouchdb-utils@6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-utils/-/pouchdb-utils-6.4.3.tgz#aeb6bb8cbd8cf2d9f04e499bc3b70d1ce2a6c78a" + dependencies: + argsarray "0.0.1" + clone-buffer "1.0.0" + immediate "3.0.6" + inherits "2.0.3" + pouchdb-collections "6.4.3" + pouchdb-errors "6.4.3" + pouchdb-promise "6.4.3" + uuid "3.2.1" + pouchdb-utils@7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pouchdb-utils/-/pouchdb-utils-7.0.0.tgz#48bfced6665b8f5a2b2d2317e2aa57635ed1e88e" dependencies: - argsarray "0.0.1" - clone-buffer "1.0.0" - immediate "3.0.6" - inherits "2.0.3" - pouchdb-collections "7.0.0" - pouchdb-errors "7.0.0" - pouchdb-md5 "7.0.0" - uuid "3.2.1" + argsarray "0.0.1" + clone-buffer "1.0.0" + immediate "3.0.6" + inherits "2.0.3" + pouchdb-collections "7.0.0" + pouchdb-errors "7.0.0" + pouchdb-md5 "7.0.0" + uuid "3.2.1" + +pouchdb-validation@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/pouchdb-validation/-/pouchdb-validation-4.1.0.tgz#204a09cd714a733401d59e48d1caaec43195b3c7" + dependencies: + couchdb-eval "4.1.0" + couchdb-objects "4.1.0" + pouchdb-bulkdocs-wrapper "4.1.0" + pouchdb-plugin-error "4.1.0" + pouchdb-promise "^6.4.1" + pouchdb-wrappers "4.1.0" + random-uuid-v4 "0.0.7" + +pouchdb-vhost@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/pouchdb-vhost/-/pouchdb-vhost-4.1.0.tgz#dec224d30a9ec3a17970c03780ff3a228c5e0dd8" + dependencies: + pouchdb-route "4.1.0" + promise-nodify "^1.0.2" + +pouchdb-wrappers@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/pouchdb-wrappers/-/pouchdb-wrappers-4.1.0.tgz#4c37628e379cd6fcdeb11ee4afc33c995ab98a35" + dependencies: + promise-nodify "^1.0.2" pouchdb@^7.0.0: version "7.0.0" @@ -5017,7 +6926,18 @@ prepend-http@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" -private@^0.1.6, private@~0.1.5: +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + +pretty-format@^23.5.0: + version "23.5.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.5.0.tgz#0f9601ad9da70fe690a269cd3efca732c210687c" + dependencies: + ansi-regex "^3.0.0" + ansi-styles "^3.2.0" + +private@^0.1.6, private@^0.1.8, private@~0.1.5: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" @@ -5033,12 +6953,30 @@ progress@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" +promise-nodify@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/promise-nodify/-/promise-nodify-1.0.2.tgz#0d0fb143c33400b0061b47e581257557047d4c5a" + +prompts@^0.1.9: + version "0.1.14" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-0.1.14.tgz#a8e15c612c5c9ec8f8111847df3337c9cbd443b2" + dependencies: + kleur "^2.0.1" + sisteransi "^0.1.1" + promzard@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/promzard/-/promzard-0.3.0.tgz#26a5d6ee8c7dee4cb12208305acfb93ba382a9ee" dependencies: read "1" +property-is-enumerable-x@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/property-is-enumerable-x/-/property-is-enumerable-x-1.1.0.tgz#7ca48917476cd0914b37809bfd05776a0d942f6f" + dependencies: + to-object-x "^1.4.1" + to-property-key-x "^2.0.1" + proto-list@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" @@ -5100,6 +7038,10 @@ punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + q@^1.1.2, q@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" @@ -5108,14 +7050,14 @@ qs@6.5.1: version "6.5.1" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" +qs@6.5.2, qs@~6.5.1, qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + qs@~6.4.0: version "6.4.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" -qs@~6.5.1, qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - query-string@^5.0.1: version "5.1.1" resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" @@ -5128,6 +7070,24 @@ quick-lru@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" +random-bytes@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/random-bytes/-/random-bytes-1.0.0.tgz#4f68a1dc0ae58bd3fb95848c30324db75d64360b" + +random-uuid-v4@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/random-uuid-v4/-/random-uuid-v4-0.0.7.tgz#0f1b087ecbbfbc1c0147bc68e54ced4d43a16d46" + dependencies: + jest "^23.1.0" + +randomatic@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.0.tgz#36f2ca708e9e567f5ed2ec01949026d50aa10116" + dependencies: + is-number "^4.0.0" + kind-of "^6.0.0" + math-random "^1.0.1" + randomhex@0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/randomhex/-/randomhex-0.1.5.tgz#baceef982329091400f2a2912c6cd02f1094f585" @@ -5145,6 +7105,15 @@ raw-body@2.3.2: iconv-lite "0.4.19" unpipe "1.0.0" +raw-body@2.3.3, raw-body@^2.2.0: + version "2.3.3" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" + dependencies: + bytes "3.0.0" + http-errors "1.6.3" + iconv-lite "0.4.23" + unpipe "1.0.0" + rc@^1.0.1, rc@^1.1.6, rc@^1.1.7: version "1.2.7" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.7.tgz#8a10ca30d588d00464360372b890d06dacd02297" @@ -5154,6 +7123,15 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.1.7: minimist "^1.2.0" strip-json-comments "~2.0.1" +rc@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + read-cmd-shim@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.1.tgz#2d5d157786a37c055d22077c32c53f8329e91c7b" @@ -5269,6 +7247,12 @@ readdirp@^2.0.0: readable-stream "^2.0.2" set-immediate-shim "^1.0.1" +realpath-native@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.0.1.tgz#07f40a0cce8f8261e2e8b7ebebf5c95965d7b633" + dependencies: + util.promisify "^1.0.0" + recast@^0.10.1: version "0.10.43" resolved "https://registry.yarnpkg.com/recast/-/recast-0.10.43.tgz#b95d50f6d60761a5f6252e15d80678168491ce7f" @@ -5305,6 +7289,16 @@ regenerator-runtime@^0.10.0: version "0.10.5" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + +regex-cache@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + dependencies: + is-equal-shallow "^0.1.3" + regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" @@ -5358,6 +7352,13 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" +replace-comments-x@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/replace-comments-x/-/replace-comments-x-2.0.0.tgz#a5cec18efd912aad78a7c3c4b69d01768556d140" + dependencies: + require-coercible-to-string-x "^1.0.0" + to-string-x "^1.4.2" + replace-ext@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" @@ -5368,6 +7369,20 @@ request-progress@3.0.0: dependencies: throttleit "^1.0.0" +request-promise-core@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6" + dependencies: + lodash "^4.13.1" + +request-promise-native@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.5.tgz#5281770f68e0c9719e5163fd3fab482215f4fda5" + dependencies: + request-promise-core "1.1.1" + stealthy-require "^1.1.0" + tough-cookie ">=2.3.3" + request@2.81.0: version "2.81.0" resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" @@ -5395,6 +7410,33 @@ request@2.81.0: tunnel-agent "^0.6.0" uuid "^3.0.0" +request@2.83.0: + version "2.83.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356" + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.6.0" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.1" + forever-agent "~0.6.1" + form-data "~2.3.1" + har-validator "~5.0.3" + hawk "~6.0.2" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.17" + oauth-sign "~0.8.2" + performance-now "^2.1.0" + qs "~6.5.1" + safe-buffer "^5.1.1" + stringstream "~0.0.5" + tough-cookie "~2.3.3" + tunnel-agent "^0.6.0" + uuid "^3.1.0" + request@^2.79.0: version "2.85.0" resolved "https://registry.yarnpkg.com/request/-/request-2.85.0.tgz#5a03615a47c61420b3eb99b7dba204f83603e1fa" @@ -5472,6 +7514,13 @@ request@^2.87.0: tunnel-agent "^0.6.0" uuid "^3.3.2" +require-coercible-to-string-x@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/require-coercible-to-string-x/-/require-coercible-to-string-x-1.0.2.tgz#b8c96ab42962ab7b28f3311fc6b198124c56f9f6" + dependencies: + require-object-coercible-x "^1.4.3" + to-string-x "^1.4.5" + require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -5480,6 +7529,12 @@ require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" +require-object-coercible-x@^1.4.1, require-object-coercible-x@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/require-object-coercible-x/-/require-object-coercible-x-1.4.3.tgz#783719a23a5c0ce24e845fcc50cd55b6421ea4bb" + dependencies: + is-nil-x "^1.4.2" + resolve-cwd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" @@ -5508,6 +7563,10 @@ resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + resolve@1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.4.0.tgz#a75be01c53da25d934a98ebd0e4c4a7312f92a86" @@ -5548,7 +7607,7 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.6.1, rimraf@^2.6.2: +rimraf@2, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: @@ -5558,6 +7617,10 @@ rosie@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/rosie/-/rosie-2.0.1.tgz#c250c4787ce450b72aa9eff26509f68589814fa2" +rsvp@^3.3.3: + version "3.6.2" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-3.6.2.tgz#2e96491599a96cde1b515d5674a8f7a91452926a" + run-async@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" @@ -5578,7 +7641,7 @@ safe-buffer@5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@5.1.2, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -5592,10 +7655,35 @@ safe-regex@^1.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" +sane@^2.0.0: + version "2.5.2" + resolved "https://registry.yarnpkg.com/sane/-/sane-2.5.2.tgz#b4dc1861c21b427e929507a3e751e2a2cb8ab3fa" + dependencies: + anymatch "^2.0.0" + capture-exit "^1.2.0" + exec-sh "^0.2.0" + fb-watchman "^2.0.0" + micromatch "^3.1.4" + minimist "^1.1.1" + walker "~1.0.5" + watch "~0.18.0" + optionalDependencies: + fsevents "^1.2.3" + +sanitize-filename@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/sanitize-filename/-/sanitize-filename-1.6.1.tgz#612da1c96473fa02dccda92dcd5b4ab164a6772a" + dependencies: + truncate-utf8-bytes "^1.0.0" + sax@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" +secure-random@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/secure-random/-/secure-random-1.1.1.tgz#0880f2d8c5185f4bcb4684058c836b4ddb07145a" + semver-diff@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" @@ -5658,6 +7746,16 @@ sequelize@^4.35.2, sequelize@^4.37.7: validator "^9.4.1" wkx "^0.4.1" +serve-favicon@~2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/serve-favicon/-/serve-favicon-2.5.0.tgz#935d240cdfe0f5805307fdfe967d88942a2cbcf0" + dependencies: + etag "~1.8.1" + fresh "0.5.2" + ms "2.1.1" + parseurl "~1.3.2" + safe-buffer "5.1.1" + serve-static@1.13.2: version "1.13.2" resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.13.2.tgz#095e8472fd5b46237db50ce486a43f4b86c6cec1" @@ -5727,6 +7825,10 @@ shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" +shellwords@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" + shimmer@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shimmer/-/shimmer-1.2.0.tgz#f966f7555789763e74d8841193685a5e78736665" @@ -5751,6 +7853,10 @@ simple-get@^2.7.0: once "^1.3.1" simple-concat "^1.0.0" +sisteransi@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-0.1.1.tgz#5431447d5f7d1675aac667ccd0b865a4994cb3ce" + slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" @@ -5820,6 +7926,12 @@ source-map-support@0.4.14: dependencies: source-map "^0.5.6" +source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + dependencies: + source-map "^0.5.6" + source-map-support@^0.5.6: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.6.tgz#4435cee46b1aab62b8e8610ce60f788091c51c13" @@ -5843,11 +7955,11 @@ source-map@^0.4.2, source-map@^0.4.4: dependencies: amdefine ">=0.0.4" -source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.0, source-map@~0.5.1: +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.0, source-map@~0.5.1: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" -source-map@^0.6.0, source-map@^0.6.1: +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" @@ -5926,6 +8038,13 @@ sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" +sqlite3@^3.1.1: + version "3.1.13" + resolved "https://registry.yarnpkg.com/sqlite3/-/sqlite3-3.1.13.tgz#d990a05627392768de6278bafd1a31fdfe907dd9" + dependencies: + nan "~2.7.0" + node-pre-gyp "~0.6.38" + sshpk@^1.7.0: version "1.14.1" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.1.tgz#130f5975eddad963f1d56f92b9ac6c51fa9f83eb" @@ -5940,6 +8059,10 @@ sshpk@^1.7.0: jsbn "~0.1.0" tweetnacl "~0.14.0" +stack-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.1.tgz#d4f33ab54e8e38778b0ca5cfd3b3afb12db68620" + static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -5947,7 +8070,7 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" -"statuses@>= 1.3.1 < 2", "statuses@>= 1.4.0 < 2": +"statuses@>= 1.3.1 < 2", "statuses@>= 1.4.0 < 2", "statuses@>= 1.5.0 < 2": version "1.5.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" @@ -5955,6 +8078,10 @@ statuses@~1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087" +stealthy-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + stream-combiner@~0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" @@ -5975,6 +8102,13 @@ strict-uri-encode@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" +string-length@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" + dependencies: + astral-regex "^1.0.0" + strip-ansi "^4.0.0" + string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -6030,16 +8164,16 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-bom@3.0.0, strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" dependencies: is-utf8 "^0.2.0" -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" @@ -6074,6 +8208,15 @@ strong-log-transformer@^1.0.6: moment "^2.6.0" through "^2.3.4" +sublevel-pouchdb@6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/sublevel-pouchdb/-/sublevel-pouchdb-6.4.3.tgz#e4eca52d8ac7ba17ff6c18fcdc51f5ecbbb15597" + dependencies: + inherits "2.0.3" + level-codec "7.0.1" + ltgt "2.2.0" + readable-stream "1.0.33" + supports-color@4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" @@ -6110,6 +8253,14 @@ symbol-observable@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4" +symbol-tree@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + +tail@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/tail/-/tail-1.3.0.tgz#0bcb25f6e5a70d3c9e76693aa8a1721b22fb1d2e" + tar-fs@^1.13.0: version "1.16.3" resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-1.16.3.tgz#966a628841da2c4010406a82167cbd5e0c72d509" @@ -6119,6 +8270,19 @@ tar-fs@^1.13.0: pump "^1.0.0" tar-stream "^1.1.2" +tar-pack@^3.4.0: + version "3.4.1" + resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.1.tgz#e1dbc03a9b9d3ba07e896ad027317eb679a10a1f" + dependencies: + debug "^2.2.0" + fstream "^1.0.10" + fstream-ignore "^1.0.5" + once "^1.3.3" + readable-stream "^2.1.4" + rimraf "^2.5.1" + tar "^2.2.1" + uid-number "^0.0.6" + tar-stream@^1.1.2: version "1.6.1" resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.1.tgz#f84ef1696269d6223ca48f6e1eeede3f7e81f395" @@ -6131,7 +8295,7 @@ tar-stream@^1.1.2: to-buffer "^1.1.0" xtend "^4.0.0" -tar@^2.0.0: +tar@^2.0.0, tar@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" dependencies: @@ -6184,7 +8348,7 @@ terraformer@~1.0.5: dependencies: "@types/geojson" "^1.0.0" -test-exclude@^4.2.0: +test-exclude@^4.2.0, test-exclude@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.1.tgz#dfa222f03480bca69207ca728b37d74b45f724fa" dependencies: @@ -6198,6 +8362,10 @@ text-extensions@^1.0.0: version "1.7.0" resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.7.0.tgz#faaaba2625ed746d568a23e4d0aacd9bf08a8b39" +throat@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" + throttleit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c" @@ -6231,7 +8399,11 @@ timed-out@^4.0.0, timed-out@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" -tiny-queue@^0.2.0: +tiny-each-async@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/tiny-each-async/-/tiny-each-async-2.0.3.tgz#8ebbbfd6d6295f1370003fbb37162afe5a0a51d1" + +tiny-queue@^0.2.0, tiny-queue@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/tiny-queue/-/tiny-queue-0.2.1.tgz#25a67f2c6e253b2ca941977b5ef7442ef97a6046" @@ -6241,6 +8413,10 @@ tmp@^0.0.33: dependencies: os-tmpdir "~1.0.2" +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + to-absolute-glob@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz#1865f43d9e74b0822db9f145b78cff7d0f7c849b" @@ -6248,20 +8424,75 @@ to-absolute-glob@^2.0.0: is-absolute "^1.0.0" is-negated-glob "^1.0.0" +to-boolean-x@^1.0.1, to-boolean-x@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-boolean-x/-/to-boolean-x-1.0.3.tgz#cbe15e38a85d09553f29869a9b3e3b54ceef5af0" + to-buffer@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" +to-integer-x@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/to-integer-x/-/to-integer-x-3.0.0.tgz#9f3b80e668c7f0ae45e6926b40d95f52c1addc74" + dependencies: + is-finite-x "^3.0.2" + is-nan-x "^1.0.1" + math-sign-x "^3.0.0" + to-number-x "^2.0.0" + +to-number-x@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-number-x/-/to-number-x-2.0.0.tgz#c9099d7ded8fd327132a2987df2dcc8baf36df4d" + dependencies: + cached-constructors-x "^1.0.0" + nan-x "^1.0.0" + parse-int-x "^2.0.0" + to-primitive-x "^1.1.0" + trim-x "^3.0.0" + to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" dependencies: kind-of "^3.0.2" +to-object-x@^1.4.1, to-object-x@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/to-object-x/-/to-object-x-1.5.0.tgz#bd69dd4e104d77acc0cc0d84f5ac48f630aebe3c" + dependencies: + cached-constructors-x "^1.0.0" + require-object-coercible-x "^1.4.1" + +to-primitive-x@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/to-primitive-x/-/to-primitive-x-1.1.0.tgz#41ce2c13e3e246e0e5d0a8829a0567c6015833f8" + dependencies: + has-symbol-support-x "^1.4.1" + is-date-object "^1.0.1" + is-function-x "^3.2.0" + is-nil-x "^1.4.1" + is-primitive "^2.0.0" + is-symbol "^1.0.1" + require-object-coercible-x "^1.4.1" + validate.io-undefined "^1.0.3" + +to-property-key-x@^2.0.1, to-property-key-x@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/to-property-key-x/-/to-property-key-x-2.0.2.tgz#b19aa8e22faa0ff7d1c102cfbc657af73413cfa1" + dependencies: + has-symbol-support-x "^1.4.1" + to-primitive-x "^1.1.0" + to-string-x "^1.4.2" + to-regex-range@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" @@ -6278,12 +8509,38 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" +to-string-symbols-supported-x@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/to-string-symbols-supported-x/-/to-string-symbols-supported-x-1.0.2.tgz#73f5e17963520b2b365559f05e3864addaab7f1e" + dependencies: + cached-constructors-x "^1.0.2" + has-symbol-support-x "^1.4.2" + is-symbol "^1.0.1" + +to-string-tag-x@^1.4.1, to-string-tag-x@^1.4.2: + version "1.4.3" + resolved "https://registry.yarnpkg.com/to-string-tag-x/-/to-string-tag-x-1.4.3.tgz#3aed2edec9343be3c76e338161f85d6864c692b1" + dependencies: + lodash.isnull "^3.0.0" + validate.io-undefined "^1.0.3" + +to-string-x@^1.4.2, to-string-x@^1.4.5: + version "1.4.5" + resolved "https://registry.yarnpkg.com/to-string-x/-/to-string-x-1.4.5.tgz#b86dad14df68ca4df52ca4cb011a25e0bf5d9ca1" + dependencies: + cached-constructors-x "^1.0.0" + is-symbol "^1.0.1" + to-through@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-through/-/to-through-2.0.0.tgz#fc92adaba072647bc0b67d6b03664aa195093af6" dependencies: through2 "^2.0.3" +toidentifier@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" + toposort-class@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/toposort-class/-/toposort-class-1.0.1.tgz#7ffd1f78c8be28c3ba45cd4e1a3f5ee193bd9988" @@ -6294,7 +8551,7 @@ touch@^3.1.0: dependencies: nopt "~1.0.10" -tough-cookie@^2.3.1, tough-cookie@~2.4.3: +tough-cookie@>=2.3.3, tough-cookie@^2.3.1, tough-cookie@^2.3.4, tough-cookie@~2.4.3: version "2.4.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" dependencies: @@ -6307,10 +8564,24 @@ tough-cookie@~2.3.0, tough-cookie@~2.3.3: dependencies: punycode "^1.4.1" +tr46@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + dependencies: + punycode "^2.1.0" + tree-kill@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.0.tgz#5846786237b4239014f05db156b643212d4c6f36" +trim-left-x@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/trim-left-x/-/trim-left-x-3.0.0.tgz#356cf055896726b9754425e841398842e90b4cdf" + dependencies: + cached-constructors-x "^1.0.0" + require-coercible-to-string-x "^1.0.0" + white-space-x "^3.0.0" + trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" @@ -6323,14 +8594,35 @@ trim-off-newlines@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3" +trim-right-x@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/trim-right-x/-/trim-right-x-3.0.0.tgz#28c4cd37d5981f50ace9b52e3ce9106f4d2d22c0" + dependencies: + cached-constructors-x "^1.0.0" + require-coercible-to-string-x "^1.0.0" + white-space-x "^3.0.0" + trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" +trim-x@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/trim-x/-/trim-x-3.0.0.tgz#24efdcd027b748bbfc246a0139ad1749befef024" + dependencies: + trim-left-x "^3.0.0" + trim-right-x "^3.0.0" + trim@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd" +truncate-utf8-bytes@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz#405923909592d56f78a5818434b0b78489ca5f2b" + dependencies: + utf8-byte-length "^1.0.1" + ts-node@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-7.0.1.tgz#9562dc2d1e6d248d24bc55f773e3f614337d9baf" @@ -6419,10 +8711,16 @@ uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" -uid-number@0.0.6: +uid-number@0.0.6, uid-number@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" +uid-safe@2.1.5: + version "2.1.5" + resolved "https://registry.yarnpkg.com/uid-safe/-/uid-safe-2.1.5.tgz#2b3d5c7240e8fc2e58f8aa269e5ee49c0857bd3a" + dependencies: + random-bytes "~1.0.0" + uid2@0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/uid2/-/uid2-0.0.3.tgz#483126e11774df2f71b8b639dcd799c376162b82" @@ -6545,6 +8843,10 @@ use@^3.1.0: dependencies: kind-of "^6.0.2" +utf8-byte-length@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz#f45f150c4c66eee968186505ab93fcbb8ad6bf61" + utf8@2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/utf8/-/utf8-2.1.1.tgz#2e01db02f7d8d0944f77104f1609eb0c304cf768" @@ -6553,6 +8855,13 @@ util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" +util.promisify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" + dependencies: + define-properties "^1.1.2" + object.getownpropertydescriptors "^2.0.3" + utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" @@ -6589,6 +8898,10 @@ validate-npm-package-name@^3.0.0: dependencies: builtins "^1.0.3" +validate.io-undefined@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/validate.io-undefined/-/validate.io-undefined-1.0.3.tgz#7e27fcbb315b841e78243431897671929e20b7f4" + validator@^9.4.1: version "9.4.1" resolved "https://registry.yarnpkg.com/validator/-/validator-9.4.1.tgz#abf466d398b561cd243050112c6ff1de6cc12663" @@ -6658,6 +8971,25 @@ vuvuzela@1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/vuvuzela/-/vuvuzela-1.0.3.tgz#3be145e58271c73ca55279dd851f12a682114b0b" +w3c-hr-time@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" + dependencies: + browser-process-hrtime "^0.1.2" + +walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + dependencies: + makeerror "1.0.x" + +watch@~0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/watch/-/watch-0.18.0.tgz#28095476c6df7c90c963138990c0a5423eb4b986" + dependencies: + exec-sh "^0.2.0" + minimist "^1.2.0" + wcwidth@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" @@ -6700,10 +9032,51 @@ web3-utils@1.0.0-beta.34, web3-utils@^1.0.0-beta.34: underscore "1.8.3" utf8 "2.1.1" +webidl-conversions@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + +websql@0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/websql/-/websql-0.4.4.tgz#1463177f203cff0f3ac4d8294c8e1261c0c8ec01" + dependencies: + argsarray "0.0.1" + immediate "^3.2.2" + noop-fn "^1.0.0" + pouchdb-collections "^1.0.1" + sqlite3 "^3.1.1" + tiny-queue "^0.2.1" + +whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.4.tgz#63fb016b7435b795d9025632c086a5209dbd2621" + dependencies: + iconv-lite "0.4.23" + whatwg-fetch@>=0.10.0: version "2.0.4" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" +whatwg-mimetype@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.1.0.tgz#f0f21d76cbba72362eb609dbed2a30cd17fcc7d4" + +whatwg-url@^6.4.1: + version "6.5.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + +whatwg-url@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" @@ -6712,7 +9085,7 @@ which-pm-runs@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb" -which@1, which@^1.3.0: +which@1, which@^1.2.12, which@^1.3.0: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" dependencies: @@ -6724,6 +9097,10 @@ which@^1.2.9: dependencies: isexe "^2.0.0" +white-space-x@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/white-space-x/-/white-space-x-3.0.1.tgz#81a82d5432da725aba5ca671624bb579c9e66d4f" + wide-align@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710" @@ -6750,14 +9127,14 @@ wordwrap@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" +wordwrap@1.0.0, wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" -wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" @@ -6777,7 +9154,7 @@ write-file-atomic@^1.1.4: imurmurhash "^0.1.4" slide "^1.1.5" -write-file-atomic@^2.0.0, write-file-atomic@^2.3.0: +write-file-atomic@^2.0.0, write-file-atomic@^2.1.0, write-file-atomic@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab" dependencies: @@ -6817,6 +9194,12 @@ ws@^3.0.0: safe-buffer "~5.1.0" ultron "~1.1.0" +ws@^5.2.0: + version "5.2.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" + dependencies: + async-limiter "~1.0.0" + xdg-basedir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" @@ -6839,6 +9222,10 @@ xhr-request@^1.0.1: url-set-query "^1.0.0" xhr "^2.0.4" +xhr2@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/xhr2/-/xhr2-0.1.4.tgz#7f87658847716db5026323812f818cadab387a5f" + xhr@^2.0.4, xhr@^2.3.3: version "2.4.1" resolved "https://registry.yarnpkg.com/xhr/-/xhr-2.4.1.tgz#ba982cced205ae5eec387169ac9dc77ca4853d38" @@ -6848,6 +9235,20 @@ xhr@^2.0.4, xhr@^2.3.3: parse-headers "^2.0.0" xtend "^4.0.0" +xml-name-validator@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" + +xmlhttprequest-cookie@^0.9.2: + version "0.9.7" + resolved "https://registry.yarnpkg.com/xmlhttprequest-cookie/-/xmlhttprequest-cookie-0.9.7.tgz#4b954d1e53b5608182247a54cae69103696b654c" + dependencies: + xmlhttprequest ">=1.8.0" + +xmlhttprequest@>=1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz#67fe075c5c24fef39f9d65f5f7b7fe75171968fc" + xregexp@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-4.0.0.tgz#e698189de49dd2a18cc5687b05e17c8e43943020" @@ -6890,7 +9291,7 @@ yargs-parser@^9.0.2: dependencies: camelcase "^4.1.0" -yargs@11.1.0: +yargs@11.1.0, yargs@^11.0.0: version "11.1.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" dependencies: From d1db17aefc938ec057de0199e53b8c444543708e Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Mon, 20 Aug 2018 18:42:04 -0700 Subject: [PATCH 10/28] feat: fix tests not finishing --- .gitignore | 1 + packages/gnarly-core/package.json | 4 ++-- packages/gnarly-core/test/stores/AllStores.spec.ts | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 5ca885d..d0d92f8 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ lib lcov.info .coveralls.yml *.sqlite +log.txt diff --git a/packages/gnarly-core/package.json b/packages/gnarly-core/package.json index 8705906..05f7a82 100644 --- a/packages/gnarly-core/package.json +++ b/packages/gnarly-core/package.json @@ -8,8 +8,8 @@ "prepare": "npm run build", "build": "npm run build-ts && npm run tslint", "start": "node lib/index.js", - "test": "TS_NODE_PROJECT=./tsconfig.test.json nyc --reporter=text mocha -r ts-node/register -r source-map-support/register --full-trace 'test/**/*.spec.ts'", - "watch-test": " TS_NODE_PROJECT=./tsconfig.test.json mocha --watch --watch-extensions ts -r ts-node/register -r source-map-support/register --full-trace 'test/**/*.spec.ts'", + "test": "TS_NODE_PROJECT=./tsconfig.test.json nyc --reporter=text mocha --exit -r ts-node/register -r source-map-support/register --full-trace 'test/**/*.spec.ts'", + "watch-test": " TS_NODE_PROJECT=./tsconfig.test.json mocha --exit --watch --watch-extensions ts -r ts-node/register -r source-map-support/register --full-trace 'test/**/*.spec.ts'", "coverage": "nyc report --reporter=text-lcov > ./lcov.info", "build-ts": "tsc", "watch-ts": "tsc -w", diff --git a/packages/gnarly-core/test/stores/AllStores.spec.ts b/packages/gnarly-core/test/stores/AllStores.spec.ts index fde7199..0358ff6 100644 --- a/packages/gnarly-core/test/stores/AllStores.spec.ts +++ b/packages/gnarly-core/test/stores/AllStores.spec.ts @@ -17,9 +17,9 @@ describe('All Stores', function () { const sequelizeStore = new SequelizePersistInterface(Sequelize, sequelize) describe('PouchDB Store (pouchdb-server)', function () { - this.timeout(9000) + this.timeout(12000) before(async function () { - this.child = exec('pouchdb-server -p 5985 -m -d /tmp') + this.child = exec('pouchdb-server -p 5985 -m') this.child.on('error', (error) => { console.log(`child error:\n${error}`) }) @@ -34,12 +34,12 @@ describe('All Stores', function () { }) describe('PouchDB Store (default)', function () { - this.timeout(9000) + this.timeout(12000) // assumes pouchdb-server/CouchDB available on default port shouldBehaveLikePersistInterface(defaultPouchStore) }) - describe.only('Sequelize Store (Postgres)', function () { + describe('Sequelize Store (Postgres)', function () { this.timeout(2000) // assumes postgres is running locally on default port shouldBehaveLikePersistInterface(sequelizeStore) From 4ddd4092eea71ba21cf4f5192650e8a67765a417 Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Mon, 20 Aug 2018 18:43:01 -0700 Subject: [PATCH 11/28] fix: stream test progress --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a57e2cc..69ff179 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "scripts": { "watch-ts": "lerna run watch-ts --parallel", "build-ts": "lerna run build-ts", - "test": "lerna run test --scope @xlnt/gnarly-core", + "test": "lerna run test --stream --scope @xlnt/gnarly-core", "lint": "lerna run lint --parallel", "clean": "lerna clean --yes && lerna exec --parallel -- rm -r ./lib", "coverage": "yarn run coverage:generate && yarn run coverage:submit", From ceffd5239b4fd82d5ba0ef7e158d5184304fba54 Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Mon, 20 Aug 2018 23:19:58 -0700 Subject: [PATCH 12/28] fix: use latest postgres for travis --- .travis.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c39d9b5..9172f3e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,16 @@ sudo: required group: beta language: node_js node_js: -- '10' + - '10' +addons: + postgresql: '10' + apt: + packages: + - postgresql-10 + - postgresql-client-10 cache: directories: - - node_modules + - node_modules services: - postgresql - couchdb From 04db835026e086595300129f3619c2e82d5332b7 Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Mon, 20 Aug 2018 23:43:18 -0700 Subject: [PATCH 13/28] fix: change postgres to 9.6 --- .travis.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9172f3e..8c8abcd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,11 +5,7 @@ language: node_js node_js: - '10' addons: - postgresql: '10' - apt: - packages: - - postgresql-10 - - postgresql-client-10 + postgresql: '9.6' cache: directories: - node_modules From ec0290d9b2fecc3218f00ad69bf62ece60365523 Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Thu, 23 Aug 2018 19:26:34 -0700 Subject: [PATCH 14/28] fix: instrument test --- packages/gnarly-core/src/stores/pouchdb.ts | 3 +++ packages/gnarly-core/test/stores/PersistInterface.behavior.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/gnarly-core/src/stores/pouchdb.ts b/packages/gnarly-core/src/stores/pouchdb.ts index 74bbb74..ac19285 100644 --- a/packages/gnarly-core/src/stores/pouchdb.ts +++ b/packages/gnarly-core/src/stores/pouchdb.ts @@ -152,6 +152,9 @@ export default class PouchDBPersistInterface implements IPersistInterface { // god, this is the worst hack ever, but I'm tired of dealing with pouchdb's weird schema const allBlocks = await this.getHistoricalBlocks(reducerKey) const blocksToDelete = allBlocks.slice(0, -1 * blockRetention) + if (blocksToDelete.length) { + console.log('deleting blocks:', blocksToDelete.length) + } // ^ all blocks before blockRetention await db.bulkDocs(blocksToDelete.map((r) => ({ ...r, _deleted: true }))) } diff --git a/packages/gnarly-core/test/stores/PersistInterface.behavior.ts b/packages/gnarly-core/test/stores/PersistInterface.behavior.ts index f9e0564..5abe8e4 100644 --- a/packages/gnarly-core/test/stores/PersistInterface.behavior.ts +++ b/packages/gnarly-core/test/stores/PersistInterface.behavior.ts @@ -2,7 +2,7 @@ import chai = require('chai') import { pickBy } from 'lodash' import 'mocha' -const should = chai +chai .use(require('chai-spies')) .should() From bd7d035a7cf0f21412fdaa6912d45278a86eeb3c Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Thu, 23 Aug 2018 19:39:18 -0700 Subject: [PATCH 15/28] fix: increase timeout duration for tests --- packages/gnarly-core/test/stores/AllStores.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gnarly-core/test/stores/AllStores.spec.ts b/packages/gnarly-core/test/stores/AllStores.spec.ts index 0358ff6..fbaefde 100644 --- a/packages/gnarly-core/test/stores/AllStores.spec.ts +++ b/packages/gnarly-core/test/stores/AllStores.spec.ts @@ -17,7 +17,7 @@ describe('All Stores', function () { const sequelizeStore = new SequelizePersistInterface(Sequelize, sequelize) describe('PouchDB Store (pouchdb-server)', function () { - this.timeout(12000) + this.timeout(22000) before(async function () { this.child = exec('pouchdb-server -p 5985 -m') this.child.on('error', (error) => { From 0013c08c92a7ca2a4641655761b34e7777ddf91a Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Thu, 23 Aug 2018 19:41:53 -0700 Subject: [PATCH 16/28] fix: cache gnarly-core nodemodules directory --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 8c8abcd..47c70d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ addons: cache: directories: - node_modules + - packages/gnarly-core/node_modules services: - postgresql - couchdb From 7dd631dcf2f39cbafbdb0c84d9297a12593b0a9c Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Thu, 23 Aug 2018 19:42:42 -0700 Subject: [PATCH 17/28] fix: cache the rest of the node modules, too --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 47c70d3..720fd6a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,10 @@ cache: directories: - node_modules - packages/gnarly-core/node_modules + - packages/gnarly-reducer-block-meta/node_modules + - packages/gnarly-reducer-erc20/node_modules + - packages/gnarly-reducer-erc721/node_modules + - packages/gnarly-reducer-events/node_modules services: - postgresql - couchdb From ec971de7778cacc83f6f1701cd269a6626cb2d1e Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Thu, 23 Aug 2018 19:45:55 -0700 Subject: [PATCH 18/28] fix: add more instrumentation --- packages/gnarly-core/src/stores/sequelize.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/gnarly-core/src/stores/sequelize.ts b/packages/gnarly-core/src/stores/sequelize.ts index df7e039..7f246b5 100644 --- a/packages/gnarly-core/src/stores/sequelize.ts +++ b/packages/gnarly-core/src/stores/sequelize.ts @@ -217,13 +217,15 @@ export default class SequelizePersistInterface implements IPersistInterface { }) // remove blocks that are further away than the block retention limit - await this.HistoricalBlock.destroy({ + const numDestroyed = await this.HistoricalBlock.destroy({ where: { reducerId: { [this.Sequelize.Op.eq]: reducerKey }, numberDecimal: { [this.Sequelize.Op.lte]: blockNum.sub(toBN(blockRetention)).toString() }, }, }) + console.log('destroyed length:', numDestroyed) + } catch (error) { throw new Error(`Was not able to save historical block ${JSON.stringify(block)} in reducer ${reducerKey}. ${error.stack}`) From 50a0c9b64ec67d5067ccf1508f5c4097098cb9b1 Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Thu, 23 Aug 2018 20:10:36 -0700 Subject: [PATCH 19/28] fix: minor changes --- packages/gnarly-core/src/stores/pouchdb.ts | 13 +++++++------ packages/gnarly-core/src/stores/sequelize.ts | 4 +--- .../test/stores/PersistInterface.behavior.ts | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/gnarly-core/src/stores/pouchdb.ts b/packages/gnarly-core/src/stores/pouchdb.ts index ac19285..883ce5d 100644 --- a/packages/gnarly-core/src/stores/pouchdb.ts +++ b/packages/gnarly-core/src/stores/pouchdb.ts @@ -141,7 +141,7 @@ export default class PouchDBPersistInterface implements IPersistInterface { public saveHistoricalBlock = async (reducerKey: string, blockRetention: number, block: IJSONBlock): Promise => { const db = await this.historicalBlocks.get(reducerKey) - await db.putIfNotExists({ + await db.put({ _id: uuid(), hash: block.hash, parentHash: block.parentHash, @@ -151,12 +151,13 @@ export default class PouchDBPersistInterface implements IPersistInterface { // god, this is the worst hack ever, but I'm tired of dealing with pouchdb's weird schema const allBlocks = await this.getHistoricalBlocks(reducerKey) - const blocksToDelete = allBlocks.slice(0, -1 * blockRetention) - if (blocksToDelete.length) { - console.log('deleting blocks:', blocksToDelete.length) + if (allBlocks.length > blockRetention) { + // delete the blocks from [0, length - blockRetention) + // so for a length of 102 and retention of 100, delete the range [0, 2) + const blocksToDelete = allBlocks.slice(0, -1 * blockRetention) + // ^ all blocks before blockRetention + await db.bulkDocs(blocksToDelete.map((r) => ({ ...r, _deleted: true }))) } - // ^ all blocks before blockRetention - await db.bulkDocs(blocksToDelete.map((r) => ({ ...r, _deleted: true }))) } public deleteHistoricalBlock = async (reducerKey: string, blockHash: string): Promise => { diff --git a/packages/gnarly-core/src/stores/sequelize.ts b/packages/gnarly-core/src/stores/sequelize.ts index 7f246b5..df7e039 100644 --- a/packages/gnarly-core/src/stores/sequelize.ts +++ b/packages/gnarly-core/src/stores/sequelize.ts @@ -217,15 +217,13 @@ export default class SequelizePersistInterface implements IPersistInterface { }) // remove blocks that are further away than the block retention limit - const numDestroyed = await this.HistoricalBlock.destroy({ + await this.HistoricalBlock.destroy({ where: { reducerId: { [this.Sequelize.Op.eq]: reducerKey }, numberDecimal: { [this.Sequelize.Op.lte]: blockNum.sub(toBN(blockRetention)).toString() }, }, }) - console.log('destroyed length:', numDestroyed) - } catch (error) { throw new Error(`Was not able to save historical block ${JSON.stringify(block)} in reducer ${reducerKey}. ${error.stack}`) diff --git a/packages/gnarly-core/test/stores/PersistInterface.behavior.ts b/packages/gnarly-core/test/stores/PersistInterface.behavior.ts index 5abe8e4..1750bdd 100644 --- a/packages/gnarly-core/test/stores/PersistInterface.behavior.ts +++ b/packages/gnarly-core/test/stores/PersistInterface.behavior.ts @@ -12,7 +12,7 @@ import { IPersistInterface } from '../../src/stores' import { buildChain, genesis } from '../utils' const MOCK_REDUCER_KEY = 'test' -const MOCK_RETENTION = 10 +const MOCK_RETENTION = 100 const onlyKeys = (keys: string[]) => (thing: object) => pickBy(thing, (value, key) => keys.includes(key)) From 7c28c052bfce232eec2d5e8373da15dc5eca4a04 Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Sun, 2 Sep 2018 12:57:04 -0700 Subject: [PATCH 20/28] fix: add some comments for clarity --- packages/gnarly-core/src/stores/pouchdb.ts | 13 ++++++++----- packages/gnarly-core/test/stores/AllStores.spec.ts | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/gnarly-core/src/stores/pouchdb.ts b/packages/gnarly-core/src/stores/pouchdb.ts index 883ce5d..64efc7c 100644 --- a/packages/gnarly-core/src/stores/pouchdb.ts +++ b/packages/gnarly-core/src/stores/pouchdb.ts @@ -66,7 +66,7 @@ const deleteById = async (db: PouchDB.Database, id: string) => { await db.remove(await db.get(id)) } -const reducerDb = (e: string) => `${e}/${GNARLY_DB_PREFIX}-reducers` +const reducerDb = (e: string): PouchDB.Database => new PouchDB(`${e}/${GNARLY_DB_PREFIX}-reducers`) const historicalBlocksDb = (e: string) => async (key: string): Promise => new PouchDB(`${e}/${GNARLY_DB_PREFIX}-historicalblocks-${key}`) const transactionsDb = (e: string) => async (key: string): Promise => @@ -85,6 +85,9 @@ class DyanmicDict { public get = async (key: string) => { if (this.cache[key]) { return this.cache[key] } + // basically, we don't know the keys of existing dbs until they've been used at runtime + // so when we want to setdown the store we actually just hold onto that idea + // and then, when the database is actually created, we nuke the old one and then create the new one if (this.resetOnFirstInitialization) { await this.resetFn(await this.generator(key)) } @@ -241,10 +244,7 @@ export default class PouchDBPersistInterface implements IPersistInterface { // setup & setdown public setup = async (): Promise => { try { - if (this.didSetDown) { - await (new PouchDB(reducerDb(this.dbEndpoint))).destroy() - } - this.reducers = new PouchDB(reducerDb(this.dbEndpoint)) + this.reducers = reducerDb(this.dbEndpoint) this.historicalBlocks = new DyanmicDict(historicalBlocksDb(this.dbEndpoint), destroyDb, this.didSetDown) this.transactions = new DyanmicDict(transactionsDb(this.dbEndpoint), destroyDb, this.didSetDown) } catch (error) { @@ -255,6 +255,9 @@ export default class PouchDBPersistInterface implements IPersistInterface { public setdown = async (): Promise => { this.didSetDown = true + // @TODO - replace this dynamic dict setdown situation by iterating over all of the reducers + await reducerDb(this.dbEndpoint).destroy() + if (this.historicalBlocks) { await this.historicalBlocks.flush() } diff --git a/packages/gnarly-core/test/stores/AllStores.spec.ts b/packages/gnarly-core/test/stores/AllStores.spec.ts index fbaefde..8082f18 100644 --- a/packages/gnarly-core/test/stores/AllStores.spec.ts +++ b/packages/gnarly-core/test/stores/AllStores.spec.ts @@ -11,6 +11,7 @@ describe('All Stores', function () { const pouchDBServerStore = new PouchDBPersistInterface('http://127.0.0.1:5985') const defaultPouchStore = new PouchDBPersistInterface('http://127.0.0.1:5984') + // don't forget to `create database travis_ci_test;` on your local postgres! const sequelize = new Sequelize('postgres://postgres@127.0.0.1:5432/travis_ci_test', { logging: false, }) From ddb47b2b6cce00a34832904e5bbce68ef2af3f4e Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Sun, 2 Sep 2018 13:07:00 -0700 Subject: [PATCH 21/28] fix: start all gnarly tables with a letter --- packages/gnarly-core/src/stores/pouchdb.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/gnarly-core/src/stores/pouchdb.ts b/packages/gnarly-core/src/stores/pouchdb.ts index 64efc7c..cb0289c 100644 --- a/packages/gnarly-core/src/stores/pouchdb.ts +++ b/packages/gnarly-core/src/stores/pouchdb.ts @@ -43,9 +43,10 @@ async function* batch ( } } -// all databases have --gnarly prefix so we can delete them and not destroy any user data -// that might be sitting around -const GNARLY_DB_PREFIX = '--gnarly' +// all databases have this prefix so we can differentiate them +// and ideally not destroy any normal data that might be sitting around +// couchdb database names must begin with a letter +const GNARLY_DB_PREFIX = 'z--gnarly' const sortByHexProp = (prop: string) => (a, b) => toBN(a[prop]).sub(toBN(b[prop])).toNumber() // const sortById = (a, b) => KSUID.parse(a._id).compare(KSUID.parse(b._id)) From 5bea34de9ee191d24ad055fab6cd2ca875a9923a Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Sun, 2 Sep 2018 13:09:40 -0700 Subject: [PATCH 22/28] fix: add small wait between db destroy and create --- packages/gnarly-core/src/stores/pouchdb.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/gnarly-core/src/stores/pouchdb.ts b/packages/gnarly-core/src/stores/pouchdb.ts index cb0289c..6db7a48 100644 --- a/packages/gnarly-core/src/stores/pouchdb.ts +++ b/packages/gnarly-core/src/stores/pouchdb.ts @@ -12,7 +12,7 @@ import { ITransaction, } from '../ourbit/types' import { IPersistInterface } from '../stores' -import { forEach, toBN, uuid } from '../utils' +import { forEach, timeout, toBN, uuid } from '../utils' // https://pouchdb.com/api.html#batch_fetch async function* batch ( @@ -93,6 +93,9 @@ class DyanmicDict { await this.resetFn(await this.generator(key)) } + await timeout(200) + // ^ if we delete a table and then recreated it too quickly, we get no_db_file errors ಠ_ಠ + this.cache[key] = await this.generator(key) return this.cache[key] } From e528d686d50e59d7a81633853689221f25d3ae9a Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Sun, 2 Sep 2018 13:21:31 -0700 Subject: [PATCH 23/28] fix: remove couchdb test case --- packages/gnarly-core/test/stores/AllStores.spec.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/gnarly-core/test/stores/AllStores.spec.ts b/packages/gnarly-core/test/stores/AllStores.spec.ts index 8082f18..69c8cb4 100644 --- a/packages/gnarly-core/test/stores/AllStores.spec.ts +++ b/packages/gnarly-core/test/stores/AllStores.spec.ts @@ -9,7 +9,7 @@ import shouldBehaveLikePersistInterface from './PersistInterface.behavior' describe('All Stores', function () { const pouchDBServerStore = new PouchDBPersistInterface('http://127.0.0.1:5985') - const defaultPouchStore = new PouchDBPersistInterface('http://127.0.0.1:5984') + // const defaultPouchStore = new PouchDBPersistInterface('http://127.0.0.1:5984') // don't forget to `create database travis_ci_test;` on your local postgres! const sequelize = new Sequelize('postgres://postgres@127.0.0.1:5432/travis_ci_test', { @@ -34,11 +34,12 @@ describe('All Stores', function () { shouldBehaveLikePersistInterface(pouchDBServerStore) }) - describe('PouchDB Store (default)', function () { - this.timeout(12000) - // assumes pouchdb-server/CouchDB available on default port - shouldBehaveLikePersistInterface(defaultPouchStore) - }) + // @TODO - couchdb is not api-compatible with pouchdb-server it seems + // describe('PouchDB Store (default)', function () { + // this.timeout(12000) + // // assumes pouchdb-server/CouchDB available on default port + // shouldBehaveLikePersistInterface(defaultPouchStore) + // }) describe('Sequelize Store (Postgres)', function () { this.timeout(2000) From 17bbf52d4a4553efbbb2f41d3a31ba532599f731 Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Wed, 5 Sep 2018 14:51:40 -0700 Subject: [PATCH 24/28] fix: rename IPersistInterface to IStore --- packages/gnarly-core/src/Gnarly.ts | 4 ++-- packages/gnarly-core/src/globalstate.ts | 6 +++--- .../src/stores/{IPersistInterface.ts => IStore.ts} | 2 +- packages/gnarly-core/src/stores/index.ts | 4 ++-- packages/gnarly-core/src/stores/pouchdb.ts | 4 ++-- packages/gnarly-core/src/stores/sequelize.ts | 4 ++-- packages/gnarly-core/test/mocks/MockPersistInterface.ts | 4 ++-- .../gnarly-core/test/stores/PersistInterface.behavior.ts | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) rename packages/gnarly-core/src/stores/{IPersistInterface.ts => IStore.ts} (97%) diff --git a/packages/gnarly-core/src/Gnarly.ts b/packages/gnarly-core/src/Gnarly.ts index 8bb587f..231069c 100644 --- a/packages/gnarly-core/src/Gnarly.ts +++ b/packages/gnarly-core/src/Gnarly.ts @@ -5,7 +5,7 @@ import { globalState } from './globalstate' import IIngestApi from './ingestion/IngestApi' import { IReducer } from './reducer' -import { IPersistInterface } from './stores' +import { IStore } from './stores' import ReducerRunner, { makeRunner } from './ReducerRunner' @@ -14,7 +14,7 @@ class Gnarly { constructor ( ingestApi: IIngestApi, - store: IPersistInterface, + store: IStore, private reducers: IReducer[], ) { globalState.setApi(ingestApi) diff --git a/packages/gnarly-core/src/globalstate.ts b/packages/gnarly-core/src/globalstate.ts index 0c138d3..6888580 100644 --- a/packages/gnarly-core/src/globalstate.ts +++ b/packages/gnarly-core/src/globalstate.ts @@ -8,7 +8,7 @@ import IIngestApi from './ingestion/IngestApi' import IABIItem, { IABIItemInput } from './models/ABIItem' import Log from './models/Log' -import { IPersistInterface } from './stores' +import { IStore } from './stores' import { enhanceAbiItem, onlySupportedAbiItems } from './utils' export type ABIItemSet = IABIItem[] @@ -17,7 +17,7 @@ export class GnarlyGlobals { // @TODO(shrugs) - do we need to move this to a contract artifact? public abis: { [s: string]: ABIItemSet } = {} public api: IIngestApi - public store: IPersistInterface + public store: IStore public getLogs = async (options) => { const logs = await this.api.getLogs(options) @@ -28,7 +28,7 @@ export class GnarlyGlobals { this.api = api } - public setStore = (store: IPersistInterface) => { + public setStore = (store: IStore) => { this.store = store } diff --git a/packages/gnarly-core/src/stores/IPersistInterface.ts b/packages/gnarly-core/src/stores/IStore.ts similarity index 97% rename from packages/gnarly-core/src/stores/IPersistInterface.ts rename to packages/gnarly-core/src/stores/IStore.ts index 7cbe9ea..e54be03 100644 --- a/packages/gnarly-core/src/stores/IPersistInterface.ts +++ b/packages/gnarly-core/src/stores/IStore.ts @@ -1,7 +1,7 @@ import { IJSONBlock } from '../models/Block' import { ITransaction } from '../ourbit/types' -export interface IPersistInterface { +export interface IStore { // @TODO - how do you get typescript to stop complaining about AsyncIterator symbols? // reducer CRUD diff --git a/packages/gnarly-core/src/stores/index.ts b/packages/gnarly-core/src/stores/index.ts index d1c365a..2a8efe8 100644 --- a/packages/gnarly-core/src/stores/index.ts +++ b/packages/gnarly-core/src/stores/index.ts @@ -8,5 +8,5 @@ export { } from './pouchdb' export { - IPersistInterface, -} from './IPersistInterface' + IStore, +} from './IStore' diff --git a/packages/gnarly-core/src/stores/pouchdb.ts b/packages/gnarly-core/src/stores/pouchdb.ts index 6db7a48..34b8c3d 100644 --- a/packages/gnarly-core/src/stores/pouchdb.ts +++ b/packages/gnarly-core/src/stores/pouchdb.ts @@ -11,7 +11,7 @@ import { IJSONBlock } from '../models/Block' import { ITransaction, } from '../ourbit/types' -import { IPersistInterface } from '../stores' +import { IStore } from '../stores' import { forEach, timeout, toBN, uuid } from '../utils' // https://pouchdb.com/api.html#batch_fetch @@ -112,7 +112,7 @@ class DyanmicDict { } } -export default class PouchDBPersistInterface implements IPersistInterface { +export default class PouchDBPersistInterface implements IStore { private reducers: PouchDB.Database private historicalBlocks: DyanmicDict private transactions: DyanmicDict diff --git a/packages/gnarly-core/src/stores/sequelize.ts b/packages/gnarly-core/src/stores/sequelize.ts index df7e039..045ab6e 100644 --- a/packages/gnarly-core/src/stores/sequelize.ts +++ b/packages/gnarly-core/src/stores/sequelize.ts @@ -6,7 +6,7 @@ import { IJSONBlock } from '../models/Block' import { ITransaction, } from '../ourbit/types' -import { IPersistInterface } from '../stores' +import { IStore } from '../stores' import { toBN } from '../utils' export const makeSequelizeModels = ( @@ -127,7 +127,7 @@ async function* batch ( } } -export default class SequelizePersistInterface implements IPersistInterface { +export default class SequelizePersistInterface implements IStore { private Reducer private HistoricalBlock private Transaction diff --git a/packages/gnarly-core/test/mocks/MockPersistInterface.ts b/packages/gnarly-core/test/mocks/MockPersistInterface.ts index f983005..7d8032c 100644 --- a/packages/gnarly-core/test/mocks/MockPersistInterface.ts +++ b/packages/gnarly-core/test/mocks/MockPersistInterface.ts @@ -3,7 +3,7 @@ import { IJSONBlock } from '../../src/models/Block' import { ITransaction, } from '../../src/ourbit' -import { IPersistInterface } from '../../src/stores' +import { IStore } from '../../src/stores' async function* iter ( res: any[] = [], @@ -13,7 +13,7 @@ async function* iter ( } } -export default class MockPersistInterface implements IPersistInterface { +export default class MockPersistInterface implements IStore { private reducers: any[] = [] private transactions: ITransaction[] = [] diff --git a/packages/gnarly-core/test/stores/PersistInterface.behavior.ts b/packages/gnarly-core/test/stores/PersistInterface.behavior.ts index 1750bdd..7384f4f 100644 --- a/packages/gnarly-core/test/stores/PersistInterface.behavior.ts +++ b/packages/gnarly-core/test/stores/PersistInterface.behavior.ts @@ -8,7 +8,7 @@ chai import { forEach } from '../../src/utils' -import { IPersistInterface } from '../../src/stores' +import { IStore } from '../../src/stores' import { buildChain, genesis } from '../utils' const MOCK_REDUCER_KEY = 'test' @@ -27,7 +27,7 @@ const blocksShouldEqual = (as, bs) => as.map(onlyKeys(historialBlockKeys)) bs.map(onlyKeys(historialBlockKeys)), ) -const shouldBehaveAsStore = (store: IPersistInterface) => { +const shouldBehaveAsStore = (store: IStore) => { const saveAllHistoricalBlocks = async (blocks) => forEach(blocks, (block) => store.saveHistoricalBlock(MOCK_REDUCER_KEY, MOCK_RETENTION, block), ) From b40f7caaf81eb953d54f59ba825aa0b3d69d05c4 Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Wed, 5 Sep 2018 15:03:27 -0700 Subject: [PATCH 25/28] fix: remove couchdb service --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 720fd6a..c68d4f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,6 @@ cache: - packages/gnarly-reducer-events/node_modules services: - postgresql - - couchdb matrix: fast_finish: true before_script: From 04e6707a1c979b9eaa0e533ae00a21cbcf67fb5e Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Wed, 5 Sep 2018 15:06:48 -0700 Subject: [PATCH 26/28] feat: rename PersistInterfaces to Stores --- packages/gnarly-bin/src/index.ts | 8 ++++---- packages/gnarly-core/src/stores/IStore.ts | 2 +- .../src/stores/{pouchdb.ts => PouchDBStore.ts} | 2 +- .../src/stores/{sequelize.ts => SequelizeStore.ts} | 2 +- packages/gnarly-core/src/stores/index.ts | 10 +++++----- packages/gnarly-core/test/Blockstream.spec.ts | 6 +++--- packages/gnarly-core/test/Ourbit.spec.ts | 4 ++-- packages/gnarly-core/test/globalstate.spec.ts | 4 ++-- .../mocks/{MockPersistInterface.ts => MockStore.ts} | 2 +- packages/gnarly-core/test/stores/AllStores.spec.ts | 10 +++++----- 10 files changed, 25 insertions(+), 25 deletions(-) rename packages/gnarly-core/src/stores/{pouchdb.ts => PouchDBStore.ts} (99%) rename packages/gnarly-core/src/stores/{sequelize.ts => SequelizeStore.ts} (99%) rename packages/gnarly-core/test/mocks/{MockPersistInterface.ts => MockStore.ts} (97%) diff --git a/packages/gnarly-bin/src/index.ts b/packages/gnarly-bin/src/index.ts index d12e292..51e76cd 100644 --- a/packages/gnarly-bin/src/index.ts +++ b/packages/gnarly-bin/src/index.ts @@ -10,8 +10,8 @@ const debug = makeDebug('gnarly') import Sequelize = require('sequelize') import Gnarly, { - PouchDBPersistInterface, - SequelizePersistInterface, + PouchDBStore, + SequelizeStore, Web3Api, } from '@xlnt/gnarly-core' @@ -97,8 +97,8 @@ const main = async () => { eventsReducer, ] - const store = new PouchDBPersistInterface('http://127.0.0.1:5984') - // const store = new SequelizePersistInterface(Sequelize, sequelize) + // const store = new PouchDBStore('http://127.0.0.1:5984') + const store = new SequelizeStore(Sequelize, sequelize) const ingestApi = new Web3Api(nodeEndpoint) diff --git a/packages/gnarly-core/src/stores/IStore.ts b/packages/gnarly-core/src/stores/IStore.ts index e54be03..785ab96 100644 --- a/packages/gnarly-core/src/stores/IStore.ts +++ b/packages/gnarly-core/src/stores/IStore.ts @@ -1,7 +1,7 @@ import { IJSONBlock } from '../models/Block' import { ITransaction } from '../ourbit/types' -export interface IStore { +export default interface IStore { // @TODO - how do you get typescript to stop complaining about AsyncIterator symbols? // reducer CRUD diff --git a/packages/gnarly-core/src/stores/pouchdb.ts b/packages/gnarly-core/src/stores/PouchDBStore.ts similarity index 99% rename from packages/gnarly-core/src/stores/pouchdb.ts rename to packages/gnarly-core/src/stores/PouchDBStore.ts index 34b8c3d..c23cd5b 100644 --- a/packages/gnarly-core/src/stores/pouchdb.ts +++ b/packages/gnarly-core/src/stores/PouchDBStore.ts @@ -112,7 +112,7 @@ class DyanmicDict { } } -export default class PouchDBPersistInterface implements IStore { +export default class PouchDBStore implements IStore { private reducers: PouchDB.Database private historicalBlocks: DyanmicDict private transactions: DyanmicDict diff --git a/packages/gnarly-core/src/stores/sequelize.ts b/packages/gnarly-core/src/stores/SequelizeStore.ts similarity index 99% rename from packages/gnarly-core/src/stores/sequelize.ts rename to packages/gnarly-core/src/stores/SequelizeStore.ts index 045ab6e..b505cdb 100644 --- a/packages/gnarly-core/src/stores/sequelize.ts +++ b/packages/gnarly-core/src/stores/SequelizeStore.ts @@ -127,7 +127,7 @@ async function* batch ( } } -export default class SequelizePersistInterface implements IStore { +export default class SequelizeStore implements IStore { private Reducer private HistoricalBlock private Transaction diff --git a/packages/gnarly-core/src/stores/index.ts b/packages/gnarly-core/src/stores/index.ts index 2a8efe8..e572ad2 100644 --- a/packages/gnarly-core/src/stores/index.ts +++ b/packages/gnarly-core/src/stores/index.ts @@ -1,12 +1,12 @@ export { - default as SequelizePersistInterface, + default as SequelizeStore, makeSequelizeModels, -} from './sequelize' +} from './SequelizeStore' export { - default as PouchDBPersistInterface, -} from './pouchdb' + default as PouchDBStore, +} from './PouchDBStore' export { - IStore, + default as IStore, } from './IStore' diff --git a/packages/gnarly-core/test/Blockstream.spec.ts b/packages/gnarly-core/test/Blockstream.spec.ts index 46d2c08..b508ff2 100644 --- a/packages/gnarly-core/test/Blockstream.spec.ts +++ b/packages/gnarly-core/test/Blockstream.spec.ts @@ -7,7 +7,7 @@ import { IJSONBlock } from '../src/models/Block' import { forEach, timeout, toBN, toHex } from '../src/utils' import MockIngestApi from './mocks/MockIngestApi' -import MockPersistInterface from './mocks/MockPersistInterface' +import MockStore from './mocks/MockStore' import { buildChain, genesis } from './utils' const RETENTION = 20 @@ -18,7 +18,7 @@ const should = chai .use(require('chai-spies')) .should() -const bootstrapHistoricalBlocks = async (reducerKey: string, blocks, store: MockPersistInterface, bs: Blockstream) => { +const bootstrapHistoricalBlocks = async (reducerKey: string, blocks, store: MockStore, bs: Blockstream) => { await forEach(blocks, async (block) => store.saveHistoricalBlock(reducerKey, 100, block), { concurrency: 1 }) await bs.initWithHistoricalBlocks(blocks) } @@ -42,7 +42,7 @@ describe('Blockstream', function () { }) this.api = new MockIngestApi() - this.store = new MockPersistInterface() + this.store = new MockStore() globalState.setApi(this.api) globalState.setStore(this.store) diff --git a/packages/gnarly-core/test/Ourbit.spec.ts b/packages/gnarly-core/test/Ourbit.spec.ts index d50ef04..ff03918 100644 --- a/packages/gnarly-core/test/Ourbit.spec.ts +++ b/packages/gnarly-core/test/Ourbit.spec.ts @@ -8,7 +8,7 @@ import Ourbit, { ITransaction, ITxExtra, } from '../src/ourbit' import { ReducerContext } from '../src/reducer' -import MockPersistInterface from './mocks/MockPersistInterface' +import MockStore from './mocks/MockStore' chai .use(require('chai-spies')) @@ -62,7 +62,7 @@ describe('Ourbit', () => { } targetState = {} - const store = new MockPersistInterface() + const store = new MockStore() sandbox.on(store, [ 'saveTransaction', ]) diff --git a/packages/gnarly-core/test/globalstate.spec.ts b/packages/gnarly-core/test/globalstate.spec.ts index 2fbc8b2..5bf1304 100644 --- a/packages/gnarly-core/test/globalstate.spec.ts +++ b/packages/gnarly-core/test/globalstate.spec.ts @@ -6,7 +6,7 @@ import Log from '../src/models/Log' import { enhanceAbiItem } from '../src/utils' import MockIngestApi from './mocks/MockIngestApi' -import MockPersistInterface from './mocks/MockPersistInterface' +import MockStore from './mocks/MockStore' import erc20Abi from './data/erc20Abi' @@ -36,7 +36,7 @@ describe('globalstate', function () { context('store', function () { beforeEach(async function () { - this.store = new MockPersistInterface() + this.store = new MockStore() }) it('can set/get store', async function () { diff --git a/packages/gnarly-core/test/mocks/MockPersistInterface.ts b/packages/gnarly-core/test/mocks/MockStore.ts similarity index 97% rename from packages/gnarly-core/test/mocks/MockPersistInterface.ts rename to packages/gnarly-core/test/mocks/MockStore.ts index 7d8032c..f2fdb34 100644 --- a/packages/gnarly-core/test/mocks/MockPersistInterface.ts +++ b/packages/gnarly-core/test/mocks/MockStore.ts @@ -13,7 +13,7 @@ async function* iter ( } } -export default class MockPersistInterface implements IStore { +export default class MockStore implements IStore { private reducers: any[] = [] private transactions: ITransaction[] = [] diff --git a/packages/gnarly-core/test/stores/AllStores.spec.ts b/packages/gnarly-core/test/stores/AllStores.spec.ts index 69c8cb4..08061bd 100644 --- a/packages/gnarly-core/test/stores/AllStores.spec.ts +++ b/packages/gnarly-core/test/stores/AllStores.spec.ts @@ -1,21 +1,21 @@ import { exec } from 'child_process' import Sequelize = require('sequelize') -import PouchDBPersistInterface from '../../src/stores/pouchdb' -import SequelizePersistInterface from '../../src/stores/sequelize' +import PouchDBStore from '../../src/stores/pouchdb' +import SequelizeStore from '../../src/stores/sequelize' import { timeout } from '../../src/utils' import shouldBehaveLikePersistInterface from './PersistInterface.behavior' describe('All Stores', function () { - const pouchDBServerStore = new PouchDBPersistInterface('http://127.0.0.1:5985') - // const defaultPouchStore = new PouchDBPersistInterface('http://127.0.0.1:5984') + const pouchDBServerStore = new PouchDBStore('http://127.0.0.1:5985') + // const defaultPouchStore = new PouchDBStore('http://127.0.0.1:5984') // don't forget to `create database travis_ci_test;` on your local postgres! const sequelize = new Sequelize('postgres://postgres@127.0.0.1:5432/travis_ci_test', { logging: false, }) - const sequelizeStore = new SequelizePersistInterface(Sequelize, sequelize) + const sequelizeStore = new SequelizeStore(Sequelize, sequelize) describe('PouchDB Store (pouchdb-server)', function () { this.timeout(22000) From 6c23aab532e83671b05bd9236425180b0add5367 Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Wed, 5 Sep 2018 15:07:44 -0700 Subject: [PATCH 27/28] fix: refactor store references --- ...PersistInterface.behavior.ts => Store.behavior.ts} | 0 .../test/stores/{AllStores.spec.ts => Stores.spec.ts} | 11 +++++------ 2 files changed, 5 insertions(+), 6 deletions(-) rename packages/gnarly-core/test/stores/{PersistInterface.behavior.ts => Store.behavior.ts} (100%) rename packages/gnarly-core/test/stores/{AllStores.spec.ts => Stores.spec.ts} (78%) diff --git a/packages/gnarly-core/test/stores/PersistInterface.behavior.ts b/packages/gnarly-core/test/stores/Store.behavior.ts similarity index 100% rename from packages/gnarly-core/test/stores/PersistInterface.behavior.ts rename to packages/gnarly-core/test/stores/Store.behavior.ts diff --git a/packages/gnarly-core/test/stores/AllStores.spec.ts b/packages/gnarly-core/test/stores/Stores.spec.ts similarity index 78% rename from packages/gnarly-core/test/stores/AllStores.spec.ts rename to packages/gnarly-core/test/stores/Stores.spec.ts index 08061bd..ab065e6 100644 --- a/packages/gnarly-core/test/stores/AllStores.spec.ts +++ b/packages/gnarly-core/test/stores/Stores.spec.ts @@ -1,11 +1,10 @@ import { exec } from 'child_process' import Sequelize = require('sequelize') -import PouchDBStore from '../../src/stores/pouchdb' -import SequelizeStore from '../../src/stores/sequelize' +import { PouchDBStore, SequelizeStore } from '../../src/stores' import { timeout } from '../../src/utils' -import shouldBehaveLikePersistInterface from './PersistInterface.behavior' +import Store from './Store.behavior' describe('All Stores', function () { const pouchDBServerStore = new PouchDBStore('http://127.0.0.1:5985') @@ -31,19 +30,19 @@ describe('All Stores', function () { await this.child.kill() }) - shouldBehaveLikePersistInterface(pouchDBServerStore) + Store(pouchDBServerStore) }) // @TODO - couchdb is not api-compatible with pouchdb-server it seems // describe('PouchDB Store (default)', function () { // this.timeout(12000) // // assumes pouchdb-server/CouchDB available on default port - // shouldBehaveLikePersistInterface(defaultPouchStore) + // Store(defaultPouchStore) // }) describe('Sequelize Store (Postgres)', function () { this.timeout(2000) // assumes postgres is running locally on default port - shouldBehaveLikePersistInterface(sequelizeStore) + Store(sequelizeStore) }) }) From 551cba1807ee49a30152cb6dc900cafedb727ac6 Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Wed, 5 Sep 2018 20:28:21 -0700 Subject: [PATCH 28/28] feat: implement ksuids with mid in the key, remove mids elsewhere --- packages/gnarly-core/package.json | 3 + packages/gnarly-core/src/ourbit/Ourbit.ts | 1 + packages/gnarly-core/src/ourbit/types.ts | 1 + .../gnarly-core/src/stores/PouchDBStore.ts | 27 ++- .../gnarly-core/src/stores/SequelizeStore.ts | 26 +-- packages/gnarly-core/src/utils.ts | 29 ++- packages/gnarly-core/test/Ourbit.spec.ts | 9 +- .../test/factories/IOperationFactory.ts | 12 ++ .../test/factories/IPatchFactory.ts | 9 + .../test/factories/ITransactionFactory.ts | 10 + packages/gnarly-core/test/mocks/MockStore.ts | 7 +- .../gnarly-core/test/stores/Store.behavior.ts | 194 ++++++++++++++---- .../gnarly-core/test/stores/Stores.spec.ts | 35 ++-- yarn.lock | 12 +- 14 files changed, 283 insertions(+), 92 deletions(-) create mode 100644 packages/gnarly-core/test/factories/IOperationFactory.ts create mode 100644 packages/gnarly-core/test/factories/IPatchFactory.ts create mode 100644 packages/gnarly-core/test/factories/ITransactionFactory.ts diff --git a/packages/gnarly-core/package.json b/packages/gnarly-core/package.json index 05f7a82..34a4ae7 100644 --- a/packages/gnarly-core/package.json +++ b/packages/gnarly-core/package.json @@ -30,6 +30,7 @@ "dependencies": { "@xlnt/fast-json-patch": "^2.0.8", "bn.js": "^4.11.8", + "crypto": "^1.0.1", "debug": "^3.1.0", "ethereumjs-blockstream": "^3.1.0", "isomorphic-fetch": "^2.2.1", @@ -44,6 +45,7 @@ "pouchdb-find": "^7.0.0", "pouchdb-upsert": "^2.2.0", "sequelize": "^4.35.2", + "string.prototype.padstart": "^3.0.0", "web3-eth-abi": "^1.0.0-beta.34", "web3-utils": "^1.0.0-beta.34" }, @@ -58,6 +60,7 @@ "@types/pouchdb-upsert": "^2.2.3", "bn-chai": "^1.0.1", "chai": "^4.1.2", + "chai-as-promised": "^7.1.1", "chai-spies": "^1.0.0", "concurrently": "^3.5.1", "mocha": "^5.0.4", diff --git a/packages/gnarly-core/src/ourbit/Ourbit.ts b/packages/gnarly-core/src/ourbit/Ourbit.ts index 6383e07..68f2f39 100644 --- a/packages/gnarly-core/src/ourbit/Ourbit.ts +++ b/packages/gnarly-core/src/ourbit/Ourbit.ts @@ -69,6 +69,7 @@ class Ourbit { id: uuid(), operations: ops.map((op) => ({ ...op, + id: uuid(), volatile: false, })), reason: this.context.getCurrentReason(), diff --git a/packages/gnarly-core/src/ourbit/types.ts b/packages/gnarly-core/src/ourbit/types.ts index 4cb9a7a..1a8833a 100644 --- a/packages/gnarly-core/src/ourbit/types.ts +++ b/packages/gnarly-core/src/ourbit/types.ts @@ -4,6 +4,7 @@ * If it is volatile, it is not persisted in memory and is handled differently. */ export interface IOperation { + id: string, path: string, op: 'add' | 'replace' | 'remove' | 'move' | 'copy' | 'test' | '_get', // ^ we will only actually have add|replace|remove diff --git a/packages/gnarly-core/src/stores/PouchDBStore.ts b/packages/gnarly-core/src/stores/PouchDBStore.ts index c23cd5b..62e4344 100644 --- a/packages/gnarly-core/src/stores/PouchDBStore.ts +++ b/packages/gnarly-core/src/stores/PouchDBStore.ts @@ -21,24 +21,24 @@ async function* batch ( batchSize = 1000, mapper: (v: any) => any = identity, ) { - let totalRows = 1 // should be 0 at first, but we want to trigger the first iteration let lastId - while (totalRows > 0) { + while (true) { const opts = { ...query, - startkey: lastId, - skip: 1, + startkey: lastId || undefined, + skip: lastId ? 1 : 0, limit: batchSize, include_docs: true, + inclusive_end: true, } const res = await db.allDocs(opts) - const gots = mapper(res.rows) - yield gots + if (res.rows.length === 0) { + break + } - totalRows = gots.total_rows - if (totalRows === 0) { break } + yield mapper(res.rows) lastId = res.rows[res.rows.length - 1].id } } @@ -177,7 +177,16 @@ export default class PouchDBStore implements IStore { // transaction CRUD public getAllTransactionsTo = async (reducerKey: string, toTxId: null | string): Promise => { + if (toTxId === null || toTxId === undefined) { + throw new Error(`Invalid txId: ${toTxId}`) + } + const db = await this.transactions.get(reducerKey) + try { + await db.get(toTxId) + } catch (error) { + throw new Error(`Invalid txId: ${toTxId} not found in reducer ${reducerKey}: ${error}`) + } return batch(db, { endkey: toTxId }, 1000, (rows) => rows @@ -195,7 +204,7 @@ export default class PouchDBStore implements IStore { } public getLatestTransaction = async (reducerKey: string): Promise => { - // in pouch, our ksuids aren't sorting tot he specificity we want + // in pouch, our ksuids aren't sorting to the specificity we want // so pull the last ~10 and then sort by blocknumber const db = await this.transactions.get(reducerKey) const res = await db.allDocs({ diff --git a/packages/gnarly-core/src/stores/SequelizeStore.ts b/packages/gnarly-core/src/stores/SequelizeStore.ts index b505cdb..854956a 100644 --- a/packages/gnarly-core/src/stores/SequelizeStore.ts +++ b/packages/gnarly-core/src/stores/SequelizeStore.ts @@ -20,8 +20,7 @@ export const makeSequelizeModels = ( }) const Transaction = sequelize.define('transaction', { - id: { type: DataTypes.STRING, primaryKey: true }, - mid: { type: DataTypes.INTEGER, autoIncrement: true }, + id: { type: DataTypes.STRING(27), primaryKey: true }, blockHash: { type: DataTypes.STRING }, blockNumber: { type: DataTypes.STRING }, }, { @@ -31,12 +30,11 @@ export const makeSequelizeModels = ( }) const Patch = sequelize.define('patch', { - id: { type: DataTypes.STRING, primaryKey: true }, - mid: { type: DataTypes.INTEGER, autoIncrement: true, primaryKey: true }, + id: { type: DataTypes.STRING(27), primaryKey: true }, }) const Operation = sequelize.define('operation', { - mid: { type: DataTypes.INTEGER, autoIncrement: true, primaryKey: true }, + id: { type: DataTypes.STRING(27), primaryKey: true }, path: { type: DataTypes.STRING }, op: { type: DataTypes.JSONB }, value: { type: DataTypes.JSONB }, @@ -258,7 +256,7 @@ export default class SequelizeStore implements IStore { public getLatestTransaction = async (reducerKey: string): Promise => { try { return (await this.Transaction.findOne({ - order: [['mid', 'DESC']], + order: [['id', 'DESC']], rejectOnEmpty: true, include: [{ model: this.Reducer, @@ -272,6 +270,10 @@ export default class SequelizeStore implements IStore { public getAllTransactionsTo = async function (reducerKey: string, toTxId: null | string): Promise { + if (toTxId === null || toTxId === undefined) { + throw new Error(`Invalid txId: ${toTxId}`) + } + let initial try { initial = await this.getPlainTransaction(reducerKey, toTxId) @@ -280,7 +282,7 @@ export default class SequelizeStore implements IStore { } const query = { - where: { mid: { [this.Sequelize.Op.lte]: initial.mid } }, + where: { id: { [this.Sequelize.Op.lte]: initial.id } }, include: [{ model: this.Patch, include: [{ @@ -292,9 +294,9 @@ export default class SequelizeStore implements IStore { where: { id: { [this.Sequelize.Op.eq]: reducerKey } }, }], order: [ - ['mid', 'ASC'], - [{ model: this.Patch }, 'mid', 'ASC'], - [{ model: this.Patch }, { model: this.Operation }, 'mid', 'ASC'], + ['id', 'ASC'], + [{ model: this.Patch }, 'id', 'ASC'], + [{ model: this.Patch }, { model: this.Operation }, 'id', 'ASC'], ], } @@ -356,8 +358,8 @@ export default class SequelizeStore implements IStore { where: { id: { [this.Sequelize.Op.eq]: reducerKey } }, }], order: [ - [{ model: this.Patch }, 'mid', 'ASC'], - [{ model: this.Patch }, { model: this.Operation }, 'mid', 'ASC'], + [{ model: this.Patch }, 'id', 'ASC'], + [{ model: this.Patch }, { model: this.Operation }, 'id', 'ASC'], ], rejectOnEmpty: true, })).get({ plain }) diff --git a/packages/gnarly-core/src/utils.ts b/packages/gnarly-core/src/utils.ts index 35a835b..7f97ea9 100644 --- a/packages/gnarly-core/src/utils.ts +++ b/packages/gnarly-core/src/utils.ts @@ -1,10 +1,12 @@ import { Operation } from '@xlnt/fast-json-patch' import BN = require('bn.js') -import KSUID = require('ksuid') +import { randomBytes } from 'crypto' +import base62 = require('ksuid/base62') import { flatMap } from 'lodash' import memoize from 'moize' import numberToBN = require('number-to-bn') import pMap = require('p-map') +import padStart = require('string.prototype.padstart') import web3Utils = require('web3-utils') import IABIItem, { IABIItemInput } from './models/ABIItem' @@ -16,8 +18,28 @@ import { const API_CACHE_MAX_AGE = 1000 -// shrugs: I feel like using the sync randomness here isn't really a big deal, but we'll see -export const uuid = () => KSUID.randomSync().string +// god, a blockchain would _actually_ solve this problem ಠ_ಠ +let terribleMonotonicallyIncreasingId = 0 + +// pouchdb requires more specificity than KSUID's millisecond resolution for keeping order of docs +// so we use this terrible monotonically increasing id to make sure that, in the case of a single +// gnalry instance (which will be the case for the foreseeable future), everything is dandy +// luckily, we don't need to keep this id in a database because if the process crashes, the +// universe will still move forward, meaning as long as we don't reboot within a few nanoseconds (lol) +// there will always be enough time to make sure that the next doc has a higher ksuid than the previous +const STRING_ENCODED_LENGTH = 27 +export const uuid = () => { + const timestamp = new Date().getTime() + terribleMonotonicallyIncreasingId++ + const timestampBuffer = Buffer.allocUnsafe(8) + timestampBuffer.writeDoubleBE(timestamp, 0) + + const buf = Buffer.concat([ + timestampBuffer, + Buffer.from(randomBytes(12)), + ]) + const encoded = base62.encode(buf, STRING_ENCODED_LENGTH) + return padStart(encoded, STRING_ENCODED_LENGTH, '0') +} export const cacheApiRequest = (fn) => memoize(fn, { isPromise: true, @@ -135,6 +157,7 @@ export const appendTo = ( // but that requires a round trip to the database (previously done in-memory) // and we don't have the need for that right now return { + id: uuid(), op: 'add', path: `/${domain}/${value.uuid}`, value, diff --git a/packages/gnarly-core/test/Ourbit.spec.ts b/packages/gnarly-core/test/Ourbit.spec.ts index ff03918..62b8b32 100644 --- a/packages/gnarly-core/test/Ourbit.spec.ts +++ b/packages/gnarly-core/test/Ourbit.spec.ts @@ -46,13 +46,14 @@ describe('Ourbit', () => { ]) tx = { - id: '0x1', + id: TEST_UUID, blockHash: '0x1', blockNumber: '0x0', patches: [{ id: TEST_UUID, reason: undefined, operations: [{ + id: TEST_UUID, op: 'add', path: '/key', value: 'value', @@ -100,6 +101,7 @@ describe('Ourbit', () => { id: TEST_UUID, reason: undefined, operations: [{ + id: TEST_UUID, op: 'replace', path: '/key', oldValue: 'value', @@ -126,6 +128,7 @@ describe('Ourbit', () => { id: TEST_UUID, reason: undefined, operations: [{ + id: TEST_UUID, op: 'add', path: `/domain/${TEST_UUID}`, value: { uuid: TEST_UUID, value: 'value' }, @@ -156,7 +159,7 @@ describe('Ourbit', () => { await ourbit.rollbackTransaction('0x2') targetState.should.deep.equal({ key: 'value' }) - await ourbit.rollbackTransaction(tx.id) + await ourbit.rollbackTransaction('0x1') targetState.should.deep.equal({}) }) @@ -167,7 +170,7 @@ describe('Ourbit', () => { // new state, same store const newOurbit = new Ourbit(TEST_KEY, newState, persistPatch, context) - await newOurbit.resumeFromTxId('0x1') + await newOurbit.resumeFromTxId(tx.id) newState.should.deep.equal({ key: 'value' }) }) }) diff --git a/packages/gnarly-core/test/factories/IOperationFactory.ts b/packages/gnarly-core/test/factories/IOperationFactory.ts new file mode 100644 index 0000000..31f92ef --- /dev/null +++ b/packages/gnarly-core/test/factories/IOperationFactory.ts @@ -0,0 +1,12 @@ +import { Factory } from 'rosie' +import { uuid } from '../../src/utils' + +export default new Factory() + .attrs({ + id: () => uuid(), + path: '', + op: '', + // value: undefined, + // oldValue: undefined, + volatile: false, + }) diff --git a/packages/gnarly-core/test/factories/IPatchFactory.ts b/packages/gnarly-core/test/factories/IPatchFactory.ts new file mode 100644 index 0000000..2819960 --- /dev/null +++ b/packages/gnarly-core/test/factories/IPatchFactory.ts @@ -0,0 +1,9 @@ +import { Factory } from 'rosie' +import { uuid } from '../../src/utils' + +export default new Factory() + .attrs({ + id: () => uuid(), + // reason: + operations: [], + }) diff --git a/packages/gnarly-core/test/factories/ITransactionFactory.ts b/packages/gnarly-core/test/factories/ITransactionFactory.ts new file mode 100644 index 0000000..3db0dfd --- /dev/null +++ b/packages/gnarly-core/test/factories/ITransactionFactory.ts @@ -0,0 +1,10 @@ +import { Factory } from 'rosie' +import { uuid } from '../../src/utils' + +export default new Factory() + .attrs({ + id: () => uuid(), + patches: [], + blockHash: '', + blockNumber: '', + }) diff --git a/packages/gnarly-core/test/mocks/MockStore.ts b/packages/gnarly-core/test/mocks/MockStore.ts index f2fdb34..a4f1642 100644 --- a/packages/gnarly-core/test/mocks/MockStore.ts +++ b/packages/gnarly-core/test/mocks/MockStore.ts @@ -15,9 +15,9 @@ async function* iter ( export default class MockStore implements IStore { - private reducers: any[] = [] - private transactions: ITransaction[] = [] - private historicalBlocks: { [_: string]: IJSONBlock[] } = {} + public reducers: any[] = [] + public transactions: ITransaction[] = [] + public historicalBlocks: { [_: string]: IJSONBlock[] } = {} public setup = async (reset: boolean = false) => { // nothing to be done @@ -88,6 +88,7 @@ export default class MockStore implements IStore { } public async getTransaction (reducerKey: string, txId: string): Promise { + console.log(txId) return find(this.transactions, (t) => t.id === txId) } diff --git a/packages/gnarly-core/test/stores/Store.behavior.ts b/packages/gnarly-core/test/stores/Store.behavior.ts index 7384f4f..0319278 100644 --- a/packages/gnarly-core/test/stores/Store.behavior.ts +++ b/packages/gnarly-core/test/stores/Store.behavior.ts @@ -2,15 +2,28 @@ import chai = require('chai') import { pickBy } from 'lodash' import 'mocha' -chai +const should = chai .use(require('chai-spies')) + .use(require('chai-as-promised')) .should() -import { forEach } from '../../src/utils' - -import { IStore } from '../../src/stores' +import { ITransaction } from '../../src/ourbit' +import { forEach, uuid } from '../../src/utils' +import IPatchFactory from '../factories/IPatchFactory' +import IOperationFactory from '../factories/IPatchFactory' +import ITransactionFactory from '../factories/ITransactionFactory' import { buildChain, genesis } from '../utils' +const flattenIterable = async (iter) => { + const memo = [] + for await (const batch of iter) { + for (const thing of batch) { + memo.push(thing) + } + } + return memo +} + const MOCK_REDUCER_KEY = 'test' const MOCK_RETENTION = 100 @@ -27,38 +40,59 @@ const blocksShouldEqual = (as, bs) => as.map(onlyKeys(historialBlockKeys)) bs.map(onlyKeys(historialBlockKeys)), ) -const shouldBehaveAsStore = (store: IStore) => { - const saveAllHistoricalBlocks = async (blocks) => forEach(blocks, (block) => - store.saveHistoricalBlock(MOCK_REDUCER_KEY, MOCK_RETENTION, block), - ) +const transactionKeys = ['id', 'patches', 'blockNumber', 'blockHash'] +const patchKeys = ['id', 'operations'] +const operationKeys = ['id', 'path', 'op', 'value', 'oldValue', 'volatile'] + +const transactionsWithValidKeys = (txs) => txs + .map(onlyKeys(transactionKeys)) + .map((tx) => ({ + ...tx, + patches: tx.patches + .map(onlyKeys(patchKeys)) + .map((patch) => ({ + ...patch, + operations: patch.operations.map(onlyKeys(operationKeys)), + })), + })) + +const transactionsShouldEqual = (as, bs) => transactionsWithValidKeys(as) + .should.deep.equal(transactionsWithValidKeys(bs)) + +const shouldBehaveAsStore = function () { + const saveAllHistoricalBlocks = async function (store, blocks) { + return forEach(blocks, (block) => + store.saveHistoricalBlock(MOCK_REDUCER_KEY, MOCK_RETENTION, block), + ) + } beforeEach(async function () { // implicitly tests setup and setdown - await store.setdown() - await store.setup() + await this.store.setdown() + await this.store.setup() }) context('reducers', function () { describe('saveReducer', function () { it('should save reducer information', async function () { - await store.saveReducer(MOCK_REDUCER_KEY) + await this.store.saveReducer(MOCK_REDUCER_KEY) }) }) describe('deleteReducer', function () { it('should delete reducer information', async function () { - await store.saveReducer(MOCK_REDUCER_KEY) - await store.deleteReducer(MOCK_REDUCER_KEY) + await this.store.saveReducer(MOCK_REDUCER_KEY) + await this.store.deleteReducer(MOCK_REDUCER_KEY) }) }) }) context('with reducer', function () { beforeEach(async function () { - await store.saveReducer(MOCK_REDUCER_KEY) + await this.store.saveReducer(MOCK_REDUCER_KEY) }) afterEach(async function () { - await store.deleteReducer(MOCK_REDUCER_KEY) + await this.store.deleteReducer(MOCK_REDUCER_KEY) }) context('historical blocks', function () { @@ -69,21 +103,21 @@ const shouldBehaveAsStore = (store: IStore) => { }) it('should return empty array if no historical blocks', async function () { - const blocks = await store.getHistoricalBlocks(MOCK_REDUCER_KEY) + const blocks = await this.store.getHistoricalBlocks(MOCK_REDUCER_KEY) blocks.length.should.equal(0) }) it('should save one historical block', async function () { - await store.saveHistoricalBlock(MOCK_REDUCER_KEY, MOCK_RETENTION, this.lastBlock) - const blocks = await store.getHistoricalBlocks(MOCK_REDUCER_KEY) + await this.store.saveHistoricalBlock(MOCK_REDUCER_KEY, MOCK_RETENTION, this.lastBlock) + const blocks = await this.store.getHistoricalBlocks(MOCK_REDUCER_KEY) blocks.length.should.equal(1) blocksShouldEqual(blocks, [this.lastBlock]) }) it('should save many historical blocks', async function () { - await saveAllHistoricalBlocks(this.historicalBlocks) + await saveAllHistoricalBlocks(this.store, this.historicalBlocks) - const blocks = await store.getHistoricalBlocks(MOCK_REDUCER_KEY) + const blocks = await this.store.getHistoricalBlocks(MOCK_REDUCER_KEY) blocks.length.should.equal(this.historicalBlocks.length) blocksShouldEqual(blocks, this.historicalBlocks) }) @@ -93,12 +127,12 @@ const shouldBehaveAsStore = (store: IStore) => { beforeEach(async function () { this.historicalBlocks = buildChain(genesis(), 8) this.lastBlock = this.historicalBlocks[this.historicalBlocks.length - 1] - await saveAllHistoricalBlocks(this.historicalBlocks) + await saveAllHistoricalBlocks(this.store, this.historicalBlocks) }) it('should delete a single historical block', async function () { - await store.deleteHistoricalBlock(MOCK_REDUCER_KEY, this.lastBlock.hash) - const blocks = await store.getHistoricalBlocks(MOCK_REDUCER_KEY) + await this.store.deleteHistoricalBlock(MOCK_REDUCER_KEY, this.lastBlock.hash) + const blocks = await this.store.getHistoricalBlocks(MOCK_REDUCER_KEY) blocksShouldEqual(blocks, this.historicalBlocks.slice(0, -1)) }) }) @@ -106,12 +140,12 @@ const shouldBehaveAsStore = (store: IStore) => { describe('deleteHistoricalBlocks', function () { beforeEach(async function () { this.historicalBlocks = buildChain(genesis(), 8) - await saveAllHistoricalBlocks(this.historicalBlocks) + await saveAllHistoricalBlocks(this.store, this.historicalBlocks) }) it('should delete all historical blocks', async function () { - await store.deleteHistoricalBlocks(MOCK_REDUCER_KEY) - const blocks = await store.getHistoricalBlocks(MOCK_REDUCER_KEY) + await this.store.deleteHistoricalBlocks(MOCK_REDUCER_KEY) + const blocks = await this.store.getHistoricalBlocks(MOCK_REDUCER_KEY) blocks.length.should.equal(0) }) }) @@ -123,8 +157,8 @@ const shouldBehaveAsStore = (store: IStore) => { }) it('should still have the same number of blocks', async function () { - await saveAllHistoricalBlocks(this.historicalBlocks) - const blocks = await store.getHistoricalBlocks(MOCK_REDUCER_KEY) + await saveAllHistoricalBlocks(this.store, this.historicalBlocks) + const blocks = await this.store.getHistoricalBlocks(MOCK_REDUCER_KEY) blocks.length.should.equal(this.historicalBlocks.length) }) }) @@ -135,8 +169,8 @@ const shouldBehaveAsStore = (store: IStore) => { }) it('should delete historical blocks beyond retention', async function () { - await saveAllHistoricalBlocks(this.historicalBlocks) - const blocks = await store.getHistoricalBlocks(MOCK_REDUCER_KEY) + await saveAllHistoricalBlocks(this.store, this.historicalBlocks) + const blocks = await this.store.getHistoricalBlocks(MOCK_REDUCER_KEY) blocks.length.should.equal(MOCK_RETENTION) blocksShouldEqual(blocks, this.historicalBlocks.slice(-1 * MOCK_RETENTION)) @@ -148,40 +182,112 @@ const shouldBehaveAsStore = (store: IStore) => { const base = buildChain(genesis(), 6) const fork1 = buildChain(base, 2) const fork2 = buildChain(base, MOCK_RETENTION) - await saveAllHistoricalBlocks(fork1) + await saveAllHistoricalBlocks(this.store, fork1) // should be fork1 - blocksShouldEqual(await store.getHistoricalBlocks(MOCK_REDUCER_KEY), fork1) + blocksShouldEqual(await this.store.getHistoricalBlocks(MOCK_REDUCER_KEY), fork1) // delete extra fork1 blocks - await forEach(fork1.slice(-2), (block) => store.deleteHistoricalBlock(MOCK_REDUCER_KEY, block.hash)) + await forEach(fork1.slice(-2), (block) => this.store.deleteHistoricalBlock(MOCK_REDUCER_KEY, block.hash)) // should be base - blocksShouldEqual(await store.getHistoricalBlocks(MOCK_REDUCER_KEY), base) + blocksShouldEqual(await this.store.getHistoricalBlocks(MOCK_REDUCER_KEY), base) // add fork2 blocks which goes above retention - await saveAllHistoricalBlocks(fork2.slice(-1 * MOCK_RETENTION)) + await saveAllHistoricalBlocks(this.store, fork2.slice(-1 * MOCK_RETENTION)) // should be last retention blocks of fork2 - blocksShouldEqual(await store.getHistoricalBlocks(MOCK_REDUCER_KEY), fork2.slice(-1 * MOCK_RETENTION)) + blocksShouldEqual(await this.store.getHistoricalBlocks(MOCK_REDUCER_KEY), fork2.slice(-1 * MOCK_RETENTION)) // nuke all of them - await store.deleteHistoricalBlocks(MOCK_REDUCER_KEY) + await this.store.deleteHistoricalBlocks(MOCK_REDUCER_KEY) // should be empty - blocksShouldEqual(await store.getHistoricalBlocks(MOCK_REDUCER_KEY), []) + blocksShouldEqual(await this.store.getHistoricalBlocks(MOCK_REDUCER_KEY), []) }) }) }) context('transactions', function () { describe('getAllTransactionsTo', function () { - it('should throw error when given unknown txId') - it('should return an AsyncIteratorable set of tx batches') - it('should return all transactions up to an existing txId (inclusive) ordered correctly') - it('should include patches ordered correctly') - it('should not include volatile operations') - it('should include operations ordered correctly') + it('should throw error when given undefined txId', async function () { + await this.store.getAllTransactionsTo(MOCK_REDUCER_KEY, undefined).should.be.rejectedWith(Error) + }) + + it('should throw error when given null txId', async function () { + await this.store.getAllTransactionsTo(MOCK_REDUCER_KEY, null).should.be.rejectedWith(Error) + }) + + it('should throw error when given unknown txId', async function () { + await this.store.getAllTransactionsTo(MOCK_REDUCER_KEY, 'fake').should.be.rejectedWith(Error) + }) + + context('with valid transactions', function () { + beforeEach(async function () { + this.mockTransactions = [ + ITransactionFactory.build({ + patches: [ + IPatchFactory.build({ + operations: [IOperationFactory.build({ + path: '/test', + op: 'add', + value: 'test', + oldValue: null, + volatile: false, + })], + }), + IPatchFactory.build({ + operations: [IOperationFactory.build({ + path: '/test-2', + op: 'add', + value: 'test', + oldValue: null, + volatile: false, + })], + }), + ], + blockNumber: '0x1', + blockHash: '0x1', + }), + ITransactionFactory.build({ + patches: [IPatchFactory.build({ + operations: [IOperationFactory.build({ + path: '/test', + op: 'update', + value: 'new', + oldValue: 'test', + volatile: false, + })], + })], + blockNumber: '0x2', + blockHash: '0x2', + }), + ] + + for (const tx of this.mockTransactions) { + await this.store.saveTransaction(MOCK_REDUCER_KEY, tx) + } + + this.lastTxId = this.mockTransactions[this.mockTransactions.length - 1].id + }) + + it('should return an AsyncIteratorable', async function () { + const iter = await this.store.getAllTransactionsTo(MOCK_REDUCER_KEY, this.lastTxId) + + should.exist(iter[(Symbol as any).asyncIterator]) + }) + + it('should return all transactions up to an existing txId (inclusive) ordered correctly', async function () { + const txs = await flattenIterable(await this.store.getAllTransactionsTo(MOCK_REDUCER_KEY, this.lastTxId)) + + should.exist(txs) + txs.length.should.equal(this.mockTransactions.length) + transactionsShouldEqual(txs, this.mockTransactions) + }) + + it('should not include volatile operations') + it('should include operations ordered correctly') + }) }) describe('getLatestTransaction', function () { diff --git a/packages/gnarly-core/test/stores/Stores.spec.ts b/packages/gnarly-core/test/stores/Stores.spec.ts index ab065e6..b749c13 100644 --- a/packages/gnarly-core/test/stores/Stores.spec.ts +++ b/packages/gnarly-core/test/stores/Stores.spec.ts @@ -4,45 +4,46 @@ import Sequelize = require('sequelize') import { PouchDBStore, SequelizeStore } from '../../src/stores' import { timeout } from '../../src/utils' -import Store from './Store.behavior' +import shouldBehaveAsStore from './Store.behavior' describe('All Stores', function () { - const pouchDBServerStore = new PouchDBStore('http://127.0.0.1:5985') - // const defaultPouchStore = new PouchDBStore('http://127.0.0.1:5984') - - // don't forget to `create database travis_ci_test;` on your local postgres! - const sequelize = new Sequelize('postgres://postgres@127.0.0.1:5432/travis_ci_test', { - logging: false, - }) - const sequelizeStore = new SequelizeStore(Sequelize, sequelize) describe('PouchDB Store (pouchdb-server)', function () { this.timeout(22000) + before(async function () { this.child = exec('pouchdb-server -p 5985 -m') this.child.on('error', (error) => { console.log(`child error:\n${error}`) }) await timeout(1000) + this.store = new PouchDBStore('http://127.0.0.1:5985') }) after(async function () { await this.child.kill() }) - Store(pouchDBServerStore) + shouldBehaveAsStore() }) // @TODO - couchdb is not api-compatible with pouchdb-server it seems - // describe('PouchDB Store (default)', function () { - // this.timeout(12000) - // // assumes pouchdb-server/CouchDB available on default port - // Store(defaultPouchStore) - // }) describe('Sequelize Store (Postgres)', function () { - this.timeout(2000) + + before(async function () { + // don't forget to `create database travis_ci_test;` on your local postgres! + const sequelize = new Sequelize('postgres://postgres@127.0.0.1:5432/travis_ci_test', { + logging: false, + }) + this.store = new SequelizeStore(Sequelize, sequelize) + }) + + after(async function () { + // set down + }) + // assumes postgres is running locally on default port - Store(sequelizeStore) + shouldBehaveAsStore() }) }) diff --git a/yarn.lock b/yarn.lock index 7345b81..9795d81 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1622,6 +1622,12 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" +chai-as-promised@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/chai-as-promised/-/chai-as-promised-7.1.1.tgz#08645d825deb8696ee61725dbf590c012eb00ca0" + dependencies: + check-error "^1.0.2" + chai-spies@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/chai-spies/-/chai-spies-1.0.0.tgz#d16b39336fb316d03abf8c375feb23c0c8bb163d" @@ -1677,7 +1683,7 @@ chardet@^0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" -check-error@^1.0.1: +check-error@^1.0.1, check-error@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" @@ -2188,6 +2194,10 @@ crypto-random-string@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" +crypto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/crypto/-/crypto-1.0.1.tgz#2af1b7cad8175d24c8a1b0778255794a21803037" + cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": version "0.3.4" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.4.tgz#8cd52e8a3acfd68d3aed38ee0a640177d2f9d797"