diff --git a/packages/mobile/package-lock.json b/packages/mobile/package-lock.json index 35bb1538fb..12b393bf64 100644 --- a/packages/mobile/package-lock.json +++ b/packages/mobile/package-lock.json @@ -3575,6 +3575,15 @@ "nanoid": "^3.1.23" } }, + "@gulp-sourcemaps/map-sources": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/map-sources/-/map-sources-1.0.0.tgz", + "integrity": "sha512-o/EatdaGt8+x2qpb0vFLC/2Gug/xYPRXb6a+ET1wGYKozKN3krDWC/zZFZAtrzxJHuDL12mwdfEFKcKMNvc55A==", + "requires": { + "normalize-path": "^2.0.1", + "through2": "^2.0.3" + } + }, "@hapi/hoek": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", @@ -7116,6 +7125,11 @@ } } }, + "acorn": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", + "integrity": "sha512-fu2ygVGuMmlzG8ZeRJ0bvR41nsAkxxhbyk8bZ1SS521Z7vmgJFTQQlfz/Mp/nJexGBz+v8sC9bM6+lNgskt4Ug==" + }, "acorn-globals": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.4.tgz", @@ -7784,6 +7798,17 @@ "@types/babel__traverse": "^7.0.6" } }, + "babel-plugin-macros": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz", + "integrity": "sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.12.5", + "cosmiconfig": "^7.0.0", + "resolve": "^1.19.0" + } + }, "babel-plugin-polyfill-corejs2": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.3.tgz", @@ -9180,6 +9205,11 @@ } } }, + "clone-stats": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", + "integrity": "sha512-dhUqc57gSMCo6TX85FLfe51eC/s+Im2MLkAgJwfaRRexR2tA4dd3eLEW4L6efzHc2iNorrRRXITifnDLlRrhaA==" + }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -9331,6 +9361,41 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, + "concat-stream": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.1.tgz", + "integrity": "sha512-eYF1Q4RxUUwq8ApyPD9ebWsYjVrJmTMLGzbGXv4qTZ5iP7FLm+oWN4x2XIzLEZ745xiwRM9DmIB0Ix1Nz8Epmg==", + "requires": { + "inherits": "~2.0.1", + "readable-stream": "~2.0.0", + "typedarray": "~0.0.5" + }, + "dependencies": { + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha512-yN0WQmuCX63LP/TMvAg31nvT6m4vDqJEiiv2CAZqWOGNWutc9DfDk1NPYYmKUFmaVM2UwDowH4u5AHWYP/jxKw==" + }, + "readable-stream": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "integrity": "sha512-TXcFfb63BQe1+ySzsHZI/5v1aJPCShfqvWJ64ayNImXMsN1Cd0YGk/wm8KB7/OeessgPc9QvS9Zou8QTkFzsLw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" + } + } + }, "connect": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", @@ -9608,6 +9673,24 @@ "resolved": "https://registry.npmjs.org/crypto-hash/-/crypto-hash-1.3.0.tgz", "integrity": "sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg==" }, + "css": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/css/-/css-2.2.4.tgz", + "integrity": "sha512-oUnjmWpy0niI3x/mPL8dVEI1l7MnG3+HHyRPHf+YFSbK+svOhXpmSOcDURUh2aOCgl2grzrOPt1nHLuCVFULLw==", + "requires": { + "inherits": "^2.0.3", + "source-map": "^0.6.1", + "source-map-resolve": "^0.5.2", + "urix": "^0.1.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, "css-color-keywords": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", @@ -9787,6 +9870,36 @@ "ms": "2.1.2" } }, + "debug-fabulous": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/debug-fabulous/-/debug-fabulous-0.0.4.tgz", + "integrity": "sha512-mmVKpY/O4UIl6ZDn5Owf8jEauO6uQiuF4Jz9iTuflSmvqNm6/64xARk/qCq5ZJxu141Ic2lCmL1TSMHIYoyiTw==", + "requires": { + "debug": "2.X", + "lazy-debug-legacy": "0.0.X", + "object-assign": "4.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "object-assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz", + "integrity": "sha512-Lbc7GfN7XFaK30bzUN3cDYLOkT0dH05S0ax1QikylHUD9+Z9PRF3G1iYwX3kcz+6AlzTFGkUgMxz6l3aUwbwTA==" + } + } + }, "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", @@ -9923,8 +10036,7 @@ "detect-newline": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", - "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", - "dev": true + "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=" }, "diff-sequences": { "version": "24.9.0", @@ -10041,6 +10153,17 @@ "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.5.tgz", "integrity": "sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA==" }, + "duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -11372,6 +11495,52 @@ } } }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha512-AFASGfIlnIbkKPQwX1yHaDjFvh/1gyKJODme52V6IORh69uEYgZp0o9C+qsIGNVEiuuhQU0CSSl++Rlegg1qvA==", + "requires": { + "fill-range": "^2.1.0" + }, + "dependencies": { + "fill-range": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "requires": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha512-QUzH43Gfb9+5yckcrSA0VBDwEtDUchrk4F6tfJZQuNzDJbEDB9cZNzSfXGQ1jqmdDY/kl41lUOWM9syA8z8jlg==", + "requires": { + "kind-of": "^3.0.2" + } + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==", + "requires": { + "isarray": "1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "expect": { "version": "24.9.0", "resolved": "https://registry.npmjs.org/expect/-/expect-24.9.0.tgz", @@ -12206,6 +12375,11 @@ "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha512-BTCqyBaWBTsauvnHiE8i562+EdJj+oUpkqWp2R1iCoR8f6oo8STRu3of7WJJ0TqWtxN50a5YFpzYK4Jj9esYfQ==" + }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", @@ -12347,6 +12521,11 @@ } } }, + "first-chunk-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz", + "integrity": "sha512-ArRi5axuv66gEsyl3UuK80CzW7t56hem73YGNYxNWTGNKFJUadSb9Gu9SHijYEUi8ulQMf1bJomYNwSCPHhtTQ==" + }, "fix-hmr": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/fix-hmr/-/fix-hmr-1.0.2.tgz", @@ -12725,6 +12904,38 @@ "path-is-absolute": "^1.0.0" } }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha512-ab1S1g1EbO7YzauaJLkgLp7DZVAqj9M/dvKlTt8DkXA2tiOIcSMrlVI2J1RZyB5iJVccEscjGn+kpOG9788MHA==", + "requires": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + }, + "dependencies": { + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha512-JDYOvfxio/t42HKdxkAYaCiBN7oYiuxykOxKxdaUW5Qn0zaYN3gRQWolrwdnf0shM9/EP0ebuuTmyoXNr1cC5w==", + "requires": { + "is-glob": "^2.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha512-7Q+VbVafe6x2T+Tu6NcOf6sRklazEPmBoB3IWk3WdGZM2iGUwU/Oe3Wtq5lSEkDTTlpp8yx+5t4pzO/i9Ty1ww==" + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha512-a1dBeB19NXsf/E0+FHqkagizel/LQw2DjSQpvQrj3zT+jYPpaUCryPnrQajXKFLCMuf4I6FhRpaGtw4lPrG6Eg==", + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, "glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -12733,6 +12944,171 @@ "is-glob": "^4.0.1" } }, + "glob-stream": { + "version": "5.3.5", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-5.3.5.tgz", + "integrity": "sha512-piN8XVAO2sNxwVLokL4PswgJvK/uQ6+awwXUVRTGF+rRfgCZpn4hOqxiRuTEbU/k3qgKl0DACYQ/0Sge54UMQg==", + "requires": { + "extend": "^3.0.0", + "glob": "^5.0.3", + "glob-parent": "^3.0.0", + "micromatch": "^2.3.7", + "ordered-read-streams": "^0.3.0", + "through2": "^0.6.0", + "to-absolute-glob": "^0.1.1", + "unique-stream": "^2.0.2" + }, + "dependencies": { + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha512-dtXTVMkh6VkEEA7OhXnN1Ecb8aAGFdZ1LFxtOCoqj4qkyOJMt7+qs6Ahdy6p/NQCPYsRSXXivhSB/J5E9jmYKA==", + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha512-G2n5bG5fSUCpnsXz4+8FUkYsGPkNfLn9YvS66U5qbTIXI2Ynnlo4Bi42bWv+omKUCqz+ejzfClwne0alJWJPhg==" + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha512-xU7bpz2ytJl1bH9cgIurjpg/n8Gohy9GTw81heDYLJQ4RU60dlyJsa+atVF2pI0yMMvKxI9HkKwjePCj5XI1hw==", + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha512-hxx03P2dJxss6ceIeri9cmYOT4SRs3Zk3afZwWpOsRqLqprhTR8u++SlC+sFGsQr7WGFPdMF7Gjc1njDLDK6UA==", + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha512-1FOj1LOwn42TMrruOHGt18HemVnbwAmAak7krWk+wa93KXxGbK+2jpezm+ytJYDaBX0/SPLZFHKM7m+tKobWGg==", + "requires": { + "is-extglob": "^1.0.0" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha512-7Q+VbVafe6x2T+Tu6NcOf6sRklazEPmBoB3IWk3WdGZM2iGUwU/Oe3Wtq5lSEkDTTlpp8yx+5t4pzO/i9Ty1ww==" + } + } + }, + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha512-c9IPMazfRITpmAAKi22dK1VKxGDX9ehhqfABDriL/lzO92xcUKEJPQHrVA/2YHSNFB4iFlykVmWvwo48nr3OxA==", + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + } + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==", + "requires": { + "is-extglob": "^2.1.0" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "requires": { + "is-buffer": "^1.1.5" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha512-LnU2XFEk9xxSJ6rfgAry/ty5qwUTyHYOBU0g4R6tIw5ljwgGIBmiKhRWLw5NpMOnrgUNcDJ4WMp8rl3sYVHLNA==", + "requires": { + "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" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha512-7Q+VbVafe6x2T+Tu6NcOf6sRklazEPmBoB3IWk3WdGZM2iGUwU/Oe3Wtq5lSEkDTTlpp8yx+5t4pzO/i9Ty1ww==" + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha512-a1dBeB19NXsf/E0+FHqkagizel/LQw2DjSQpvQrj3zT+jYPpaUCryPnrQajXKFLCMuf4I6FhRpaGtw4lPrG6Eg==", + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" + }, + "through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha512-RkK/CCESdTKQZHdmKICijdKKsCRVHs5KsLZ6pACAmF/1GPUQhonHSXWNERctxEp7RmvjdNbZTL5z9V7nSCXKcg==", + "requires": { + "readable-stream": ">=1.0.33-1 <1.1.0-0", + "xtend": ">=4.0.0 <4.1.0-0" + } + } + } + }, "global": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/global/-/global-4.4.0.tgz", @@ -12796,6 +13172,39 @@ "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", "dev": true }, + "gulp-sourcemaps": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-1.12.1.tgz", + "integrity": "sha512-2NYnMpB67LJhc36sEv+hNY05UOy1lD9DPtLi+en4hbGH+085G9Zzh3cet2VEqrDlQrLk9Eho0MM9dZ3Z+dL0XA==", + "requires": { + "@gulp-sourcemaps/map-sources": "1.X", + "acorn": "4.X", + "convert-source-map": "1.X", + "css": "2.X", + "debug-fabulous": "0.0.X", + "detect-newline": "2.X", + "graceful-fs": "4.X", + "source-map": "~0.6.0", + "strip-bom": "2.X", + "through2": "2.X", + "vinyl": "1.X" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", + "requires": { + "is-utf8": "^0.2.0" + } + } + } + }, "hamt-sharding": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/hamt-sharding/-/hamt-sharding-2.0.1.tgz", @@ -13007,8 +13416,7 @@ "hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" }, "html-encoding-sniffer": { "version": "1.0.2", @@ -13208,6 +13616,11 @@ "loose-envify": "^1.0.0" } }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ==" + }, "ios-deploy": { "version": "1.11.4", "resolved": "https://registry.npmjs.org/ios-deploy/-/ios-deploy-1.11.4.tgz", @@ -13384,6 +13797,19 @@ "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", "dev": true }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha512-9YclgOGtN/f8zx0Pr4FQYMdibBiTaH3sn52vjYip4ZSf6C4/6RfTEZ+MR4GvKhCxdPh21Bg42/WL55f6KSnKpg==" + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha512-0EygVC5qPvIyb+gSz7zdD5/AAoS6Qrx1e//6N4yv4oNm30kqvdmG66oZFWVlQHUWe5OjP08FuTw2IdT0EOTcYA==", + "requires": { + "is-primitive": "^2.0.0" + } + }, "is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", @@ -13480,6 +13906,16 @@ "isobject": "^3.0.1" } }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha512-Yu68oeXJ7LeWNmZ3Zov/xg/oDBnBK2RNxwYY1ilNJX+tKKZqgPK+qOn/Gs9jEu66KDY9Netf5XLKNGzas/vPfQ==" + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha512-N3w1tFaRfk3UrPfqeRyD+GYDASU3W5VinKhlORy8EWVf/sIdDL9GAcew85XmktCfH+ngG7SRXEVDoO18WMdB/Q==" + }, "is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -13632,6 +14068,16 @@ "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==" + }, + "is-valid-glob": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-0.3.0.tgz", + "integrity": "sha512-CvG8EtJZ8FyzVOGPzrDorzyN65W1Ld8BVnqshRCah6pFIsprGx3dKgFtjLn/Vw9kGqR4OlR84U7yhT9ZVTyWIQ==" + }, "is-weakref": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", @@ -14887,8 +15333,7 @@ "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" }, "json-stringify-safe": { "version": "5.0.1", @@ -15030,6 +15475,27 @@ "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=" }, + "lazy-debug-legacy": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/lazy-debug-legacy/-/lazy-debug-legacy-0.0.1.tgz", + "integrity": "sha512-GFWaIBcBjxWWKI5OghwYEsPOR8JFh2xEcc3ZFV0ONYL0oHz0PHINJCfxJyztUq2XzcHncyO7fsRR550Gtfnk6g==" + }, + "lazystream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", + "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", + "requires": { + "readable-stream": "^2.0.5" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw==", + "requires": { + "invert-kv": "^1.0.0" + } + }, "left-pad": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", @@ -15128,17 +15594,47 @@ "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" }, + "lodash._reinterpolate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA==" + }, + "lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw==" + }, + "lodash.assigninwith": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assigninwith/-/lodash.assigninwith-4.2.0.tgz", + "integrity": "sha512-oYOjtZzQnecm7PJcxrDbL20OHv3tTtOQdRBSnlor6s0MO6VOFTOC+JyBIJUNUEzsBi1I0oslWtFAAG6QQbFIWQ==" + }, "lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=" }, + "lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" + }, + "lodash.keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-4.2.0.tgz", + "integrity": "sha512-J79MkJcp7Df5mizHiVNpjoHXLi4HLjh9VLS/M7lQSGoQ+0oQ+lWEigREkqKyizPB1IawvQLLKY8mzEcm1tkyxQ==" + }, "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, + "lodash.rest": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/lodash.rest/-/lodash.rest-4.0.5.tgz", + "integrity": "sha512-hsypEpebNAt0hj1aX9isQqi2CIZoNS1lP6PSWhB3hcMnBivobYzPZRPYq4cr38+RtvrlxQTgaW+sIuHAhBoHrA==" + }, "lodash.samplesize": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.samplesize/-/lodash.samplesize-4.2.0.tgz", @@ -15150,11 +15646,37 @@ "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", "dev": true }, + "lodash.template": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.2.4.tgz", + "integrity": "sha512-PmEQ9TtYbeYg6lNwJpSjkp4J4KttYLuKF1C6jeFBidyzbOFu0KvVnLicZBf0sGfScARwgOBqxnV/rWuaqRwang==", + "requires": { + "lodash._reinterpolate": "~3.0.0", + "lodash.assigninwith": "^4.0.0", + "lodash.keys": "^4.0.0", + "lodash.rest": "^4.0.0", + "lodash.templatesettings": "^4.0.0", + "lodash.tostring": "^4.0.0" + } + }, + "lodash.templatesettings": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz", + "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==", + "requires": { + "lodash._reinterpolate": "^3.0.0" + } + }, "lodash.throttle": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", "integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==" }, + "lodash.tostring": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/lodash.tostring/-/lodash.tostring-4.1.4.tgz", + "integrity": "sha512-xWHJ0LY7cSz/C/4ghNNiYA1Ong0VLdzAzrjDHvOzN+eJHzDEHme2+k+w/9Pk8dtdwcASMUbxN1/mtj6mFI25Ng==" + }, "lodash.unescape": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz", @@ -15374,6 +15896,11 @@ "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" }, + "map-stream": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.6.tgz", + "integrity": "sha512-RG9wAgznUY0foT30MMfnXh4jS0ObmOuxoGKe/ppYvM55RfquNdIvEEf6e+euczNVVzJIVbkgxg7GJBpYDhQ/Zg==" + }, "map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", @@ -15401,6 +15928,11 @@ } } }, + "math-random": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", + "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==" + }, "md5-file": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/md5-file/-/md5-file-3.2.3.tgz", @@ -16872,12 +17404,211 @@ "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.14.0.tgz", "integrity": "sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw==" }, - "moment": { - "version": "2.24.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", - "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" - }, - "ms": { + "module": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/module/-/module-1.2.5.tgz", + "integrity": "sha512-Y+j9HcHf8V6YtNBkLbPmREAUi5xGbAdb9ycXpo2roABDPrJEzd79kmoH5Ib9lpxcNVsHWa1LhRZJcflUq2+N3w==", + "requires": { + "chalk": "1.1.3", + "concat-stream": "1.5.1", + "lodash.template": "4.2.4", + "map-stream": "0.0.6", + "tildify": "1.2.0", + "vinyl-fs": "2.4.3", + "yargs": "4.6.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==" + }, + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha512-DLIsRzJVBQu72meAKPkWQOLcujdXT32hwdfnkI1frSiSRMK1MofjKHf+MEx0SB6fjEFXL8fBDv1dKymBlOp4Qw==" + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==", + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==", + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==" + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==", + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==", + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==" + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", + "requires": { + "is-utf8": "^0.2.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==" + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, + "y18n": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==" + }, + "yargs": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.6.0.tgz", + "integrity": "sha512-KmjJbWBkYiSRUChcOSa4rtBxDXf0j4ISz+tpeNa4LKIBllgKnkemJ3x4yo4Yydp3wPU4/xJTaKTLLZ8V7zhI7A==", + "requires": { + "camelcase": "^2.0.1", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "lodash.assign": "^4.0.3", + "os-locale": "^1.4.0", + "pkg-conf": "^1.1.2", + "read-pkg-up": "^1.0.1", + "require-main-filename": "^1.0.1", + "string-width": "^1.0.1", + "window-size": "^0.2.0", + "y18n": "^3.2.1", + "yargs-parser": "^2.4.0" + } + }, + "yargs-parser": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", + "integrity": "sha512-9pIKIJhnI5tonzG6OnCFlz/yln8xHYcGl+pn3xR0Vzff0vzN1PbNRaelgfgRUwZ3s4i3jvxT9WhmUGL4whnasA==", + "requires": { + "camelcase": "^3.0.0", + "lodash.assign": "^4.0.6" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==" + } + } + } + } + }, + "moment": { + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", + "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" + }, + "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" @@ -17257,7 +17988,6 @@ "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, "requires": { "hosted-git-info": "^2.1.4", "resolve": "^1.10.0", @@ -17268,8 +17998,7 @@ "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" } } }, @@ -17473,6 +18202,15 @@ } } }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha512-UiAM5mhmIuKLsOvrL+B0U2d1hXHF3bFYWIuH1LMpuV2EJEHG1Ntz06PgLEHjm6VFd87NpH8rastvPoyv6UW2fA==", + "requires": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + } + }, "object.pick": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", @@ -17578,11 +18316,33 @@ "wcwidth": "^1.0.1" } }, + "ordered-read-streams": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-0.3.0.tgz", + "integrity": "sha512-xQvd8qvx9U1iYY9aVqPpoF5V9uaWJKV6ZGljkh/jkiNX0DiQsjbWvRumbh10QTMDE8DheaOEU8xi0szbrgjzcw==", + "requires": { + "is-stream": "^1.0.1", + "readable-stream": "^2.0.1" + } + }, "os-browserify": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", "integrity": "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==" }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==" + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g==", + "requires": { + "lcid": "^1.0.0" + } + }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -17667,6 +18427,32 @@ "safe-buffer": "^5.1.1" } }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha512-FC5TeK0AwXzq3tUBFtH74naWkPQCEWs4K+xMxWZBlKDWu0bVHXGZa+KKqxKidd7xwhdZ19ZNuF2uO1M/r196HA==", + "requires": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha512-7Q+VbVafe6x2T+Tu6NcOf6sRklazEPmBoB3IWk3WdGZM2iGUwU/Oe3Wtq5lSEkDTTlpp8yx+5t4pzO/i9Ty1ww==" + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha512-a1dBeB19NXsf/E0+FHqkagizel/LQw2DjSQpvQrj3zT+jYPpaUCryPnrQajXKFLCMuf4I6FhRpaGtw4lPrG6Eg==", + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, "parse-headers": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.5.tgz", @@ -17801,6 +18587,19 @@ "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==" + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", + "requires": { + "pinkie": "^2.0.0" + } + }, "pirates": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", @@ -17809,6 +18608,69 @@ "node-modules-regexp": "^1.0.0" } }, + "pkg-conf": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-1.1.3.tgz", + "integrity": "sha512-9hHgE5+Xai/ChrnahNP8Ke0VNF/s41IZIB/d24eMHEaRamdPg+wwlRm2lTb5wMvE8eTIKrYZsrxfuOwt3dpsIQ==", + "requires": { + "find-up": "^1.0.0", + "load-json-file": "^1.1.0", + "object-assign": "^4.0.1", + "symbol": "^0.2.1" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==", + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==" + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", + "requires": { + "is-utf8": "^0.2.0" + } + } + } + }, "pkg-dir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", @@ -17900,6 +18762,11 @@ "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", "integrity": "sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==" }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha512-s/46sYeylUfHNjI+sA/78FAHlmIuKqI9wNnzEOGehAlUUYeObv5C2mOinXBjyUyWmJ2SfcS2/ydApH4hTF4WXQ==" + }, "pretty-format": { "version": "24.9.0", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz", @@ -18170,6 +19037,23 @@ } } }, + "randomatic": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", + "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", + "requires": { + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" + } + } + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -19320,6 +20204,14 @@ "@babel/runtime": "^7.8.4" } }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -19393,6 +20285,11 @@ "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" }, + "replace-ext": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", + "integrity": "sha512-AFBWBy9EVRTa/LhEcG8QDP3FvpwZqmvN2QFDuJswFeaVhWnZMp8q3E6Zd90SR04PlIwfGdyVjNyLPyen/ek5CQ==" + }, "request": { "version": "2.88.2", "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", @@ -20217,7 +21114,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" @@ -20226,14 +21122,12 @@ "spdx-exceptions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" }, "spdx-expression-parse": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, "requires": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" @@ -20242,8 +21136,7 @@ "spdx-license-ids": { "version": "3.0.11", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", - "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==", - "dev": true + "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==" }, "split-on-first": { "version": "1.1.0", @@ -20430,6 +21323,11 @@ "xtend": "^4.0.0" } }, + "stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==" + }, "strict-uri-encode": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", @@ -20535,6 +21433,25 @@ "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true }, + "strip-bom-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-stream/-/strip-bom-stream-1.0.0.tgz", + "integrity": "sha512-7jfJB9YpI2Z0aH3wu10ZqitvYJaE0s5IzFuWE+0pbb4Q/armTloEUShymkDO47YSLnjAW52mlXT//hs9wXNNJQ==", + "requires": { + "first-chunk-stream": "^1.0.0", + "strip-bom": "^2.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", + "requires": { + "is-utf8": "^0.2.0" + } + } + } + }, "strip-eof": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", @@ -20762,6 +21679,11 @@ } } }, + "symbol": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/symbol/-/symbol-0.2.3.tgz", + "integrity": "sha512-IUW+ek7apEaW5bFhS6WpYoNtVpNTlNoqB/PH7YiMWQTxSPeXCzG4PILVakwXivJt3ZXWeO1fIJnUd/L9A/VeGA==" + }, "symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", @@ -20853,6 +21775,23 @@ "xtend": "~4.0.1" } }, + "through2-filter": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-2.0.0.tgz", + "integrity": "sha512-miwWajb1B80NvIVKXFPN/o7+vJc4jYUvnZCwvhicRAoTxdD9wbcjri70j+BenCrN/JXEPKDjhpw4iY7yiNsCGg==", + "requires": { + "through2": "~2.0.0", + "xtend": "~4.0.0" + } + }, + "tildify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tildify/-/tildify-1.2.0.tgz", + "integrity": "sha512-Y9q1GaV/BO65Z9Yf4NOGMuwt3SGdptkZBnaaKfTQakrDyCLiuO1Kc5wxW4xLdsjzunRtqtOdhekiUFmZbklwYQ==", + "requires": { + "os-homedir": "^1.0.0" + } + }, "timed-out": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", @@ -20912,6 +21851,24 @@ "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==" }, + "to-absolute-glob": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz", + "integrity": "sha512-Vvl5x6zNf9iVG1QTWeknmWrKzZxaeKfIDRibrZCR3b2V/2NlFJuD2HV7P7AVjaKLZNqLPHqyr0jGrW0fTcxCPQ==", + "requires": { + "extend-shallow": "^2.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, "to-arraybuffer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", @@ -21069,6 +22026,46 @@ "mime-types": "~2.1.24" } }, + "typed-redux-saga": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/typed-redux-saga/-/typed-redux-saga-1.3.1.tgz", + "integrity": "sha512-nUj1/1/SAesEsZrr7o24ID+++CqZ6QfPVDcwhY2rVmm4vEBr/vbDHJ6j/w6SomOcooLwnh3sdaWVhNEIy7VgNA==", + "requires": { + "@babel/helper-module-imports": "^7.12.1", + "babel-plugin-macros": "^2.8.0" + }, + "dependencies": { + "babel-plugin-macros": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-2.8.0.tgz", + "integrity": "sha512-SEP5kJpfGYqYKpBrj5XU3ahw5p5GOHJ0U5ssOSQ/WBVdwkD2Dzlce95exQTs3jOVWPPKLBN2rlEWkCK7dSmLvg==", + "optional": true, + "requires": { + "@babel/runtime": "^7.7.2", + "cosmiconfig": "^6.0.0", + "resolve": "^1.12.0" + } + }, + "cosmiconfig": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", + "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", + "optional": true, + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.7.2" + } + } + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" + }, "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -21209,6 +22206,26 @@ "set-value": "^2.0.1" } }, + "unique-stream": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", + "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", + "requires": { + "json-stable-stringify-without-jsonify": "^1.0.1", + "through2-filter": "^3.0.0" + }, + "dependencies": { + "through2-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", + "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", + "requires": { + "through2": "~2.0.0", + "xtend": "~4.0.0" + } + } + } + }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -21397,11 +22414,15 @@ "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", "dev": true }, + "vali-date": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz", + "integrity": "sha512-sgECfZthyaCKW10N0fm27cg8HYTFK5qMWgypqkXMQ4Wbl/zZKx7xZICgcoxIIE+WFAP/MBL2EFwC/YvLxw3Zeg==" + }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, "requires": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" @@ -21434,6 +22455,58 @@ } } }, + "vinyl": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", + "integrity": "sha512-Ci3wnR2uuSAWFMSglZuB8Z2apBdtOyz8CV7dC6/U1XbltXBC+IuutUkXQISz01P+US2ouBuesSbV6zILZ6BuzQ==", + "requires": { + "clone": "^1.0.0", + "clone-stats": "^0.0.1", + "replace-ext": "0.0.1" + } + }, + "vinyl-fs": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-2.4.3.tgz", + "integrity": "sha512-XxYoy5HpHrVd76tpnI5Vv/+b/xlEVusOmn4LjQ01s2JyiDMNaUm3Rb7Y3xTkRw+YoRBVoUrCs7EAIFNXyIlI8Q==", + "requires": { + "duplexify": "^3.2.0", + "glob-stream": "^5.3.2", + "graceful-fs": "^4.0.0", + "gulp-sourcemaps": "^1.5.2", + "is-valid-glob": "^0.3.0", + "lazystream": "^1.0.0", + "lodash.isequal": "^4.0.0", + "merge-stream": "^1.0.0", + "mkdirp": "^0.5.0", + "object-assign": "^4.0.0", + "readable-stream": "^2.0.4", + "strip-bom": "^2.0.0", + "strip-bom-stream": "^1.0.0", + "through2": "^2.0.0", + "through2-filter": "^2.0.0", + "vali-date": "^1.0.0", + "vinyl": "^1.0.0" + }, + "dependencies": { + "merge-stream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", + "integrity": "sha512-e6RM36aegd4f+r8BZCcYXlO2P3H6xbUM6ktL2Xmf45GAOit9bI4z6/3VU7JwllVO1L7u0UDSg/EhzQ5lmMLolA==", + "requires": { + "readable-stream": "^2.0.1" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", + "requires": { + "is-utf8": "^0.2.0" + } + } + } + }, "vlq": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/vlq/-/vlq-1.0.1.tgz", @@ -22320,6 +23393,11 @@ "bs58check": "<3.0.0" } }, + "window-size": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", + "integrity": "sha512-UD7d8HFA2+PZsbKyaOCEy8gMh1oDtHgJh1LfgjQ4zVXmYjAT/kvz3PueITKuqDiIXQe7yzpPnxX3lNc+AhQMyw==" + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", diff --git a/packages/mobile/package.json b/packages/mobile/package.json index 6dd8732c49..52a01fea54 100644 --- a/packages/mobile/package.json +++ b/packages/mobile/package.json @@ -71,6 +71,7 @@ "lodash.samplesize": "4.2.0", "lottie-ios": "3.2.3", "lottie-react-native": "4.1.3", + "module": "1.2.5", "moment": "2.24.0", "node-libs-react-native": "1.2.1", "numeral": "2.0.6", @@ -119,7 +120,8 @@ "rn-fetch-blob": "0.12.0", "semver": "7.3.7", "tls-browserify": "0.2.2", - "type-fest": "2.16.0" + "type-fest": "2.16.0", + "typed-redux-saga": "1.3.1" }, "optionalDependencies": { "ios-deploy": "1.11.4" @@ -144,6 +146,7 @@ "@types/react-redux": "7.1.18", "@types/react-test-renderer": "16.9.0", "babel-jest": "24.9.0", + "babel-plugin-macros": "3.1.0", "eslint": "8.19.0", "eslint-config-audius": "1.2.2", "jest": "24.9.0", diff --git a/packages/mobile/src/App.tsx b/packages/mobile/src/App.tsx index 548f6aae90..92c00c7bef 100644 --- a/packages/mobile/src/App.tsx +++ b/packages/mobile/src/App.tsx @@ -20,7 +20,7 @@ import useConnectivity from 'app/components/web/useConnectivity' import { incrementSessionCount } from 'app/hooks/useSessionCount' import PushNotifications from 'app/notifications' import { RootScreen } from 'app/screens/root-screen' -import createStore from 'app/store' +import { store } from 'app/store' import { setup as setupAnalytics } from 'app/utils/analytics' import { Drawers } from './Drawers' @@ -31,9 +31,6 @@ Sentry.init({ dsn: Config.SENTRY_DSN }) -const store = createStore() -export const dispatch = store.dispatch - const Airplay = Platform.select({ ios: () => require('./components/audio/Airplay').default, android: () => () => null diff --git a/packages/mobile/src/message/handlers/download.ts b/packages/mobile/src/message/handlers/download.ts index b4d9f7ecfa..ca92f7c315 100644 --- a/packages/mobile/src/message/handlers/download.ts +++ b/packages/mobile/src/message/handlers/download.ts @@ -7,9 +7,9 @@ import type { } from 'rn-fetch-blob' import RNFetchBlob from 'rn-fetch-blob' -import { dispatch } from 'app/App' import type { MessageHandlers } from 'app/message/types' import { MessageType } from 'app/message/types' +import { dispatch } from 'app/store' import { setDownloadedPercentage, setFileInfo, diff --git a/packages/mobile/src/notifications.ts b/packages/mobile/src/notifications.ts index f929bc5054..7239f67534 100644 --- a/packages/mobile/src/notifications.ts +++ b/packages/mobile/src/notifications.ts @@ -7,7 +7,7 @@ import Config from 'react-native-config' // https://dev.to/edmondso006/react-native-local-ios-and-android-notifications-2c58 import PushNotification from 'react-native-push-notification' -import { dispatch } from 'app/App' +import { dispatch } from 'app/store' import { open } from 'app/store/notifications/actions' import type { MessagePostingWebView } from 'app/types/MessagePostingWebView' import { EventNames } from 'app/types/analytics' diff --git a/packages/mobile/src/services/audius-backend-instance.ts b/packages/mobile/src/services/audius-backend-instance.ts index 5b242e62df..a8c1f32488 100644 --- a/packages/mobile/src/services/audius-backend-instance.ts +++ b/packages/mobile/src/services/audius-backend-instance.ts @@ -10,6 +10,13 @@ import { monitoringCallbacks } from './monitoringCallbacks' import { getFeatureEnabled } from './remote-config' import { remoteConfigInstance } from './remote-config/remote-config-instance' +// TODO: declare this at the root and use actual audiusLibs type +declare global { + interface Window { + audiusLibs: any + } +} + let audiusLibs: AudiusLibs /** diff --git a/packages/mobile/src/store/index.ts b/packages/mobile/src/store/index.ts index 0828a84cb0..16c8633210 100644 --- a/packages/mobile/src/store/index.ts +++ b/packages/mobile/src/store/index.ts @@ -1,69 +1 @@ -import type { CommonState } from 'audius-client/src/common/store' -import type { RemoteConfigState } from 'audius-client/src/common/store/remote-config/slice' -import remoteConfig from 'audius-client/src/common/store/remote-config/slice' -import { createStore, combineReducers, applyMiddleware } from 'redux' -import { composeWithDevTools } from 'redux-devtools-extension' -import createSagaMiddleware from 'redux-saga' - -import type { AudioState } from './audio/reducer' -import audio from './audio/reducer' -import { reducer as common } from './common/reducer' -import type { DownloadState } from './download/slice' -import downloads from './download/slice' -import type { DrawersState } from './drawers/slice' -import drawers from './drawers/slice' -import type { KeyboardState } from './keyboard/slice' -import keyboard from './keyboard/slice' -import type { LifecycleState } from './lifecycle/reducer' -import lifecycle from './lifecycle/reducer' -import type { NotificationsState } from './notifications/reducer' -import notifications from './notifications/reducer' -import type { OAuthState } from './oauth/reducer' -import oauth from './oauth/reducer' -import rootSaga from './sagas' -import type { SearchState } from './search/reducer' -import search from './search/reducer' -import type { SignonState } from './signon/reducer' -import signon from './signon/reducer' -import type { WebState } from './web/reducer' -import web from './web/reducer' - -export type AppState = { - audio: AudioState - common: CommonState - drawers: DrawersState - downloads: DownloadState - keyboard: KeyboardState - lifecycle: LifecycleState - notifications: NotificationsState - oauth: OAuthState - remoteConfig: RemoteConfigState - search: SearchState - signon: SignonState - web: WebState -} - -const createRootReducer = () => - combineReducers({ - audio, - common, - drawers, - downloads, - keyboard, - lifecycle, - notifications, - oauth, - remoteConfig, - search, - signon, - web - }) - -export default () => { - const sagaMiddleware = createSagaMiddleware() - const middlewares = applyMiddleware(sagaMiddleware) - const composeEnhancers = composeWithDevTools({ trace: true, traceLimit: 25 }) - const store = createStore(createRootReducer(), composeEnhancers(middlewares)) - sagaMiddleware.run(rootSaga) - return store -} +export * from './store' diff --git a/packages/mobile/src/store/sagas.ts b/packages/mobile/src/store/sagas.ts index 336f5ac886..e44e700bf1 100644 --- a/packages/mobile/src/store/sagas.ts +++ b/packages/mobile/src/store/sagas.ts @@ -1,5 +1,5 @@ import remoteConfig from 'audius-client/src/common/store/remote-config/sagas' -import { all, fork } from 'redux-saga/effects' +import { all, fork } from 'typed-redux-saga/macro' import { remoteConfigInstance } from 'app/services/remote-config/remote-config-instance' @@ -12,5 +12,5 @@ export default function* rootSaga() { ...remoteConfig(remoteConfigInstance), ...oauthSagas() ] - yield all(sagas.map(fork)) + yield* all(sagas.map(fork)) } diff --git a/packages/mobile/src/store/store.ts b/packages/mobile/src/store/store.ts new file mode 100644 index 0000000000..20ef7c50cd --- /dev/null +++ b/packages/mobile/src/store/store.ts @@ -0,0 +1,72 @@ +import type { CommonState } from 'audius-client/src/common/store' +import type { RemoteConfigState } from 'audius-client/src/common/store/remote-config/slice' +import remoteConfig from 'audius-client/src/common/store/remote-config/slice' +import { createStore, combineReducers, applyMiddleware } from 'redux' +import { composeWithDevTools } from 'redux-devtools-extension' +import createSagaMiddleware from 'redux-saga' + +import type { AudioState } from './audio/reducer' +import audio from './audio/reducer' +import { reducer as common } from './common/reducer' +import type { DownloadState } from './download/slice' +import downloads from './download/slice' +import type { DrawersState } from './drawers/slice' +import drawers from './drawers/slice' +import type { KeyboardState } from './keyboard/slice' +import keyboard from './keyboard/slice' +import type { LifecycleState } from './lifecycle/reducer' +import lifecycle from './lifecycle/reducer' +import type { NotificationsState } from './notifications/reducer' +import notifications from './notifications/reducer' +import type { OAuthState } from './oauth/reducer' +import oauth from './oauth/reducer' +import rootSaga from './sagas' +import type { SearchState } from './search/reducer' +import search from './search/reducer' +import type { SignonState } from './signon/reducer' +import signon from './signon/reducer' +import type { WebState } from './web/reducer' +import web from './web/reducer' + +export type AppState = { + audio: AudioState + common: CommonState + drawers: DrawersState + downloads: DownloadState + keyboard: KeyboardState + lifecycle: LifecycleState + notifications: NotificationsState + oauth: OAuthState + remoteConfig: RemoteConfigState + search: SearchState + signon: SignonState + web: WebState +} + +const createRootReducer = () => + combineReducers({ + audio, + common, + drawers, + downloads, + keyboard, + lifecycle, + notifications, + oauth, + remoteConfig, + search, + signon, + web + }) + +const sagaMiddleware = createSagaMiddleware() +const middlewares = applyMiddleware(sagaMiddleware) +const composeEnhancers = composeWithDevTools({ trace: true, traceLimit: 25 }) +export const store = createStore( + createRootReducer(), + composeEnhancers(middlewares) +) +sagaMiddleware.run(rootSaga) + +const { dispatch } = store +export { dispatch } diff --git a/packages/web/src/services/audius-api-client/AudiusAPIClient.ts b/packages/web/src/common/services/audius-api-client/AudiusAPIClient.ts similarity index 96% rename from packages/web/src/services/audius-api-client/AudiusAPIClient.ts rename to packages/web/src/common/services/audius-api-client/AudiusAPIClient.ts index f7478b1a4d..ab80522550 100644 --- a/packages/web/src/services/audius-api-client/AudiusAPIClient.ts +++ b/packages/web/src/common/services/audius-api-client/AudiusAPIClient.ts @@ -5,19 +5,21 @@ import { Nullable, removeNullable, IntKeys, - StringKeys + StringKeys, + RemoteConfigInstance } from '@audius/common' +import { AudiusLibs } from '@audius/sdk' import { AuthHeaders } from 'common/services/audius-backend' import { SearchKind } from 'common/store/pages/search-results/types' import { decodeHashId, encodeHashId } from 'common/utils/hashIds' -import { SupporterResponse } from 'services/audius-backend/Tipping' -import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' +import type { SupporterResponse } from 'services/audius-backend/Tipping' import { getEagerDiscprov, waitForLibsInit } from 'services/audius-backend/eagerLoadUtils' -import { remoteConfigInstance } from 'services/remote-config/remote-config-instance' + +import type { AudiusBackend } from '../audius-backend' import * as adapter from './ResponseAdapter' import { processSearchResults } from './helper' @@ -34,6 +36,7 @@ import { OpaqueID } from './types' +// TODO: declare this at the root and use actual audiusLibs type declare global { interface Window { audiusLibs: any @@ -419,15 +422,33 @@ type GetUserSupporterArgs = { currentUserId: Nullable } -class AudiusAPIClient { +type AudiusAPIClientConfig = { + audiusBackendInstance: AudiusBackend + audiusLibs?: AudiusLibs + overrideEndpoint?: string + remoteConfigInstance: RemoteConfigInstance +} + +export class AudiusAPIClient { initializationState: InitializationState = { state: 'uninitialized' } + audiusBackendInstance: AudiusBackend + audiusLibs?: AudiusLibs overrideEndpoint?: string - - constructor({ overrideEndpoint }: { overrideEndpoint?: string } = {}) { + remoteConfigInstance: RemoteConfigInstance + + constructor({ + audiusBackendInstance, + audiusLibs, + overrideEndpoint, + remoteConfigInstance + }: AudiusAPIClientConfig) { + this.audiusBackendInstance = audiusBackendInstance + this.audiusLibs = audiusLibs this.overrideEndpoint = overrideEndpoint + this.remoteConfigInstance = remoteConfigInstance } async getTrending({ @@ -446,7 +467,7 @@ class AudiusAPIClient { user_id: encodedCurrentUserId || undefined, genre: genre || undefined } - const experiment = remoteConfigInstance.getRemoteVar( + const experiment = this.remoteConfigInstance.getRemoteVar( StringKeys.TRENDING_EXPERIMENT ) const trendingResponse: Nullable> = @@ -472,7 +493,7 @@ class AudiusAPIClient { offset, user_id: encodedCurrentUserId } - const experiment = remoteConfigInstance.getRemoteVar( + const experiment = this.remoteConfigInstance.getRemoteVar( StringKeys.UNDERGROUND_TRENDING_EXPERIMENT ) const trendingResponse: Nullable> = @@ -495,7 +516,7 @@ class AudiusAPIClient { limit, genre: genre || undefined } - const experiment = remoteConfigInstance.getRemoteVar( + const experiment = this.remoteConfigInstance.getRemoteVar( StringKeys.TRENDING_EXPERIMENT ) const trendingIdsResponse: Nullable> = @@ -534,7 +555,8 @@ class AudiusAPIClient { const encodedCurrentUserId = encodeHashId(currentUserId) const params = { genre, - limit: remoteConfigInstance.getRemoteVar(IntKeys.AUTOPLAY_LIMIT) || 10, + limit: + this.remoteConfigInstance.getRemoteVar(IntKeys.AUTOPLAY_LIMIT) || 10, exclusion_list: exclusionList.length > 0 ? exclusionList.map(String) : undefined, user_id: encodedCurrentUserId || undefined @@ -918,7 +940,7 @@ class AudiusAPIClient { let headers = {} if (encodedCurrentUserId && getUnlisted) { const { data, signature } = - await audiusBackendInstance.signDiscoveryNodeRequest() + await this.audiusBackendInstance.signDiscoveryNodeRequest() headers = { [AuthHeaders.Message]: data, [AuthHeaders.Signature]: signature @@ -1144,7 +1166,7 @@ class AudiusAPIClient { time } - const experiment = remoteConfigInstance.getRemoteVar( + const experiment = this.remoteConfigInstance.getRemoteVar( StringKeys.PLAYLIST_TRENDING_EXPERIMENT ) const response: Nullable> = @@ -1410,7 +1432,7 @@ class AudiusAPIClient { } // Listen for libs on chain selection - audiusBackendInstance.addDiscoveryProviderSelectionListener( + this.audiusBackendInstance.addDiscoveryProviderSelectionListener( (endpoint: string | null) => { if (endpoint) { console.debug(`APIClient: Setting to libs discprov: ${endpoint}`) @@ -1463,8 +1485,11 @@ class AudiusAPIClient { }, {}) const formattedPath = this._formatPath(pathType, path) - if (this.initializationState.type === 'libs' && window.audiusLibs) { - const data = await window.audiusLibs.discoveryProvider._makeRequest( + const audiusLibs = + this.audiusLibs ?? + (this.initializationState.type === 'libs' && window.audiusLibs) + if (audiusLibs) { + const data = await audiusLibs.discoveryProvider._makeRequest( { endpoint: formattedPath, queryParams: sanitizedParams, @@ -1542,7 +1567,3 @@ class AudiusAPIClient { return `${this.initializationState.endpoint}${path}?${params}` } } - -const instance = new AudiusAPIClient() - -export default instance diff --git a/packages/web/src/services/audius-api-client/ResponseAdapter.ts b/packages/web/src/common/services/audius-api-client/ResponseAdapter.ts similarity index 100% rename from packages/web/src/services/audius-api-client/ResponseAdapter.ts rename to packages/web/src/common/services/audius-api-client/ResponseAdapter.ts diff --git a/packages/web/src/services/audius-api-client/helper.ts b/packages/web/src/common/services/audius-api-client/helper.ts similarity index 100% rename from packages/web/src/services/audius-api-client/helper.ts rename to packages/web/src/common/services/audius-api-client/helper.ts diff --git a/packages/web/src/common/services/audius-api-client/index.ts b/packages/web/src/common/services/audius-api-client/index.ts new file mode 100644 index 0000000000..f591f8be54 --- /dev/null +++ b/packages/web/src/common/services/audius-api-client/index.ts @@ -0,0 +1 @@ +export * from './AudiusAPIClient' diff --git a/packages/web/src/services/audius-api-client/types.ts b/packages/web/src/common/services/audius-api-client/types.ts similarity index 100% rename from packages/web/src/services/audius-api-client/types.ts rename to packages/web/src/common/services/audius-api-client/types.ts diff --git a/packages/web/src/common/services/audius-backend/AudiusBackend.ts b/packages/web/src/common/services/audius-backend/AudiusBackend.ts index a432e7215b..31528d59e1 100644 --- a/packages/web/src/common/services/audius-backend/AudiusBackend.ts +++ b/packages/web/src/common/services/audius-backend/AudiusBackend.ts @@ -47,7 +47,7 @@ import imageCoverPhotoBlank from 'common/assets/img/imageCoverPhotoBlank.jpg' import placeholderProfilePicture from 'common/assets/img/imageProfilePicEmpty2X.png' import * as schemas from 'common/schemas' import { ClientRewardsReporter } from 'common/services/audius-backend/Rewards' -import CIDCache from 'common/store/cache/CIDCache' +import { CIDCache } from 'common/store/cache' import { BrowserNotificationSetting, PushNotificationSetting @@ -3210,3 +3210,5 @@ async function getCreateAssociatedTokenAccountTransaction({ tx.add(instr) return tx } + +export type AudiusBackend = ReturnType diff --git a/packages/web/src/common/store/cache/CIDCache.js b/packages/web/src/common/store/cache/CIDCache.ts similarity index 72% rename from packages/web/src/common/store/cache/CIDCache.js rename to packages/web/src/common/store/cache/CIDCache.ts index ce173d8f19..68379630ac 100644 --- a/packages/web/src/common/store/cache/CIDCache.js +++ b/packages/web/src/common/store/cache/CIDCache.ts @@ -6,6 +6,7 @@ const MAX_SIZE = 2000 class ContentIdentifierCache { + cache: Map constructor() { // Acts as an LRU cache this.cache = new Map() @@ -13,26 +14,22 @@ class ContentIdentifierCache { /** * Check if a CID is in the cache - * @param {string} cid */ - has(cid) { + has(cid: string) { return this.cache.has(cid) } /** * Retrieve the URL for an cid - * @param {string} cid */ - get(cid) { + get(cid: string) { return this.cache.get(cid) } /** * Adds an cid reference to a URL - * @param {string} cid - * @param {string} url a local url, e.g. one created by URL.createObjectURL(). */ - add(cid, url) { + add(cid: string, url: string) { this.cache.set(cid, url) if (this.cache.size > MAX_SIZE) { const firstKey = this.cache.keys().next().value @@ -41,6 +38,4 @@ class ContentIdentifierCache { } } -const CIDCache = new ContentIdentifierCache() -window.CIDCache = CIDCache -export default CIDCache +export const CIDCache = new ContentIdentifierCache() diff --git a/packages/web/src/common/store/cache/collections/sagas.js b/packages/web/src/common/store/cache/collections/sagas.js index 6ec25d79d8..6dc6b8e28f 100644 --- a/packages/web/src/common/store/cache/collections/sagas.js +++ b/packages/web/src/common/store/cache/collections/sagas.js @@ -20,7 +20,7 @@ import { fetchUsers } from 'common/store/cache/users/sagas' import { getUser } from 'common/store/cache/users/selectors' import { squashNewLines } from 'common/utils/formatUtil' import * as signOnActions from 'pages/sign-on/store/actions' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' import { make } from 'store/analytics/actions' import { waitForBackendSetup } from 'store/backend/sagas' diff --git a/packages/web/src/common/store/cache/collections/utils/retrieveCollections.ts b/packages/web/src/common/store/cache/collections/utils/retrieveCollections.ts index b2992aa4c7..0e1be40756 100644 --- a/packages/web/src/common/store/cache/collections/utils/retrieveCollections.ts +++ b/packages/web/src/common/store/cache/collections/utils/retrieveCollections.ts @@ -15,7 +15,7 @@ import { getCollections } from 'common/store/cache/collections/selectors' import { retrieve } from 'common/store/cache/sagas' import { getEntryTimestamp } from 'common/store/cache/selectors' import { retrieveTracks } from 'common/store/cache/tracks/utils' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' import { addTracksFromCollections } from './addTracksFromCollections' diff --git a/packages/web/src/common/store/cache/index.ts b/packages/web/src/common/store/cache/index.ts new file mode 100644 index 0000000000..c59a4dee8f --- /dev/null +++ b/packages/web/src/common/store/cache/index.ts @@ -0,0 +1 @@ +export * from './CIDCache' diff --git a/packages/web/src/common/store/cache/selectors.ts b/packages/web/src/common/store/cache/selectors.ts index ef11cc2024..7deb003333 100644 --- a/packages/web/src/common/store/cache/selectors.ts +++ b/packages/web/src/common/store/cache/selectors.ts @@ -16,8 +16,6 @@ import { UsersCacheState } from './users/types' /** * Selects from the cache and strips away cache-only fields. - * @param {CommonState} state - * @param {object} props { kind, id?, uid? } */ export function getEntry( state: CommonState, @@ -73,8 +71,6 @@ export function getEntry( /** * Selects the timestamps from the cache. - * @param {CommonState} state - * @param {object} props { kind, ids } */ export const getEntryTimestamp = ( state: CommonState, @@ -89,9 +85,6 @@ export const getEntryTimestamp = ( /** * Gets all cache entries and strips away cache-only fields. - * @param {CommonState} state - * @param {object} props { kind } - * @returns {object} */ export function getAllEntries( state: CommonState, diff --git a/packages/web/src/common/store/cache/tracks/sagas.js b/packages/web/src/common/store/cache/tracks/sagas.js index 65e945de99..8f801bcda8 100644 --- a/packages/web/src/common/store/cache/tracks/sagas.js +++ b/packages/web/src/common/store/cache/tracks/sagas.js @@ -29,7 +29,7 @@ import { fetchUsers } from 'common/store/cache/users/sagas' import { getUser } from 'common/store/cache/users/selectors' import { squashNewLines, formatUrlName } from 'common/utils/formatUtil' import * as signOnActions from 'pages/sign-on/store/actions' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { fetchCID } from 'services/audius-backend' import TrackDownload from 'services/audius-backend/TrackDownload' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' diff --git a/packages/web/src/common/store/cache/tracks/utils/fetchAndProcessRemixes.ts b/packages/web/src/common/store/cache/tracks/utils/fetchAndProcessRemixes.ts index cfb8b0675e..b78fabe81c 100644 --- a/packages/web/src/common/store/cache/tracks/utils/fetchAndProcessRemixes.ts +++ b/packages/web/src/common/store/cache/tracks/utils/fetchAndProcessRemixes.ts @@ -3,7 +3,7 @@ import { select, call, put } from 'typed-redux-saga/macro' import { getUserId } from 'common/store/account/selectors' import * as cacheActions from 'common/store/cache/actions' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { waitForValue } from 'utils/sagaHelpers' import { getTrack } from '../selectors' diff --git a/packages/web/src/common/store/cache/tracks/utils/fetchAndProcessStems.ts b/packages/web/src/common/store/cache/tracks/utils/fetchAndProcessStems.ts index 6bed0acc59..29da275b3e 100644 --- a/packages/web/src/common/store/cache/tracks/utils/fetchAndProcessStems.ts +++ b/packages/web/src/common/store/cache/tracks/utils/fetchAndProcessStems.ts @@ -2,7 +2,7 @@ import { ID, Kind, StemCategory, Stem, StemTrackMetadata } from '@audius/common' import { call, put } from 'redux-saga/effects' import * as cacheActions from 'common/store/cache/actions' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { waitForValue } from 'utils/sagaHelpers' import { getTrack } from '../selectors' diff --git a/packages/web/src/common/store/cache/tracks/utils/retrieveTracks.ts b/packages/web/src/common/store/cache/tracks/utils/retrieveTracks.ts index 1cb2e6830c..aa6fed4268 100644 --- a/packages/web/src/common/store/cache/tracks/utils/retrieveTracks.ts +++ b/packages/web/src/common/store/cache/tracks/utils/retrieveTracks.ts @@ -14,7 +14,7 @@ import { retrieve } from 'common/store/cache/sagas' import { getEntryTimestamp } from 'common/store/cache/selectors' import * as trackActions from 'common/store/cache/tracks/actions' import { getTracks as getTracksSelector } from 'common/store/cache/tracks/selectors' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' import { setTracksIsBlocked } from './blocklist' diff --git a/packages/web/src/common/store/cache/users/sagas.js b/packages/web/src/common/store/cache/users/sagas.js index bd8f167a12..bb6ee0393a 100644 --- a/packages/web/src/common/store/cache/users/sagas.js +++ b/packages/web/src/common/store/cache/users/sagas.js @@ -23,7 +23,7 @@ import { getAudiusAccountUser, setAudiusAccountUser } from 'services/LocalStorage' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' import { waitForValue } from 'utils/sagaHelpers' diff --git a/packages/web/src/common/store/index.ts b/packages/web/src/common/store/index.ts index 0158d6e8be..bdddddd208 100644 --- a/packages/web/src/common/store/index.ts +++ b/packages/web/src/common/store/index.ts @@ -1,332 +1,2 @@ -import { Kind, Cache, Collection } from '@audius/common' -import { combineReducers } from 'redux' - -import accountSlice from 'common/store/account/reducer' -import averageColorReducer from 'common/store/average-color/slice' -import collectionsErrorSagas from 'common/store/cache/collections/errorSagas' -import collectionsReducer from 'common/store/cache/collections/reducer' -import collectionsSagas from 'common/store/cache/collections/sagas' -import { asCache } from 'common/store/cache/reducer' -import cacheSagas from 'common/store/cache/sagas' -import tracksReducer from 'common/store/cache/tracks/reducer' -import tracksSagas from 'common/store/cache/tracks/sagas' -import { TracksCacheState } from 'common/store/cache/tracks/types' -import usersReducer from 'common/store/cache/users/reducer' -import usersSagas from 'common/store/cache/users/sagas' -import { UsersCacheState } from 'common/store/cache/users/types' -import { sagas as castSagas } from 'common/store/cast/sagas' -import cast from 'common/store/cast/slice' -import changePasswordReducer, { - ChangePasswordState -} from 'common/store/change-password/slice' -import notifications from 'common/store/notifications/reducer' -import audioRewardsSlice from 'common/store/pages/audio-rewards/slice' -import collection from 'common/store/pages/collection/reducer' -import { CollectionsPageState } from 'common/store/pages/collection/types' -import exploreCollectionsReducer from 'common/store/pages/explore/exploreCollections/slice' -import explorePageReducer from 'common/store/pages/explore/slice' -import feed from 'common/store/pages/feed/reducer' -import { FeedPageState } from 'common/store/pages/feed/types' -import historyPageReducer from 'common/store/pages/history-page/reducer' -import profileReducer from 'common/store/pages/profile/reducer' -import { ProfilePageState } from 'common/store/pages/profile/types' -import remixes from 'common/store/pages/remixes/slice' -import savedPageReducer from 'common/store/pages/saved-page/reducer' -import searchResults from 'common/store/pages/search-results/reducer' -import { SearchPageState } from 'common/store/pages/search-results/types' -import settings from 'common/store/pages/settings/reducer' -import { SettingsPageState } from 'common/store/pages/settings/types' -import smartCollection from 'common/store/pages/smart-collection/slice' -import tokenDashboardSlice from 'common/store/pages/token-dashboard/slice' -import track from 'common/store/pages/track/reducer' -import TrackPageState from 'common/store/pages/track/types' -import trendingPlaylists from 'common/store/pages/trending-playlists/slice' -import trendingUnderground from 'common/store/pages/trending-underground/slice' -import trending from 'common/store/pages/trending/reducer' -import { TrendingPageState } from 'common/store/pages/trending/types' -import queue from 'common/store/queue/slice' -import reachability from 'common/store/reachability/reducer' -import { ReachabilityState } from 'common/store/reachability/types' -import recoveryEmailSagas from 'common/store/recovery-email/sagas' -import remoteConfigSagas from 'common/store/remote-config/sagas' -import signOutSagas from 'common/store/sign-out/sagas' -import solanaReducer from 'common/store/solana/slice' -import stemsUpload from 'common/store/stems-upload/slice' -import tippingReducer from 'common/store/tipping/slice' -import addToPlaylistReducer, { - AddToPlaylistState -} from 'common/store/ui/add-to-playlist/reducer' -import artistRecommendationsReducer, { - ArtistRecommendationsState -} from 'common/store/ui/artist-recommendations/slice' -import collectibleDetailsReducer, { - CollectibleDetailsState -} from 'common/store/ui/collectible-details/slice' -import createPlaylistModalReducer from 'common/store/ui/createPlaylistModal/reducer' -import { CreatePlaylistModalState } from 'common/store/ui/createPlaylistModal/types' -import deletePlaylistConfirmationReducer from 'common/store/ui/delete-playlist-confirmation-modal/slice' -import { DeletePlaylistConfirmationModalState } from 'common/store/ui/delete-playlist-confirmation-modal/types' -import mobileOverflowModalReducer from 'common/store/ui/mobile-overflow-menu/slice' -import { MobileOverflowModalState } from 'common/store/ui/mobile-overflow-menu/types' -import modalsReducer, { ModalsState } from 'common/store/ui/modals/slice' -import nowPlayingReducer, { - NowPlayingState -} from 'common/store/ui/now-playing/slice' -import reactionsReducer, { - ReactionsState -} from 'common/store/ui/reactions/slice' -import shareModalReducer from 'common/store/ui/share-modal/slice' -import { ShareModalState } from 'common/store/ui/share-modal/types' -import shareSoundToTikTokModalReducer from 'common/store/ui/share-sound-to-tiktok-modal/slice' -import { ShareSoundToTikTokModalState } from 'common/store/ui/share-sound-to-tiktok-modal/types' -import theme from 'common/store/ui/theme/reducer' -import { ThemeState } from 'common/store/ui/theme/types' -import toastReducer, { ToastState } from 'common/store/ui/toast/slice' -import favoritesUserListReducer from 'common/store/user-list/favorites/reducers' -import followersUserListReducer from 'common/store/user-list/followers/reducers' -import followingUserListReducer from 'common/store/user-list/following/reducers' -import mutualsUserListReducer from 'common/store/user-list/mutuals/reducers' -import notificationsUserListReducer from 'common/store/user-list/notifications/reducers' -import repostsUserListReducer from 'common/store/user-list/reposts/reducers' -import supportingUserListReducer from 'common/store/user-list/supporting/reducers' -import topSupportersUserListReducer from 'common/store/user-list/top-supporters/reducers' -import wallet from 'common/store/wallet/slice' - -// In the future, these state slices will live in packages/common. -// For now they live in the web client. As features get migrated to RN -// relevant state slices should be added here. Eventually they will be pulled into -// packages/common and the mobile client will no longer be dependent on the web client - -export type CommonStoreContext = { - getLocalStorageItem: (key: string) => Promise - setLocalStorageItem: (key: string, value: string) => Promise -} - -/** - * A function that creates common reducers. The function takes - * a CommonStoreContext as input such that platforms (native and web) - * may specify system-level APIs, e.g. local storage. - * @param ctx - * @returns an object of all reducers to be used with `combineReducers` - */ -export const reducers = (ctx: CommonStoreContext) => ({ - account: accountSlice.reducer, - - // Config - reachability, - - // Cache - collections: asCache(collectionsReducer, Kind.COLLECTIONS), - tracks: asCache(tracksReducer, Kind.TRACKS), - users: asCache(usersReducer, Kind.USERS), - - // Playback - queue, - - // Wallet - wallet, - - // Cast - cast, - - // UI - ui: combineReducers({ - averageColor: averageColorReducer, - addToPlaylist: addToPlaylistReducer, - artistRecommendations: artistRecommendationsReducer, - changePassword: changePasswordReducer, - createPlaylistModal: createPlaylistModalReducer, - collectibleDetails: collectibleDetailsReducer, - deletePlaylistConfirmationModal: deletePlaylistConfirmationReducer, - mobileOverflowModal: mobileOverflowModalReducer, - modals: modalsReducer, - nowPlaying: nowPlayingReducer, - reactions: reactionsReducer, - shareSoundToTikTokModal: shareSoundToTikTokModalReducer, - shareModal: shareModalReducer, - toast: toastReducer, - userList: combineReducers({ - followers: followersUserListReducer, - following: followingUserListReducer, - reposts: repostsUserListReducer, - favorites: favoritesUserListReducer, - mutuals: mutualsUserListReducer, - notifications: notificationsUserListReducer, - topSupporters: topSupportersUserListReducer, - supporting: supportingUserListReducer - }), - theme - }), - - // Pages - pages: combineReducers({ - audioRewards: audioRewardsSlice.reducer, - collection, - feed, - explore: explorePageReducer, - exploreCollections: exploreCollectionsReducer, - historyPage: historyPageReducer, - profile: profileReducer, - smartCollection, - savedPage: savedPageReducer, - searchResults, - tokenDashboard: tokenDashboardSlice.reducer, - track, - trending, - trendingPlaylists, - trendingUnderground, - settings, - notifications, - remixes - }), - - // Solana - solana: solanaReducer, - - stemsUpload, - - // Tipping - tipping: tippingReducer -}) - -/** - * A function that creates common sagas. The function takes - * a CommonStoreContext as input such that platforms (native and web) - * may specify system-level APIs, e.g. local storage. - * @param ctx - * @returns an object of all sagas to be yielded - */ -export const sagas = (ctx: CommonStoreContext) => ({ - cache: cacheSagas, - collectionsError: collectionsErrorSagas, - collections: collectionsSagas, - tracks: tracksSagas, - users: usersSagas, - remoteConfig: remoteConfigSagas, - cast: castSagas(ctx), - signOut: signOutSagas, - recoveryEmail: recoveryEmailSagas - // TODO: - // pull in the following from web - // once AudiusBackend and dependencies are migrated - // common/store/pages/explore/exploreCollections/sagas.ts - // common/store/pages/explore/sagas.ts - // components/add-to-playlist/store/sagas.ts - // components/share-sound-to-tiktok-modal/store/sagas.ts - // store/social/tracks/sagas.ts - // store/social/users/sagas.ts - // store/social/collections/sagas.ts - // pages/audio-rewards-page/store/sagas.ts - // store/wallet/sagas.ts - // store/lineup/sagas.js - // pages/feed/store/lineups/feed/sagas.js - // pages/feed/store/sagas.js - // pages/collection/store/lineups/tracks/sagas.js - // pages/collection/store/sagas.js - // pages/track/store/lineups/tracks/sagas.js - // pages/track/store/sagas.js - // store/ui/stemsUpload/sagas.ts - // pages/user-list/followers/sagas.ts - // pages/user-list/following/sagas.ts - // pages/user-list/reposts/sagas.ts - // pages/user-list/favorites/sagas.ts - // pages/user-list/mutuals/sagas.ts - // pages/user-list/supporting/sagas.ts - // pages/user-list/top-supporters/sagas.ts - // pages/explore-page/store/sagas.ts - // pages/explore-page/store/exploreCollections/sagas.ts - // store/solana/sagas.ts - // pages/trending-page/store/sagas.ts - // pages/trending-page/store/lineups/trending/sagas.ts - // pages/trending-underground-page/store/lineups/tracks/sagas.ts - // pages/trending-underground-page/store/sagas.ts - // pages/smart-collection/store/sagas.ts - // store/application/ui/theme/sagas.ts - // pages/search-page/store/sagas.ts - // pages/search-page/store/lineups/tracks/sagas.ts - // notifications/store/sagas.ts - // notifications/store/mobileSagas.ts - // pages/remixes-page/store/sagas.ts - // pages/remixes-page/store/lineups/tracks/sagas.ts - // - // pull in the following from web - // once the player and dependencies are migrated - // store/queue/sagas.ts -}) - -export type CommonState = { - account: ReturnType - - // Config - reachability: ReachabilityState - - // Cache - collections: Cache - tracks: TracksCacheState - users: UsersCacheState - - // Playback - queue: ReturnType - - // Wallet - wallet: ReturnType - - // Cast - cast: ReturnType - - ui: { - averageColor: ReturnType - addToPlaylist: AddToPlaylistState - artistRecommendations: ArtistRecommendationsState - changePassword: ChangePasswordState - createPlaylistModal: CreatePlaylistModalState - collectibleDetails: CollectibleDetailsState - deletePlaylistConfirmationModal: DeletePlaylistConfirmationModalState - mobileOverflowModal: MobileOverflowModalState - modals: ModalsState - nowPlaying: NowPlayingState - reactions: ReactionsState - shareSoundToTikTokModal: ShareSoundToTikTokModalState - shareModal: ShareModalState - toast: ToastState - userList: { - followers: ReturnType - following: ReturnType - reposts: ReturnType - favorites: ReturnType - mutuals: ReturnType - notifications: ReturnType - topSupporters: ReturnType - supporting: ReturnType - } - theme: ThemeState - } - - pages: { - audioRewards: ReturnType - collection: CollectionsPageState - feed: FeedPageState - explore: ReturnType - exploreCollections: ReturnType - smartCollection: ReturnType - tokenDashboard: ReturnType - historyPage: ReturnType - track: TrackPageState - profile: ProfilePageState - savedPage: ReturnType - searchResults: SearchPageState - settings: SettingsPageState - trending: TrendingPageState - trendingPlaylists: ReturnType - trendingUnderground: ReturnType - notifications: ReturnType - remixes: ReturnType - } - - solana: ReturnType - - stemsUpload: ReturnType - - // Tipping - tipping: ReturnType -} +export * from './reducers' +export * from './sagas' diff --git a/packages/web/src/common/store/lineup/actions.ts b/packages/web/src/common/store/lineup/actions.ts index 83289cc2f3..f356b0b6e8 100644 --- a/packages/web/src/common/store/lineup/actions.ts +++ b/packages/web/src/common/store/lineup/actions.ts @@ -73,15 +73,15 @@ export class LineupActions { /** * Fetches entity metadatas for the lineup. * Side-effect: Fetches relevant creators and caches loaded tracks. - * @param {number} [offset] the offset into the "get tracks" query - * @param {number} [limit] the limit for the "get tracks" query - * @param {boolean} [overwrite] a boolean indicating whether to overwrite cached entries the fetch may be refetching - * @param {*} [payload] keyword args payload to send to the "get tracks" query */ fetchLineupMetadatas( + // the offset into the "get tracks" query offset = 0, + // the limit for the "get tracks" query limit = 10, + // a boolean indicating whether to overwrite cached entries the fetch may be refetching overwrite = false, + // keyword args payload to send to the "get tracks" query payload?: unknown ) { return { diff --git a/packages/web/src/common/store/pages/profile/lineups/feed/retrieveUserReposts.ts b/packages/web/src/common/store/pages/profile/lineups/feed/retrieveUserReposts.ts index f7cfe7b5e6..f926b9f2aa 100644 --- a/packages/web/src/common/store/pages/profile/lineups/feed/retrieveUserReposts.ts +++ b/packages/web/src/common/store/pages/profile/lineups/feed/retrieveUserReposts.ts @@ -3,7 +3,7 @@ import { all } from 'redux-saga/effects' import { processAndCacheCollections } from 'common/store/cache/collections/utils' import { processAndCacheTracks } from 'common/store/cache/tracks/utils' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' const getTracksAndCollections = ( feed: (UserTrackMetadata | UserCollection)[] diff --git a/packages/web/src/common/store/pages/profile/lineups/tracks/retrieveUserTracks.ts b/packages/web/src/common/store/pages/profile/lineups/tracks/retrieveUserTracks.ts index 7d4be4e71c..3066bbbb2e 100644 --- a/packages/web/src/common/store/pages/profile/lineups/tracks/retrieveUserTracks.ts +++ b/packages/web/src/common/store/pages/profile/lineups/tracks/retrieveUserTracks.ts @@ -1,7 +1,7 @@ import { ID, Track } from '@audius/common' import { processAndCacheTracks } from 'common/store/cache/tracks/utils' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' type RetrieveUserTracksArgs = { handle: string diff --git a/packages/web/src/common/store/reducers.ts b/packages/web/src/common/store/reducers.ts new file mode 100644 index 0000000000..d60e9b1430 --- /dev/null +++ b/packages/web/src/common/store/reducers.ts @@ -0,0 +1,246 @@ +import { Kind, Cache, Collection } from '@audius/common' +import { combineReducers } from 'redux' + +import accountSlice from 'common/store/account/reducer' +import averageColorReducer from 'common/store/average-color/slice' +import collectionsReducer from 'common/store/cache/collections/reducer' +import { asCache } from 'common/store/cache/reducer' +import tracksReducer from 'common/store/cache/tracks/reducer' +import { TracksCacheState } from 'common/store/cache/tracks/types' +import usersReducer from 'common/store/cache/users/reducer' +import { UsersCacheState } from 'common/store/cache/users/types' +import cast from 'common/store/cast/slice' +import changePasswordReducer, { + ChangePasswordState +} from 'common/store/change-password/slice' +import notifications from 'common/store/notifications/reducer' +import audioRewardsSlice from 'common/store/pages/audio-rewards/slice' +import collection from 'common/store/pages/collection/reducer' +import { CollectionsPageState } from 'common/store/pages/collection/types' +import exploreCollectionsReducer from 'common/store/pages/explore/exploreCollections/slice' +import explorePageReducer from 'common/store/pages/explore/slice' +import feed from 'common/store/pages/feed/reducer' +import { FeedPageState } from 'common/store/pages/feed/types' +import historyPageReducer from 'common/store/pages/history-page/reducer' +import profileReducer from 'common/store/pages/profile/reducer' +import { ProfilePageState } from 'common/store/pages/profile/types' +import remixes from 'common/store/pages/remixes/slice' +import savedPageReducer from 'common/store/pages/saved-page/reducer' +import searchResults from 'common/store/pages/search-results/reducer' +import { SearchPageState } from 'common/store/pages/search-results/types' +import settings from 'common/store/pages/settings/reducer' +import { SettingsPageState } from 'common/store/pages/settings/types' +import smartCollection from 'common/store/pages/smart-collection/slice' +import tokenDashboardSlice from 'common/store/pages/token-dashboard/slice' +import track from 'common/store/pages/track/reducer' +import TrackPageState from 'common/store/pages/track/types' +import trendingPlaylists from 'common/store/pages/trending-playlists/slice' +import trendingUnderground from 'common/store/pages/trending-underground/slice' +import trending from 'common/store/pages/trending/reducer' +import { TrendingPageState } from 'common/store/pages/trending/types' +import queue from 'common/store/queue/slice' +import reachability from 'common/store/reachability/reducer' +import { ReachabilityState } from 'common/store/reachability/types' +import solanaReducer from 'common/store/solana/slice' +import stemsUpload from 'common/store/stems-upload/slice' +import tippingReducer from 'common/store/tipping/slice' +import addToPlaylistReducer, { + AddToPlaylistState +} from 'common/store/ui/add-to-playlist/reducer' +import artistRecommendationsReducer, { + ArtistRecommendationsState +} from 'common/store/ui/artist-recommendations/slice' +import collectibleDetailsReducer, { + CollectibleDetailsState +} from 'common/store/ui/collectible-details/slice' +import createPlaylistModalReducer from 'common/store/ui/createPlaylistModal/reducer' +import { CreatePlaylistModalState } from 'common/store/ui/createPlaylistModal/types' +import deletePlaylistConfirmationReducer from 'common/store/ui/delete-playlist-confirmation-modal/slice' +import { DeletePlaylistConfirmationModalState } from 'common/store/ui/delete-playlist-confirmation-modal/types' +import mobileOverflowModalReducer from 'common/store/ui/mobile-overflow-menu/slice' +import { MobileOverflowModalState } from 'common/store/ui/mobile-overflow-menu/types' +import modalsReducer, { ModalsState } from 'common/store/ui/modals/slice' +import nowPlayingReducer, { + NowPlayingState +} from 'common/store/ui/now-playing/slice' +import reactionsReducer, { + ReactionsState +} from 'common/store/ui/reactions/slice' +import shareModalReducer from 'common/store/ui/share-modal/slice' +import { ShareModalState } from 'common/store/ui/share-modal/types' +import shareSoundToTikTokModalReducer from 'common/store/ui/share-sound-to-tiktok-modal/slice' +import { ShareSoundToTikTokModalState } from 'common/store/ui/share-sound-to-tiktok-modal/types' +import theme from 'common/store/ui/theme/reducer' +import { ThemeState } from 'common/store/ui/theme/types' +import toastReducer, { ToastState } from 'common/store/ui/toast/slice' +import favoritesUserListReducer from 'common/store/user-list/favorites/reducers' +import followersUserListReducer from 'common/store/user-list/followers/reducers' +import followingUserListReducer from 'common/store/user-list/following/reducers' +import mutualsUserListReducer from 'common/store/user-list/mutuals/reducers' +import notificationsUserListReducer from 'common/store/user-list/notifications/reducers' +import repostsUserListReducer from 'common/store/user-list/reposts/reducers' +import supportingUserListReducer from 'common/store/user-list/supporting/reducers' +import topSupportersUserListReducer from 'common/store/user-list/top-supporters/reducers' +import wallet from 'common/store/wallet/slice' +/** + * A function that creates common reducers. The function takes + * a CommonStoreContext as input such that platforms (native and web) + * may specify system-level APIs, e.g. local storage. + * @returns an object of all reducers to be used with `combineReducers` + */ +export const reducers = () => ({ + account: accountSlice.reducer, + + // Config + reachability, + + // Cache + collections: asCache(collectionsReducer, Kind.COLLECTIONS), + tracks: asCache(tracksReducer, Kind.TRACKS), + users: asCache(usersReducer, Kind.USERS), + + // Playback + queue, + + // Wallet + wallet, + + // Cast + cast, + + // UI + ui: combineReducers({ + averageColor: averageColorReducer, + addToPlaylist: addToPlaylistReducer, + artistRecommendations: artistRecommendationsReducer, + changePassword: changePasswordReducer, + createPlaylistModal: createPlaylistModalReducer, + collectibleDetails: collectibleDetailsReducer, + deletePlaylistConfirmationModal: deletePlaylistConfirmationReducer, + mobileOverflowModal: mobileOverflowModalReducer, + modals: modalsReducer, + nowPlaying: nowPlayingReducer, + reactions: reactionsReducer, + shareSoundToTikTokModal: shareSoundToTikTokModalReducer, + shareModal: shareModalReducer, + toast: toastReducer, + userList: combineReducers({ + followers: followersUserListReducer, + following: followingUserListReducer, + reposts: repostsUserListReducer, + favorites: favoritesUserListReducer, + mutuals: mutualsUserListReducer, + notifications: notificationsUserListReducer, + topSupporters: topSupportersUserListReducer, + supporting: supportingUserListReducer + }), + theme + }), + + // Pages + pages: combineReducers({ + audioRewards: audioRewardsSlice.reducer, + collection, + feed, + explore: explorePageReducer, + exploreCollections: exploreCollectionsReducer, + historyPage: historyPageReducer, + profile: profileReducer, + smartCollection, + savedPage: savedPageReducer, + searchResults, + tokenDashboard: tokenDashboardSlice.reducer, + track, + trending, + trendingPlaylists, + trendingUnderground, + settings, + notifications, + remixes + }), + + // Solana + solana: solanaReducer, + + stemsUpload, + + // Tipping + tipping: tippingReducer +}) + +export type CommonState = { + account: ReturnType + + // Config + reachability: ReachabilityState + + // Cache + collections: Cache + tracks: TracksCacheState + users: UsersCacheState + + // Playback + queue: ReturnType + + // Wallet + wallet: ReturnType + + // Cast + cast: ReturnType + + ui: { + averageColor: ReturnType + addToPlaylist: AddToPlaylistState + artistRecommendations: ArtistRecommendationsState + changePassword: ChangePasswordState + createPlaylistModal: CreatePlaylistModalState + collectibleDetails: CollectibleDetailsState + deletePlaylistConfirmationModal: DeletePlaylistConfirmationModalState + mobileOverflowModal: MobileOverflowModalState + modals: ModalsState + nowPlaying: NowPlayingState + reactions: ReactionsState + shareSoundToTikTokModal: ShareSoundToTikTokModalState + shareModal: ShareModalState + toast: ToastState + userList: { + followers: ReturnType + following: ReturnType + reposts: ReturnType + favorites: ReturnType + mutuals: ReturnType + notifications: ReturnType + topSupporters: ReturnType + supporting: ReturnType + } + theme: ThemeState + } + + pages: { + audioRewards: ReturnType + collection: CollectionsPageState + feed: FeedPageState + explore: ReturnType + exploreCollections: ReturnType + smartCollection: ReturnType + tokenDashboard: ReturnType + historyPage: ReturnType + track: TrackPageState + profile: ProfilePageState + savedPage: ReturnType + searchResults: SearchPageState + settings: SettingsPageState + trending: TrendingPageState + trendingPlaylists: ReturnType + trendingUnderground: ReturnType + notifications: ReturnType + remixes: ReturnType + } + + solana: ReturnType + + stemsUpload: ReturnType + + // Tipping + tipping: ReturnType +} diff --git a/packages/web/src/common/store/sagas.ts b/packages/web/src/common/store/sagas.ts new file mode 100644 index 0000000000..5d062b56ae --- /dev/null +++ b/packages/web/src/common/store/sagas.ts @@ -0,0 +1,82 @@ +import collectionsErrorSagas from 'common/store/cache/collections/errorSagas' +import collectionsSagas from 'common/store/cache/collections/sagas' +import cacheSagas from 'common/store/cache/sagas' +import tracksSagas from 'common/store/cache/tracks/sagas' +import usersSagas from 'common/store/cache/users/sagas' +import { sagas as castSagas } from 'common/store/cast/sagas' +import recoveryEmailSagas from 'common/store/recovery-email/sagas' +import remoteConfigSagas from 'common/store/remote-config/sagas' +import signOutSagas from 'common/store/sign-out/sagas' + +// In the future, these state slices will live in packages/common. +// For now they live in the web client. As features get migrated to RN +// relevant state slices should be added here. Eventually they will be pulled into +// packages/common and the mobile client will no longer be dependent on the web client + +export type CommonStoreContext = { + getLocalStorageItem: (key: string) => Promise + setLocalStorageItem: (key: string, value: string) => Promise +} + +/** + * A function that creates common sagas. The function takes + * a CommonStoreContext as input such that platforms (native and web) + * may specify system-level APIs, e.g. local storage. + */ +export const sagas = (ctx: CommonStoreContext) => ({ + cache: cacheSagas, + collectionsError: collectionsErrorSagas, + collections: collectionsSagas, + tracks: tracksSagas, + users: usersSagas, + remoteConfig: remoteConfigSagas, + cast: castSagas(ctx), + signOut: signOutSagas, + recoveryEmail: recoveryEmailSagas + // TODO: + // pull in the following from web + // once AudiusBackend and dependencies are migrated + // common/store/pages/explore/exploreCollections/sagas.ts + // common/store/pages/explore/sagas.ts + // components/add-to-playlist/store/sagas.ts + // components/share-sound-to-tiktok-modal/store/sagas.ts + // store/social/tracks/sagas.ts + // store/social/users/sagas.ts + // store/social/collections/sagas.ts + // pages/audio-rewards-page/store/sagas.ts + // store/wallet/sagas.ts + // store/lineup/sagas.js + // pages/feed/store/lineups/feed/sagas.js + // pages/feed/store/sagas.js + // pages/collection/store/lineups/tracks/sagas.js + // pages/collection/store/sagas.js + // pages/track/store/lineups/tracks/sagas.js + // pages/track/store/sagas.js + // store/ui/stemsUpload/sagas.ts + // pages/user-list/followers/sagas.ts + // pages/user-list/following/sagas.ts + // pages/user-list/reposts/sagas.ts + // pages/user-list/favorites/sagas.ts + // pages/user-list/mutuals/sagas.ts + // pages/user-list/supporting/sagas.ts + // pages/user-list/top-supporters/sagas.ts + // pages/explore-page/store/sagas.ts + // pages/explore-page/store/exploreCollections/sagas.ts + // store/solana/sagas.ts + // pages/trending-page/store/sagas.ts + // pages/trending-page/store/lineups/trending/sagas.ts + // pages/trending-underground-page/store/lineups/tracks/sagas.ts + // pages/trending-underground-page/store/sagas.ts + // pages/smart-collection/store/sagas.ts + // store/application/ui/theme/sagas.ts + // pages/search-page/store/sagas.ts + // pages/search-page/store/lineups/tracks/sagas.ts + // notifications/store/sagas.ts + // notifications/store/mobileSagas.ts + // pages/remixes-page/store/sagas.ts + // pages/remixes-page/store/lineups/tracks/sagas.ts + // + // pull in the following from web + // once the player and dependencies are migrated + // store/queue/sagas.ts +}) diff --git a/packages/web/src/common/store/ui/artist-recommendations/sagas.ts b/packages/web/src/common/store/ui/artist-recommendations/sagas.ts index 986183b21a..4f5cbd78a9 100644 --- a/packages/web/src/common/store/ui/artist-recommendations/sagas.ts +++ b/packages/web/src/common/store/ui/artist-recommendations/sagas.ts @@ -5,7 +5,7 @@ import { call, put, select, takeEvery } from 'redux-saga/effects' import { getUserId } from 'common/store/account/selectors' import { processAndCacheUsers } from 'common/store/cache/users/utils' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { remoteConfigInstance } from 'services/remote-config/remote-config-instance' import * as artistRecommendationsActions from './slice' diff --git a/packages/web/src/common/store/ui/reactions/sagas.ts b/packages/web/src/common/store/ui/reactions/sagas.ts index 182ca73ceb..273b8e67e7 100644 --- a/packages/web/src/common/store/ui/reactions/sagas.ts +++ b/packages/web/src/common/store/ui/reactions/sagas.ts @@ -1,7 +1,7 @@ import { removeNullable } from '@audius/common' import { call, takeEvery, all, put, select } from 'typed-redux-saga/macro' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { submitReaction } from 'services/audius-backend/Reactions' import { diff --git a/packages/web/src/components/search-bar/store/sagas.js b/packages/web/src/components/search-bar/store/sagas.js index 9eb0cf7e91..018a7c6485 100644 --- a/packages/web/src/components/search-bar/store/sagas.js +++ b/packages/web/src/components/search-bar/store/sagas.js @@ -4,7 +4,7 @@ import { call, cancel, fork, put, race, select, take } from 'redux-saga/effects' import { getUserId } from 'common/store/account/selectors' import { setTracksIsBlocked } from 'common/store/cache/tracks/utils/blocklist' import * as searchActions from 'components/search-bar/store/actions' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { make } from 'store/analytics/actions' import { waitForBackendSetup } from 'store/backend/sagas' diff --git a/packages/web/src/components/share-sound-to-tiktok-modal/store/sagas.ts b/packages/web/src/components/share-sound-to-tiktok-modal/store/sagas.ts index 02200629e3..d4f64d857a 100644 --- a/packages/web/src/components/share-sound-to-tiktok-modal/store/sagas.ts +++ b/packages/web/src/components/share-sound-to-tiktok-modal/store/sagas.ts @@ -22,7 +22,7 @@ import { Status } from 'common/store/ui/share-sound-to-tiktok-modal/types' import { getErrorMessage } from 'common/utils/error' import { encodeHashId } from 'common/utils/hashIds' import { show as showConfetti } from 'components/music-confetti/store/slice' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { make } from 'store/analytics/actions' import { AppState } from 'store/types' diff --git a/packages/web/src/pages/audio-rewards-page/store/sagas.ts b/packages/web/src/pages/audio-rewards-page/store/sagas.ts index 45a5cc3b49..0853591b4b 100644 --- a/packages/web/src/pages/audio-rewards-page/store/sagas.ts +++ b/packages/web/src/pages/audio-rewards-page/store/sagas.ts @@ -60,7 +60,7 @@ import { getBalance, increaseBalance } from 'common/store/wallet/slice' import { stringAudioToStringWei } from 'common/utils/wallet' import { show as showMusicConfetti } from 'components/music-confetti/store/slice' import mobileSagas from 'pages/audio-rewards-page/store/mobileSagas' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { getCognitoExists } from 'services/audius-backend/Cognito' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' import { remoteConfigInstance } from 'services/remote-config/remote-config-instance' diff --git a/packages/web/src/pages/audio-rewards-page/store/store.test.ts b/packages/web/src/pages/audio-rewards-page/store/store.test.ts index 101b0d6912..8c8419cc89 100644 --- a/packages/web/src/pages/audio-rewards-page/store/store.test.ts +++ b/packages/web/src/pages/audio-rewards-page/store/store.test.ts @@ -47,7 +47,7 @@ import { getFeePayer } from 'common/store/solana/selectors' import { setVisibility } from 'common/store/ui/modals/slice' import { getBalance, increaseBalance } from 'common/store/wallet/slice' import { stringAudioToStringWei } from 'common/utils/wallet' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { getCognitoExists } from 'services/audius-backend/Cognito' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' // Need the mock type to get the helper function that sets the config diff --git a/packages/web/src/pages/favorites-page/sagas.ts b/packages/web/src/pages/favorites-page/sagas.ts index 7ec2222ece..78571e23e6 100644 --- a/packages/web/src/pages/favorites-page/sagas.ts +++ b/packages/web/src/pages/favorites-page/sagas.ts @@ -17,7 +17,7 @@ import { import { USER_LIST_TAG } from 'common/store/user-list/favorites/types' import UserListSagaFactory from 'common/store/user-list/sagas' import { createUserListProvider } from 'components/user-list/utils' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' const getPlaylistFavorites = createUserListProvider({ getExistingEntity: getCollection, diff --git a/packages/web/src/pages/feed-page/store/lineups/feed/sagas.ts b/packages/web/src/pages/feed-page/store/lineups/feed/sagas.ts index a2ce7df177..c6fba6b5d7 100644 --- a/packages/web/src/pages/feed-page/store/lineups/feed/sagas.ts +++ b/packages/web/src/pages/feed-page/store/lineups/feed/sagas.ts @@ -10,6 +10,7 @@ import { } from '@audius/common' import { select, all } from 'redux-saga/effects' +import { GetSocialFeedArgs } from 'common/services/audius-api-client' import { CommonState } from 'common/store' import { getAccountUser } from 'common/store/account/selectors' import { processAndCacheCollections } from 'common/store/cache/collections/utils' @@ -21,9 +22,7 @@ import { getFollowIds, getStartedSignOnProcess } from 'pages/sign-on/store/selectors' -import apiClient, { - GetSocialFeedArgs -} from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { LineupSagas } from 'store/lineup/sagas' type FeedItem = LineupTrack | Collection diff --git a/packages/web/src/pages/followers-page/sagas.ts b/packages/web/src/pages/followers-page/sagas.ts index ba676a8b67..c95cd435cb 100644 --- a/packages/web/src/pages/followers-page/sagas.ts +++ b/packages/web/src/pages/followers-page/sagas.ts @@ -12,7 +12,7 @@ import { import { USER_LIST_TAG } from 'common/store/user-list/followers/types' import UserListSagaFactory from 'common/store/user-list/sagas' import { createUserListProvider } from 'components/user-list/utils' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' const provider = createUserListProvider({ getExistingEntity: getUser, diff --git a/packages/web/src/pages/following-page/sagas.ts b/packages/web/src/pages/following-page/sagas.ts index c392f67e12..9c3785a4e1 100644 --- a/packages/web/src/pages/following-page/sagas.ts +++ b/packages/web/src/pages/following-page/sagas.ts @@ -12,7 +12,7 @@ import { import { USER_LIST_TAG } from 'common/store/user-list/following/types' import UserListSagaFactory from 'common/store/user-list/sagas' import { createUserListProvider } from 'components/user-list/utils' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' const provider = createUserListProvider({ getExistingEntity: getUser, diff --git a/packages/web/src/pages/history-page/store/lineups/tracks/sagas.js b/packages/web/src/pages/history-page/store/lineups/tracks/sagas.js index e28196737c..ddeab3dc20 100644 --- a/packages/web/src/pages/history-page/store/lineups/tracks/sagas.js +++ b/packages/web/src/pages/history-page/store/lineups/tracks/sagas.js @@ -8,7 +8,7 @@ import { PREFIX, tracksActions } from 'common/store/pages/history-page/lineups/tracks/actions' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { LineupSagas } from 'store/lineup/sagas' function* getHistoryTracks() { diff --git a/packages/web/src/pages/profile-page/sagas.js b/packages/web/src/pages/profile-page/sagas.js index ee65c7b193..7ad66ad29a 100644 --- a/packages/web/src/pages/profile-page/sagas.js +++ b/packages/web/src/pages/profile-page/sagas.js @@ -32,7 +32,7 @@ import { refreshSupport } from 'common/store/tipping/slice' import * as artistRecommendationsActions from 'common/store/ui/artist-recommendations/slice' import { squashNewLines } from 'common/utils/formatUtil' import { setAudiusAccountUser } from 'services/LocalStorage' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { fetchCID } from 'services/audius-backend' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' import OpenSeaClient from 'services/opensea-client/OpenSeaClient' diff --git a/packages/web/src/pages/remixes-page/store/lineups/tracks/sagas.ts b/packages/web/src/pages/remixes-page/store/lineups/tracks/sagas.ts index 3cfcdda3e5..dfce094a47 100644 --- a/packages/web/src/pages/remixes-page/store/lineups/tracks/sagas.ts +++ b/packages/web/src/pages/remixes-page/store/lineups/tracks/sagas.ts @@ -8,7 +8,7 @@ import { } from 'common/store/pages/remixes/lineup/actions' import { getTrackId, getLineup } from 'common/store/pages/remixes/selectors' import { setCount } from 'common/store/pages/remixes/slice' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { LineupSagas } from 'store/lineup/sagas' import { AppState } from 'store/types' diff --git a/packages/web/src/pages/reposts-page/sagas.ts b/packages/web/src/pages/reposts-page/sagas.ts index 2b9926fdb7..54de8cba87 100644 --- a/packages/web/src/pages/reposts-page/sagas.ts +++ b/packages/web/src/pages/reposts-page/sagas.ts @@ -17,7 +17,7 @@ import { import { RepostType, USER_LIST_TAG } from 'common/store/user-list/reposts/types' import UserListSagaFactory from 'common/store/user-list/sagas' import { createUserListProvider } from 'components/user-list/utils' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' const getPlaylistReposts = createUserListProvider({ getExistingEntity: getCollection, diff --git a/packages/web/src/pages/saved-page/store/sagas.js b/packages/web/src/pages/saved-page/store/sagas.js index 8da89ebbd9..60bdea47c3 100644 --- a/packages/web/src/pages/saved-page/store/sagas.js +++ b/packages/web/src/pages/saved-page/store/sagas.js @@ -5,7 +5,7 @@ import { processAndCacheTracks } from 'common/store/cache/tracks/utils' import * as actions from 'common/store/pages/saved-page/actions' import { tracksActions } from 'common/store/pages/saved-page/lineups/tracks/actions' import { getSaves } from 'common/store/pages/saved-page/selectors' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { waitForValue } from 'utils/sagaHelpers' import tracksSagas from './lineups/tracks/sagas' diff --git a/packages/web/src/pages/search-page/store/sagas.js b/packages/web/src/pages/search-page/store/sagas.js index 690d6fa766..b34fcbcf49 100644 --- a/packages/web/src/pages/search-page/store/sagas.js +++ b/packages/web/src/pages/search-page/store/sagas.js @@ -9,7 +9,7 @@ import * as searchPageActions from 'common/store/pages/search-results/actions' import { tracksActions as tracksLineupActions } from 'common/store/pages/search-results/lineup/tracks/actions' import { trimToAlphaNumeric } from 'common/utils/formatUtil' import tracksSagas from 'pages/search-page/store/lineups/tracks/sagas' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' import { waitForBackendSetup } from 'store/backend/sagas' diff --git a/packages/web/src/pages/sign-on/store/sagas.js b/packages/web/src/pages/sign-on/store/sagas.js index d0f54438fa..4220cdfa22 100644 --- a/packages/web/src/pages/sign-on/store/sagas.js +++ b/packages/web/src/pages/sign-on/store/sagas.js @@ -31,7 +31,7 @@ import { getFeePayer } from 'common/store/solana/selectors' import { ELECTRONIC_SUBGENRES, Genre } from 'common/utils/genres' import { getIGUserUrl } from 'components/instagram-auth/InstagramAuth' import { getCityAndRegion } from 'services/Location' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' import { getFeatureEnabled } from 'services/remote-config/featureFlagHelpers' import { remoteConfigInstance } from 'services/remote-config/remote-config-instance' diff --git a/packages/web/src/pages/supporting-page/sagas.ts b/packages/web/src/pages/supporting-page/sagas.ts index f771894ba0..e7bda04967 100644 --- a/packages/web/src/pages/supporting-page/sagas.ts +++ b/packages/web/src/pages/supporting-page/sagas.ts @@ -1,6 +1,7 @@ import { ID, User, UserMetadata } from '@audius/common' import { put, select } from 'typed-redux-saga' +import * as adapter from 'common/services/audius-api-client/ResponseAdapter' import { getUser } from 'common/store/cache/users/selectors' import { setSupportingForUser } from 'common/store/tipping/slice' import { SupportingMapForUser } from 'common/store/tipping/types' @@ -16,7 +17,6 @@ import { USER_LIST_TAG } from 'common/store/user-list/supporting/types' import { decodeHashId, encodeHashId } from 'common/utils/hashIds' import { stringWeiToBN } from 'common/utils/wallet' import { createUserListProvider } from 'components/user-list/utils' -import * as adapter from 'services/audius-api-client/ResponseAdapter' import { fetchSupporting, SupportingResponse diff --git a/packages/web/src/pages/top-supporters-page/sagas.ts b/packages/web/src/pages/top-supporters-page/sagas.ts index f12fdf5d49..29cb5ce3b9 100644 --- a/packages/web/src/pages/top-supporters-page/sagas.ts +++ b/packages/web/src/pages/top-supporters-page/sagas.ts @@ -1,6 +1,7 @@ import { ID, User, removeNullable } from '@audius/common' import { put, select } from 'typed-redux-saga/macro' +import * as adapter from 'common/services/audius-api-client/ResponseAdapter' import { getUser } from 'common/store/cache/users/selectors' import { setSupportersForUser } from 'common/store/tipping/slice' import { SupportersMapForUser } from 'common/store/tipping/types' @@ -15,7 +16,6 @@ import { import { USER_LIST_TAG } from 'common/store/user-list/top-supporters/types' import { decodeHashId, encodeHashId } from 'common/utils/hashIds' import { createUserListProvider } from 'components/user-list/utils' -import * as adapter from 'services/audius-api-client/ResponseAdapter' import { fetchSupporters, SupporterResponse diff --git a/packages/web/src/pages/track-page/store/retrieveTrending.ts b/packages/web/src/pages/track-page/store/retrieveTrending.ts index d3224d48a7..735af73345 100644 --- a/packages/web/src/pages/track-page/store/retrieveTrending.ts +++ b/packages/web/src/pages/track-page/store/retrieveTrending.ts @@ -17,7 +17,7 @@ import { getTrendingGenre } from 'common/store/pages/trending/selectors' import { Genre } from 'common/utils/genres' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { remoteConfigInstance } from 'services/remote-config/remote-config-instance' import { AppState } from 'store/types' diff --git a/packages/web/src/pages/track-page/store/sagas.js b/packages/web/src/pages/track-page/store/sagas.js index c56d31249a..0960719d8b 100644 --- a/packages/web/src/pages/track-page/store/sagas.js +++ b/packages/web/src/pages/track-page/store/sagas.js @@ -18,7 +18,7 @@ import { } from 'common/store/pages/track/selectors' import { getIsReachable } from 'common/store/reachability/selectors' import tracksSagas from 'pages/track-page/store/lineups/tracks/sagas' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { remoteConfigInstance } from 'services/remote-config/remote-config-instance' import { waitForBackendSetup } from 'store/backend/sagas' import { NOT_FOUND_PAGE, trackRemixesPage } from 'utils/route' diff --git a/packages/web/src/pages/trending-playlists/store/lineups/collections/sagas.ts b/packages/web/src/pages/trending-playlists/store/lineups/collections/sagas.ts index 3d8e4a66fa..a66a8ea833 100644 --- a/packages/web/src/pages/trending-playlists/store/lineups/collections/sagas.ts +++ b/packages/web/src/pages/trending-playlists/store/lineups/collections/sagas.ts @@ -8,7 +8,7 @@ import { trendingPlaylistLineupActions } from 'common/store/pages/trending-playlists/lineups/actions' import { getLineup } from 'common/store/pages/trending-playlists/lineups/selectors' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { remoteConfigInstance } from 'services/remote-config/remote-config-instance' import { LineupSagas } from 'store/lineup/sagas' diff --git a/packages/web/src/pages/trending-underground/store/lineups/tracks/sagas.ts b/packages/web/src/pages/trending-underground/store/lineups/tracks/sagas.ts index bf2f212848..3e13c87831 100644 --- a/packages/web/src/pages/trending-underground/store/lineups/tracks/sagas.ts +++ b/packages/web/src/pages/trending-underground/store/lineups/tracks/sagas.ts @@ -8,7 +8,7 @@ import { trendingUndergroundLineupActions } from 'common/store/pages/trending-underground/lineup/actions' import { getLineup } from 'common/store/pages/trending-underground/lineup/selectors' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { remoteConfigInstance } from 'services/remote-config/remote-config-instance' import { LineupSagas } from 'store/lineup/sagas' diff --git a/packages/web/src/pages/upload-page/components/ShareBanner.tsx b/packages/web/src/pages/upload-page/components/ShareBanner.tsx index 4fdf8e2597..ca487a8c30 100644 --- a/packages/web/src/pages/upload-page/components/ShareBanner.tsx +++ b/packages/web/src/pages/upload-page/components/ShareBanner.tsx @@ -12,7 +12,7 @@ import { open as openTikTokModal } from 'common/store/ui/share-sound-to-tiktok-m import Toast from 'components/toast/Toast' import { MountPlacement, ComponentPlacement } from 'components/types' import { useFlag } from 'hooks/useRemoteConfig' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' import { useRecord, make } from 'store/analytics/actions' import { copyLinkToClipboard } from 'utils/clipboardUtil' diff --git a/packages/web/src/pages/upload-page/store/sagas.js b/packages/web/src/pages/upload-page/store/sagas.js index 9afa771655..681d6b1ac2 100644 --- a/packages/web/src/pages/upload-page/store/sagas.js +++ b/packages/web/src/pages/upload-page/store/sagas.js @@ -34,7 +34,7 @@ import { fetchServicesFailed } from 'components/service-selection/store/slice' import UploadType from 'pages/upload-page/components/uploadType' import { getStems } from 'pages/upload-page/store/selectors' import { updateAndFlattenStems } from 'pages/upload-page/store/utils/stems' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' import { make } from 'store/analytics/actions' import { waitForBackendSetup } from 'store/backend/sagas' diff --git a/packages/web/src/services/audius-api-client/audiusApiClient.ts b/packages/web/src/services/audius-api-client/audiusApiClient.ts new file mode 100644 index 0000000000..571ed4a6ec --- /dev/null +++ b/packages/web/src/services/audius-api-client/audiusApiClient.ts @@ -0,0 +1,9 @@ +import { AudiusAPIClient } from 'common/services/audius-api-client' +import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' +import { remoteConfigInstance } from 'services/remote-config/remote-config-instance' + +export const apiClient = new AudiusAPIClient({ + audiusBackendInstance, + remoteConfigInstance, + audiusLibs: window.audiusLibs +}) diff --git a/packages/web/src/services/audius-api-client/index.ts b/packages/web/src/services/audius-api-client/index.ts new file mode 100644 index 0000000000..d01a621e77 --- /dev/null +++ b/packages/web/src/services/audius-api-client/index.ts @@ -0,0 +1 @@ +export * from './audiusApiClient' diff --git a/packages/web/src/services/audius-backend/Explore.ts b/packages/web/src/services/audius-backend/Explore.ts index 79d81d5f8e..ddf6a373c6 100644 --- a/packages/web/src/services/audius-backend/Explore.ts +++ b/packages/web/src/services/audius-backend/Explore.ts @@ -7,11 +7,11 @@ import { removeNullable } from '@audius/common' +import * as adapter from 'common/services/audius-api-client/ResponseAdapter' +import { APIPlaylist, APITrack } from 'common/services/audius-api-client/types' import { AuthHeaders } from 'common/services/audius-backend' import { encodeHashId } from 'common/utils/hashIds' -import apiClient from 'services/audius-api-client/AudiusAPIClient' -import * as adapter from 'services/audius-api-client/ResponseAdapter' -import { APIPlaylist, APITrack } from 'services/audius-api-client/types' +import { apiClient } from 'services/audius-api-client' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' type CollectionWithScore = APIPlaylist & { score: number } diff --git a/packages/web/src/services/audius-backend/Tipping.ts b/packages/web/src/services/audius-backend/Tipping.ts index 3da2181285..fd2fab3254 100644 --- a/packages/web/src/services/audius-backend/Tipping.ts +++ b/packages/web/src/services/audius-backend/Tipping.ts @@ -1,6 +1,6 @@ import { Supporter, Supporting, UserTip } from '@audius/common' -import { APIUser } from 'services/audius-api-client/types' +import { APIUser } from 'common/services/audius-api-client/types' import { waitForLibsInit } from 'services/audius-backend/eagerLoadUtils' export const TIPPING_SUPPORT_DEFAULT_LIMIT = 25 @@ -14,6 +14,7 @@ export type SupportingResponse = Omit & { export type SupporterResponse = Omit & { sender: APIUser } + export type SupportRequest = { encodedUserId: string limit?: number diff --git a/packages/web/src/services/audius-backend/audius-backend-instance.ts b/packages/web/src/services/audius-backend/audius-backend-instance.ts index 7a1b92e232..1ca960f4fd 100644 --- a/packages/web/src/services/audius-backend/audius-backend-instance.ts +++ b/packages/web/src/services/audius-backend/audius-backend-instance.ts @@ -1,3 +1,5 @@ +import type { AudiusLibs } from '@audius/sdk' + import { audiusBackend } from 'common/services/audius-backend' import { LIBS_INITTED_EVENT, @@ -70,7 +72,7 @@ export const audiusBackendInstance = audiusBackend({ legacyUserNodeUrl: process.env.REACT_APP_LEGACY_USER_NODE, monitoringCallbacks, nativeMobile: process.env.REACT_APP_NATIVE_MOBILE === 'true', - onLibsInit: (libs: any) => { + onLibsInit: (libs: AudiusLibs) => { window.audiusLibs = libs const event = new CustomEvent(LIBS_INITTED_EVENT) window.dispatchEvent(event) diff --git a/packages/web/src/services/audius-backend/fetchCID.ts b/packages/web/src/services/audius-backend/fetchCID.ts index d895540504..0bf6fd08b4 100644 --- a/packages/web/src/services/audius-backend/fetchCID.ts +++ b/packages/web/src/services/audius-backend/fetchCID.ts @@ -1,6 +1,6 @@ import { CID, ID, Nullable } from '@audius/common' -import CIDCache from 'common/store/cache/CIDCache' +import { CIDCache } from 'common/store/cache' import { getErrorMessage } from 'common/utils/error' import { waitForLibsInit } from './eagerLoadUtils' diff --git a/packages/web/src/services/wallet-client/WalletClient.ts b/packages/web/src/services/wallet-client/WalletClient.ts index 1ef4f698a1..413635a0f4 100644 --- a/packages/web/src/services/wallet-client/WalletClient.ts +++ b/packages/web/src/services/wallet-client/WalletClient.ts @@ -2,7 +2,7 @@ import { ID, BNWei, StringWei, WalletAddress } from '@audius/common' import BN from 'bn.js' import { stringWeiToBN } from 'common/utils/wallet' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' // 0.001 Audio diff --git a/packages/web/src/store/backend/sagas.js b/packages/web/src/store/backend/sagas.js index 375d697581..c60926778d 100644 --- a/packages/web/src/store/backend/sagas.js +++ b/packages/web/src/store/backend/sagas.js @@ -12,7 +12,7 @@ import { import * as accountActions from 'common/store/account/reducer' import * as reachabilityActions from 'common/store/reachability/actions' import { getIsReachable } from 'common/store/reachability/selectors' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' import fingerprintClient from 'services/fingerprint/FingerprintClient' import { RequestNetworkConnected } from 'services/native-mobile-interface/lifecycle' diff --git a/packages/web/src/store/confirmer/sagas.ts b/packages/web/src/store/confirmer/sagas.ts index b9b85fc97d..62ad77f86d 100644 --- a/packages/web/src/store/confirmer/sagas.ts +++ b/packages/web/src/store/confirmer/sagas.ts @@ -1,6 +1,6 @@ import { call, delay, put, race, select, takeEvery } from 'redux-saga/effects' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import * as confirmerActions from 'store/confirmer/actions' import { getResult, diff --git a/packages/web/src/store/player/sagas.ts b/packages/web/src/store/player/sagas.ts index 708db9bc29..9093b96f70 100644 --- a/packages/web/src/store/player/sagas.ts +++ b/packages/web/src/store/player/sagas.ts @@ -16,7 +16,7 @@ import { getUser } from 'common/store/cache/users/selectors' import * as queueActions from 'common/store/queue/slice' import { recordListen } from 'common/store/social/tracks/actions' import { encodeHashId } from 'common/utils/hashIds' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' import { remoteConfigInstance } from 'services/remote-config/remote-config-instance' import { diff --git a/packages/web/src/store/recommendation/sagas.ts b/packages/web/src/store/recommendation/sagas.ts index 28ba6dfaeb..d3c7c57cf7 100644 --- a/packages/web/src/store/recommendation/sagas.ts +++ b/packages/web/src/store/recommendation/sagas.ts @@ -2,7 +2,7 @@ import { ID, UserTrack, Nullable } from '@audius/common' import { call } from 'typed-redux-saga' import { processAndCacheTracks } from 'common/store/cache/tracks/utils' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import Explore from 'services/audius-backend/Explore' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' diff --git a/packages/web/src/store/reducers.ts b/packages/web/src/store/reducers.ts index 142dab4a6d..d732df508d 100644 --- a/packages/web/src/store/reducers.ts +++ b/packages/web/src/store/reducers.ts @@ -35,9 +35,7 @@ import dragndrop from 'store/dragndrop/reducer' import player from 'store/player/slice' import playlistLibrary from 'store/playlist-library/slice' -import { webStoreContext } from './storeContext' - -export const commonStoreReducers = clientStoreReducers(webStoreContext) +export const commonStoreReducers = clientStoreReducers() const createRootReducer = (routeHistory: History) => combineReducers({ diff --git a/packages/web/src/store/tipping/sagas.ts b/packages/web/src/store/tipping/sagas.ts index 50de7b8058..15073c19bc 100644 --- a/packages/web/src/store/tipping/sagas.ts +++ b/packages/web/src/store/tipping/sagas.ts @@ -60,7 +60,7 @@ import { weiToAudioString, weiToString } from 'common/utils/wallet' -import AudiusAPIClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { fetchRecentUserTips, fetchSupporters, @@ -694,14 +694,11 @@ function* fetchUserSupporterAsync( ) { const { currentUserId, userId, supporterUserId } = action.payload try { - const response = yield* call( - [AudiusAPIClient, AudiusAPIClient.getUserSupporter], - { - currentUserId, - userId, - supporterUserId - } - ) + const response = yield* call([apiClient, apiClient.getUserSupporter], { + currentUserId, + userId, + supporterUserId + }) if (response) { const supportingMap = yield* select(getSupporting) yield put( diff --git a/packages/web/src/store/token-dashboard/sagas.ts b/packages/web/src/store/token-dashboard/sagas.ts index 91a40c8717..1133317c89 100644 --- a/packages/web/src/store/token-dashboard/sagas.ts +++ b/packages/web/src/store/token-dashboard/sagas.ts @@ -61,7 +61,7 @@ import { fetchOpenSeaAssetsForWallets, fetchSolanaCollectiblesForWallets } from 'pages/profile-page/sagas' -import apiClient from 'services/audius-api-client/AudiusAPIClient' +import { apiClient } from 'services/audius-api-client' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' import { remoteConfigInstance } from 'services/remote-config/remote-config-instance' import walletClient from 'services/wallet-client/WalletClient'