diff --git a/package.json b/package.json index f2df68c..6f1296e 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "@weavery/clarity": "^0.1.5", "arweave": "^1.10.16", "arweave-multihost": "^0.1.0", + "axios": "^0.21.4", "bignumber.js": "^9.0.1", "bson": "^4.5.0", "json-beautify": "^1.1.1", @@ -68,6 +69,7 @@ "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^3.4.1", + "express": "^4.17.1", "jest": "^27.1.0", "prettier": "^2.3.2", "rimraf": "^3.0.2", diff --git a/src/cache/impl/MemBlockHeightCache.ts b/src/cache/impl/MemBlockHeightCache.ts index 45e106e..cc272f9 100644 --- a/src/cache/impl/MemBlockHeightCache.ts +++ b/src/cache/impl/MemBlockHeightCache.ts @@ -7,6 +7,8 @@ import { deepCopy } from '@smartweave/utils'; export class MemBlockHeightSwCache implements BlockHeightSwCache { private storage: { [key: string]: Map } = {}; + constructor(private maxStoredBlockHeights: number = Number.MAX_SAFE_INTEGER) {} + async getLast(key: string): Promise | null> { if (!(await this.contains(key))) { return null; @@ -39,17 +41,25 @@ export class MemBlockHeightSwCache implements BlockHeightSwCache { return cachedBlockHeight <= blockHeight; }); - return { - cachedHeight: highestBlockHeight, - cachedValue: deepCopy(cached.get(highestBlockHeight)) - }; + return highestBlockHeight === undefined + ? null + : { + cachedHeight: highestBlockHeight, + cachedValue: deepCopy(cached.get(highestBlockHeight)) + }; } async put({ cacheKey, blockHeight }: BlockHeightKey, value: V): Promise { if (!(await this.contains(cacheKey))) { this.storage[cacheKey] = new Map(); } - this.storage[cacheKey].set(blockHeight, deepCopy(value)); + const cached = this.storage[cacheKey]; + if (cached.size == this.maxStoredBlockHeights) { + const toRemove = [...cached.keys()].sort().shift(); + cached.delete(toRemove); + } + + cached.set(blockHeight, deepCopy(value)); } async contains(key: string): Promise { diff --git a/src/cache/impl/RemoteBlockHeightCache.ts b/src/cache/impl/RemoteBlockHeightCache.ts new file mode 100644 index 0000000..aacddd7 --- /dev/null +++ b/src/cache/impl/RemoteBlockHeightCache.ts @@ -0,0 +1,63 @@ +import { BlockHeightCacheResult, BlockHeightKey, BlockHeightSwCache } from '@smartweave/cache'; +import axios, { AxiosInstance } from 'axios'; + +/** + * A {@link BlockHeightSwCache} implementation that delegates all its methods + * to remote endpoints. + */ +export class RemoteBlockHeightCache implements BlockHeightSwCache { + private axios: AxiosInstance; + + /** + * @param type - id/type of the cache, that will allow to identify + * it server side (e.g. "STATE" or "INTERACTIONS") + * @param baseURL - the base url of the remote endpoint that serves + * cache data (e.g. "http://localhost:3000") + */ + constructor(private type: string, private baseURL: string) { + this.axios = axios.create({ + baseURL: baseURL + }); + } + + /** + * GET '/last/:type/:key + */ + async getLast(key: string): Promise | null> { + const response = await this.axios.get | null>(`/last/${this.type}/${key}`); + return response.data; + } + + /** + * GET '/less-or-equal/:type/:key/:blockHeight + */ + async getLessOrEqual(key: string, blockHeight: number): Promise | null> { + const response = await this.axios.get | null>( + `/less-or-equal/${this.type}/${key}/${blockHeight}` + ); + return response.data; + } + + /** + * PUT '/:type/:key/:blockHeight' {data: value} + */ + async put({ cacheKey, blockHeight }: BlockHeightKey, value: V): Promise { + await this.axios.put(`/${this.type}/${cacheKey}/${blockHeight}`, value); + } + + /** + * GET '/contains/:type/:key' + */ + async contains(key: string): Promise { + const response = await this.axios.get(`/contains/${this.type}/${key}`); + return response.data; + } + + /** + * GET '/:type/:key/:blockHeight' + */ + async get(key: string, blockHeight: number): Promise | null> { + const response = await this.axios.get | null>(`/${this.type}/${key}/${blockHeight}`); + return response.data; + } +} diff --git a/src/cache/index.ts b/src/cache/index.ts index 10cb06c..7078c30 100644 --- a/src/cache/index.ts +++ b/src/cache/index.ts @@ -1,5 +1,6 @@ export * from './impl/BsonFileBlockHeightCache'; export * from './impl/MemBlockHeightCache'; +export * from './impl/RemoteBlockHeightCache'; export * from './impl/MemCache'; export * from './BlockHeightSwCache'; diff --git a/src/core/modules/impl/ContractInteractionsLoader.ts b/src/core/modules/impl/ContractInteractionsLoader.ts index 89701cd..fdc6db1 100644 --- a/src/core/modules/impl/ContractInteractionsLoader.ts +++ b/src/core/modules/impl/ContractInteractionsLoader.ts @@ -77,6 +77,7 @@ export class ContractInteractionsLoader implements InteractionsLoader { } ], blockFilter: { + min: fromBlockHeight, max: toBlockHeight }, first: MAX_REQUEST diff --git a/src/core/web/SmartWeaveWebFactory.ts b/src/core/web/SmartWeaveWebFactory.ts index b152678..1260be1 100644 --- a/src/core/web/SmartWeaveWebFactory.ts +++ b/src/core/web/SmartWeaveWebFactory.ts @@ -15,7 +15,7 @@ import { SmartWeave, SmartWeaveBuilder } from '@smartweave/core'; -import { MemBlockHeightSwCache, MemCache } from '@smartweave/cache'; +import { MemBlockHeightSwCache, MemCache, RemoteBlockHeightCache } from '@smartweave/cache'; /** * A factory that simplifies the process of creating different versions of {@link SmartWeave}. @@ -23,6 +23,44 @@ import { MemBlockHeightSwCache, MemCache } from '@smartweave/cache'; * SmartWeave instances created by this factory can be safely used in a web environment. */ export class SmartWeaveWebFactory { + /** + * Returns a fully configured {@link SmartWeave} that is using remote cache for all layers. + * See {@link RemoteBlockHeightCache} for details. + */ + static remoteCached(arweave: Arweave, cacheBaseURL: string): SmartWeave { + return this.remoteCacheBased(arweave, cacheBaseURL).build(); + } + + /** + * Returns a preconfigured, remoteCached {@link SmartWeaveBuilder}, that allows for customization of the SmartWeave instance. + * Use {@link SmartWeaveBuilder.build()} to finish the configuration. + */ + static remoteCacheBased(arweave: Arweave, cacheBaseURL: string): SmartWeaveBuilder { + const definitionLoader = new ContractDefinitionLoader(arweave, new MemCache()); + + const interactionsLoader = new CacheableContractInteractionsLoader( + new ContractInteractionsLoader(arweave), + new RemoteBlockHeightCache('INTERACTIONS', cacheBaseURL) + ); + + const executorFactory = new CacheableExecutorFactory(arweave, new HandlerExecutorFactory(arweave), new MemCache()); + + const stateEvaluator = new CacheableStateEvaluator( + arweave, + new RemoteBlockHeightCache>('STATE', cacheBaseURL), + [new Evolve(definitionLoader, executorFactory)] + ); + + const interactionsSorter = new LexicographicalInteractionsSorter(arweave); + + return SmartWeave.builder(arweave) + .setDefinitionLoader(definitionLoader) + .setInteractionsLoader(interactionsLoader) + .setInteractionsSorter(interactionsSorter) + .setExecutorFactory(executorFactory) + .setStateEvaluator(stateEvaluator); + } + /** * Returns a fully configured {@link SmartWeave} that is using mem cache for all layers. */ diff --git a/tools/remote-cache-test.ts b/tools/remote-cache-test.ts new file mode 100644 index 0000000..c4f9157 --- /dev/null +++ b/tools/remote-cache-test.ts @@ -0,0 +1,32 @@ +/* eslint-disable */ +import { RemoteBlockHeightCache } from '../src/cache/impl/RemoteBlockHeightCache'; + +async function main() { + const cache = new RemoteBlockHeightCache( + "STATE", "http://localhost:3000" + ); + + const get = await cache.get('txId', 557); + console.log('get result:', get); + + const getLessOrEqual = await cache.getLessOrEqual('txId', 600); + console.log('getLessOrEqual result:', getLessOrEqual); + + const contains = await cache.contains('txId'); + console.log('contains result:', contains); + + const getLast = await cache.getLast('txId'); + console.log('getLast result:', getLast); + + await cache.put({cacheKey: 'txId', blockHeight: 558}, { + "value": "toBeCached" + }); + + const getLastAfterPut = await cache.getLast('txId'); + console.log('getLastAfterPut result:', getLastAfterPut); +} + + +main().catch((e) => { + console.log(e); +}); diff --git a/tools/server.js b/tools/server.js new file mode 100644 index 0000000..1bfa1cf --- /dev/null +++ b/tools/server.js @@ -0,0 +1,101 @@ +const express = require('express'); +const { MemBlockHeightSwCache } = require('../lib/cjs/cache/impl/MemBlockHeightCache'); +const app = express(); +const port = 3000; + +console.log(MemBlockHeightSwCache); + +app.use(express.json()); + +const caches = { + STATE: new MemBlockHeightSwCache(1), + INTERACTIONS: new MemBlockHeightSwCache(1) +}; + +// getLast +app.get('/last/:type/:key', async function (req, res, next) { + console.log('last:', { + url: req.url, + params: req.params + }); + const { type, key } = req.params; + + const result = await caches[type].getLast(key); + + res.send(result); +}); + +// getLessOrEqual +app.get('/less-or-equal/:type/:key/:blockHeight', async function (req, res, next) { + console.log('less-or-equal:', { + url: req.url, + params: req.params + }); + + const { type, key } = req.params; + const blockHeight = parseInt(req.params.blockHeight); + + const result = await caches[type].getLessOrEqual(key, blockHeight); + console.log(result); + + res.send(result); +}); + +// contains +app.get('/contains/:type/:key', async function (req, res, next) { + console.log('contains:', { + url: req.url, + params: req.params + }); + + const { type, key } = req.params; + + res.send(await caches[type].contains(key)); +}); + +// get +app.get('/:type/:key/:blockHeight', async function (req, res, next) { + console.log('get:', { + url: req.url, + params: req.params + }); + + const { type, key } = req.params; + const blockHeight = parseInt(req.params.blockHeight); + + const result = await caches[type].get(key, blockHeight); + console.log('get', result); + + res.send(result); +}); + +// put +app.put('/:type/:key/:blockHeight', async function (req, res, next) { + console.log('put:', { + url: req.url, + params: req.params, + body: req.body + }); + + const { type, key } = req.params; + const blockHeight = parseInt(req.params.blockHeight); + + await caches[type].put({ cacheKey: key, blockHeight }, req.body); + + res.send(null); +}); + +app.listen(port, async () => { + console.log(`Cache listening at http://localhost:${port}`); + + // note: with current cache configuration (new MemBlockHeightSwCache(1)) + // there should be at most one block height cached for given cache key. + await caches['STATE'].put({ cacheKey: 'txId', blockHeight: 555 }, { foo: "bar555" }); + await caches['STATE'].put({ cacheKey: 'txId', blockHeight: 556 }, { foo: "bar556" }); + await caches['STATE'].put({ cacheKey: 'txId', blockHeight: 557 }, { foo: "bar557" }); + + await caches['INTERACTIONS'].put({ cacheKey: 'txId', blockHeight: 557 }, [{ foo: "bar557" }]); + await caches['INTERACTIONS'].put({ cacheKey: 'txId', blockHeight: 600 }, [{ bar: "foo600" }]); + + console.log('Caches filled'); +}); diff --git a/tsconfig.json b/tsconfig.json index 403b935..d3de066 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -28,6 +28,7 @@ "include": ["src"], "exclude": [ "node_modules", + "tools", "**/__tests__/*", "_scripts" ] diff --git a/yarn.lock b/yarn.lock index 8ad7d19..fa16a02 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1131,7 +1131,7 @@ abbrev@1: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -accepts@^1.3.5: +accepts@^1.3.5, accepts@~1.3.7: version "1.3.7" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== @@ -1490,6 +1490,11 @@ arlocal@^1.0.34: sqlite3 "^5.0.2" tsc-watch "^4.4.0" +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= + array-timsort@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/array-timsort/-/array-timsort-1.0.3.tgz#3c9e4199e54fb2b9c3fe5976396a21614ef0d926" @@ -1598,7 +1603,7 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== -axios@^0.21.1: +axios@^0.21.1, axios@^0.21.4: version "0.21.4" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== @@ -1729,6 +1734,22 @@ bn.js@^4.0.0: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== +body-parser@1.19.0: + version "1.19.0" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" + integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== + dependencies: + bytes "3.1.0" + content-type "~1.0.4" + debug "2.6.9" + depd "~1.1.2" + http-errors "1.7.2" + iconv-lite "0.4.24" + on-finished "~2.3.0" + qs "6.7.0" + raw-body "2.4.0" + type-is "~1.6.17" + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -2078,14 +2099,14 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0: resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= -content-disposition@~0.5.2: +content-disposition@0.5.3, content-disposition@~0.5.2: version "0.5.3" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== dependencies: safe-buffer "5.1.2" -content-type@^1.0.4: +content-type@^1.0.4, content-type@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== @@ -2097,6 +2118,16 @@ convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: dependencies: safe-buffer "~5.1.1" +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= + +cookie@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" + integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== + cookies@~0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/cookies/-/cookies-0.8.0.tgz#1293ce4b391740a8406e3c9870e828c4b54f3f90" @@ -2192,6 +2223,13 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" +debug@2.6.9, debug@^2.1.1: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + debug@4, debug@4.3.2, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: version "4.3.2" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" @@ -2199,13 +2237,6 @@ debug@4, debug@4.3.2, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: dependencies: ms "2.1.2" -debug@^2.1.1: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - debug@^3.2.6: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" @@ -2289,7 +2320,7 @@ deprecated-decorator@^0.1.6: resolved "https://registry.yarnpkg.com/deprecated-decorator/-/deprecated-decorator-0.1.6.tgz#00966317b7a12fe92f3cc831f7583af329b86c37" integrity sha1-AJZjF7ehL+kvPMgx91g68ym4bDc= -destroy@^1.0.4: +destroy@^1.0.4, destroy@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= @@ -2380,7 +2411,7 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -encodeurl@^1.0.2: +encodeurl@^1.0.2, encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= @@ -2482,7 +2513,7 @@ escalade@^3.1.1: resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== -escape-html@^1.0.3: +escape-html@^1.0.3, escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= @@ -2652,6 +2683,11 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== +etag@~1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" + integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= + event-emitter@~0.3.4: version "0.3.5" resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" @@ -2722,6 +2758,42 @@ exponential-backoff@^3.1.0: resolved "https://registry.yarnpkg.com/exponential-backoff/-/exponential-backoff-3.1.0.tgz#9409c7e579131f8bd4b32d7d8094a911040f2e68" integrity sha512-oBuz5SYz5zzyuHINoe9ooePwSu0xApKWgeNzok4hZ5YKXFh9zrQBEM15CXqoZkJJPuI2ArvqjPQd8UKJA753XA== +express@^4.17.1: + version "4.17.1" + resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" + integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== + dependencies: + accepts "~1.3.7" + array-flatten "1.1.1" + body-parser "1.19.0" + content-disposition "0.5.3" + content-type "~1.0.4" + cookie "0.4.0" + cookie-signature "1.0.6" + debug "2.6.9" + depd "~1.1.2" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + finalhandler "~1.1.2" + fresh "0.5.2" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "~2.3.0" + parseurl "~1.3.3" + path-to-regexp "0.1.7" + proxy-addr "~2.0.5" + qs "6.7.0" + range-parser "~1.2.1" + safe-buffer "5.1.2" + send "0.17.1" + serve-static "1.14.1" + setprototypeof "1.1.1" + statuses "~1.5.0" + type-is "~1.6.18" + utils-merge "1.0.1" + vary "~1.1.2" + ext@^1.1.2: version "1.5.0" resolved "https://registry.yarnpkg.com/ext/-/ext-1.5.0.tgz#e93b97ae0cb23f8370380f6107d2d2b7887687ad" @@ -2824,6 +2896,19 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" +finalhandler@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" + integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== + dependencies: + debug "2.6.9" + encodeurl "~1.0.2" + escape-html "~1.0.3" + on-finished "~2.3.0" + parseurl "~1.3.3" + statuses "~1.5.0" + unpipe "~1.0.0" + find-node-modules@^2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/find-node-modules/-/find-node-modules-2.1.2.tgz#57565a3455baf671b835bc6b2134a9b938b9c53c" @@ -2903,7 +2988,12 @@ formidable@^1.1.1: resolved "https://registry.yarnpkg.com/formidable/-/formidable-1.2.2.tgz#bf69aea2972982675f00865342b982986f6b8dd9" integrity sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q== -fresh@~0.5.2: +forwarded@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" + integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== + +fresh@0.5.2, fresh@~0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= @@ -3201,7 +3291,18 @@ http-assert@^1.3.0: deep-equal "~1.0.1" http-errors "~1.8.0" -http-errors@1.7.3: +http-errors@1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" + integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +http-errors@1.7.3, http-errors@~1.7.2: version "1.7.3" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== @@ -3327,6 +3428,11 @@ inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, i resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== +inherits@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + ini@^1.3.4, ini@~1.3.0: version "1.3.8" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" @@ -3366,6 +3472,11 @@ interpret@^2.2.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== +ipaddr.js@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" + integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== + is-bigint@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" @@ -4364,6 +4475,11 @@ memoizee@0.3.x: next-tick "~0.2.2" timers-ext "0.1" +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= + merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" @@ -4379,7 +4495,7 @@ merge@^2.1.0: resolved "https://registry.yarnpkg.com/merge/-/merge-2.1.1.tgz#59ef4bf7e0b3e879186436e8481c06a6c162ca98" integrity sha512-jz+Cfrg9GWOZbQAnDQ4hlVnQky+341Yk5ru8bZSe6sIDTCIg8n9i/u7hSQGSVOF3C7lH6mGtqjkiT9G4wFLL0w== -methods@^1.1.2: +methods@^1.1.2, methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= @@ -4404,6 +4520,11 @@ mime-types@^2.1.12, mime-types@^2.1.18, mime-types@~2.1.19, mime-types@~2.1.24: dependencies: mime-db "1.49.0" +mime@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== + mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" @@ -4458,6 +4579,11 @@ ms@2.0.0: resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= +ms@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" @@ -4700,7 +4826,7 @@ object.getownpropertydescriptors@^2.1.1: define-properties "^1.1.3" es-abstract "^1.18.0-next.2" -on-finished@^2.3.0: +on-finished@^2.3.0, on-finished@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= @@ -4824,7 +4950,7 @@ parse5@6.0.1: resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== -parseurl@^1.3.2: +parseurl@^1.3.2, parseurl@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== @@ -4854,6 +4980,11 @@ path-parse@^1.0.6: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= + path-to-regexp@^6.1.0: version "6.2.0" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.2.0.tgz#f7b3803336104c346889adece614669230645f38" @@ -4955,6 +5086,14 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" +proxy-addr@~2.0.5: + version "2.0.7" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" + integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== + dependencies: + forwarded "0.2.0" + ipaddr.js "1.9.1" + ps-tree@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.2.0.tgz#5e7425b89508736cdd4f2224d028f7bb3f722ebd" @@ -4972,6 +5111,11 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== +qs@6.7.0: + version "6.7.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" + integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== + qs@^6.4.0, qs@^6.5.2: version "6.10.1" resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.1.tgz#4931482fa8d647a5aab799c5271d2133b981fb6a" @@ -4996,6 +5140,21 @@ randy@~1.5.1: dependencies: prng-well1024a "~1.0.0" +range-parser@~1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" + integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== + +raw-body@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" + integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== + dependencies: + bytes "3.1.0" + http-errors "1.7.2" + iconv-lite "0.4.24" + unpipe "1.0.0" + raw-body@^2.2.0, raw-body@^2.3.3: version "2.4.1" resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.1.tgz#30ac82f98bb5ae8c152e67149dac8d55153b168c" @@ -5248,6 +5407,25 @@ semver@~5.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" integrity sha1-myzl094C0XxgEq0yaqa00M9U+U8= +send@0.17.1: + version "0.17.1" + resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" + integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== + dependencies: + debug "2.6.9" + depd "~1.1.2" + destroy "~1.0.4" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "~1.7.2" + mime "1.6.0" + ms "2.1.1" + on-finished "~2.3.0" + range-parser "~1.2.1" + statuses "~1.5.0" + sentencer@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/sentencer/-/sentencer-0.2.1.tgz#88a1f4767c14bb8cd148b07822e13b8b55897956" @@ -5258,6 +5436,16 @@ sentencer@^0.2.1: natural "~0.1.28" randy "~1.5.1" +serve-static@1.14.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" + integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== + dependencies: + encodeurl "~1.0.2" + escape-html "~1.0.3" + parseurl "~1.3.3" + send "0.17.1" + set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -5412,7 +5600,7 @@ stack-utils@^2.0.3: dependencies: escape-string-regexp "^2.0.0" -"statuses@>= 1.5.0 < 2", statuses@^1.5.0: +"statuses@>= 1.5.0 < 2", statuses@^1.5.0, statuses@~1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= @@ -5928,7 +6116,7 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -type-is@^1.6.14, type-is@^1.6.16: +type-is@^1.6.14, type-is@^1.6.16, type-is@~1.6.17, type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== @@ -5978,7 +6166,7 @@ universalify@^0.1.2: resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== -unpipe@1.0.0: +unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= @@ -6006,6 +6194,11 @@ util.promisify@^1.0.0: has-symbols "^1.0.1" object.getownpropertydescriptors "^2.1.1" +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= + uuid@^3.1.0, uuid@^3.3.2: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" @@ -6030,7 +6223,7 @@ v8-to-istanbul@^8.0.0: convert-source-map "^1.6.0" source-map "^0.7.3" -vary@^1.1.2: +vary@^1.1.2, vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=