diff --git a/package-lock.json b/package-lock.json index 0d8fcee8..2296d6d7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,11 +37,12 @@ "glob": "^7.1.2", "google-protobuf": "^3.21.2", "handlebars": "^4.7.7", - "handlebars-helpers": "^0.9.8", + "handlebars-helpers": "^0.10.0", "http-errors": "^2.0.0", "json-stable-stringify": "^1.0.1", "jsonic": "^1.0.1", "logfmt": "^1.3.2", + "micromatch": "^4.0.8", "node-gzip": "^1.1.2", "pako": "^2.1.0", "patch-package": "^6.4.7", @@ -6438,41 +6439,41 @@ } }, "node_modules/handlebars-helpers": { - "version": "0.9.8", - "resolved": "https://registry.npmjs.org/handlebars-helpers/-/handlebars-helpers-0.9.8.tgz", - "integrity": "sha512-N9MoNopXTOzNv9L2oDFUo1ZhWTzUd8YURVrksZaXVRybgs1JFnUXohCnFTOJL8m4t+jKn1xU6Vi7qxtCu4mRsg==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/handlebars-helpers/-/handlebars-helpers-0.10.0.tgz", + "integrity": "sha512-QiyhQz58u/DbuV41VnfpE0nhy6YCH4vB514ajysV8SoKmP+DxU+pR+fahVyNECHj+jiwEN2VrvxD/34/yHaLUg==", "dependencies": { - "arr-flatten": "^1.0.3", - "array-sort": "^0.1.2", + "arr-flatten": "^1.1.0", + "array-sort": "^0.1.4", "create-frame": "^1.0.0", "define-property": "^1.0.0", - "falsey": "^0.3.0", + "falsey": "^0.3.2", "for-in": "^1.0.2", "for-own": "^1.0.0", "get-object": "^0.2.0", "get-value": "^2.0.6", - "handlebars": "^4.0.10", + "handlebars": "^4.0.11", "handlebars-helper-create-frame": "^0.1.0", - "handlebars-utils": "^1.0.1", + "handlebars-utils": "^1.0.6", "has-value": "^1.0.0", - "helper-date": "^1.0.0", - "helper-markdown": "^0.2.2", + "helper-date": "^1.0.1", + "helper-markdown": "^1.0.0", "helper-md": "^0.2.2", - "html-tag": "^1.0.0", + "html-tag": "^2.0.0", "is-even": "^1.0.0", - "is-glob": "^3.1.0", - "is-number": "^3.0.0", - "kind-of": "^5.0.0", + "is-glob": "^4.0.0", + "is-number": "^4.0.0", + "kind-of": "^6.0.0", "lazy-cache": "^2.0.2", "logging-helpers": "^1.0.0", - "micromatch": "^3.0.3", + "micromatch": "^3.1.4", "relative": "^3.0.2", - "striptags": "^3.0.1", + "striptags": "^3.1.0", "to-gfm-code-block": "^0.1.1", "year": "^0.2.1" }, "engines": { - "node": ">=5" + "node": ">=0.12.0" } }, "node_modules/handlebars-helpers/node_modules/braces": { @@ -6520,6 +6521,28 @@ "node": ">=0.10.0" } }, + "node_modules/handlebars-helpers/node_modules/fill-range/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/handlebars-helpers/node_modules/fill-range/node_modules/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==", + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/handlebars-helpers/node_modules/is-descriptor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.3.tgz", @@ -6543,13 +6566,10 @@ "node": ">=0.10.0" } }, - "node_modules/handlebars-helpers/node_modules/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==", - "dependencies": { - "is-extglob": "^2.1.0" - }, + "node_modules/handlebars-helpers/node_modules/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==", "engines": { "node": ">=0.10.0" } @@ -6562,6 +6582,14 @@ "node": ">=0.10.0" } }, + "node_modules/handlebars-helpers/node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/handlebars-helpers/node_modules/micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", @@ -6609,14 +6637,6 @@ "node": ">=0.10.0" } }, - "node_modules/handlebars-helpers/node_modules/micromatch/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/handlebars-helpers/node_modules/to-regex-range": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", @@ -6629,6 +6649,28 @@ "node": ">=0.10.0" } }, + "node_modules/handlebars-helpers/node_modules/to-regex-range/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/handlebars-helpers/node_modules/to-regex-range/node_modules/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==", + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/handlebars-utils": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/handlebars-utils/-/handlebars-utils-1.0.6.tgz", @@ -6827,13 +6869,13 @@ } }, "node_modules/helper-markdown": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/helper-markdown/-/helper-markdown-0.2.2.tgz", - "integrity": "sha512-VLbwB3RMq3fJ3H1IcYRa18gd300WS/1rNJVmjc61fuBEK46RcqeqN1vOLRm1ZabBE/o3EdCrUFjKkekB/pBJyQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/helper-markdown/-/helper-markdown-1.0.0.tgz", + "integrity": "sha512-AnDqMS4ejkQK0MXze7pA9TM3pu01ZY+XXsES6gEE0RmCGk5/NIfvTn0NmItfyDOjRAzyo9z6X7YHbHX4PzIvOA==", "dependencies": { - "isobject": "^2.0.0", - "mixin-deep": "^1.1.3", - "remarkable": "^1.6.0" + "handlebars-utils": "^1.0.2", + "highlight.js": "^9.12.0", + "remarkable": "^1.7.1" }, "engines": { "node": ">=0.10.0" @@ -6853,6 +6895,16 @@ "node": ">=0.10.0" } }, + "node_modules/highlight.js": { + "version": "9.18.5", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.18.5.tgz", + "integrity": "sha512-a5bFyofd/BHCX52/8i8uJkjr9DYwXIPnM/plwI6W7ezItLGqzt7X2G2nXuYSfsIJdkwwj/g9DG1LkcGJI/dDoA==", + "deprecated": "Support has ended for 9.x series. Upgrade to @latest", + "hasInstallScript": true, + "engines": { + "node": "*" + } + }, "node_modules/homedir-polyfill": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", @@ -6886,21 +6938,21 @@ "dev": true }, "node_modules/html-tag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/html-tag/-/html-tag-1.0.0.tgz", - "integrity": "sha512-SXjQ8wG7dh1fIxT/lhj+nKcc2R0rEmMGjvw2Bh46IkijhEaVdEteqYGBFZiICXkUra3PHLy+4zoXwDhh0l55SQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/html-tag/-/html-tag-2.0.0.tgz", + "integrity": "sha512-XxzooSo6oBoxBEUazgjdXj7VwTn/iSTSZzTYKzYY6I916tkaYzypHxy+pbVU1h+0UQ9JlVf5XkNQyxOAiiQO1g==", "dependencies": { - "isobject": "^3.0.0", - "void-elements": "^2.0.1" + "is-self-closing": "^1.0.1", + "kind-of": "^6.0.0" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/html-tag/node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "node_modules/html-tag/node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "engines": { "node": ">=0.10.0" } @@ -7431,6 +7483,17 @@ "node": ">=0.10.0" } }, + "node_modules/is-self-closing": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-self-closing/-/is-self-closing-1.0.1.tgz", + "integrity": "sha512-E+60FomW7Blv5GXTlYee2KDrnG6srxF7Xt1SjrhWUGUEsTFIqY/nq2y3DaftCsgUMdh89V07IVfhY9KIJhLezg==", + "dependencies": { + "self-closing-tags": "^1.0.1" + }, + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/is-shared-array-buffer": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", @@ -10944,6 +11007,14 @@ "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz", "integrity": "sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==" }, + "node_modules/self-closing-tags": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/self-closing-tags/-/self-closing-tags-1.0.1.tgz", + "integrity": "sha512-7t6hNbYMxM+VHXTgJmxwgZgLGktuXtVVD5AivWzNTdJBM4DBjnDKDzkf2SrNjihaArpeJYNjxkELBu1evI4lQA==", + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", @@ -12650,14 +12721,6 @@ "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==" }, - "node_modules/void-elements": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", - "integrity": "sha512-qZKX4RnBzH2ugr8Lxa7x+0V6XD9Sb/ouARtiasEQCHB1EVU4NXtmHsDDrx1dO4ne5fc3J6EW05BP1Dl0z0iung==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/walker": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", diff --git a/package.json b/package.json index 1cf69e3a..da3106a9 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,8 @@ "fastify-plugin": "^4.5.1", "glob": "^7.1.2", "handlebars": "^4.7.7", - "handlebars-helpers": "^0.9.8", + "handlebars-helpers": "^0.10.0", + "micromatch": "^4.0.8", "http-errors": "^2.0.0", "json-stable-stringify": "^1.0.1", "jsonic": "^1.0.1", diff --git a/qryn_node.js b/qryn_node.js index 38e48349..01c8e71b 100755 --- a/qryn_node.js +++ b/qryn_node.js @@ -124,35 +124,7 @@ let fastify = require('fastify')({ done() })) await fastify.register(require('@fastify/compress'), { - encodings: ['gzip'], - zlib: { - createGzip: () => { - const deflator = new pako.Deflate({ gzip: true }) - let lastChunk = null - const res = new Duplex({ - write: (chunk, encoding, next) => { - lastChunk && deflator.push(lastChunk) - lastChunk = chunk - next() - }, - read: function (size) { - }, - final (callback) { - deflator.onEnd = async () => { - res.push(null) - callback(null) - } - !lastChunk && callback() - lastChunk && deflator.push(lastChunk, true) - }, - emitClose: true - }) - deflator.onData = (chunk) => { - res.push(chunk) - } - return res - } - } + encodings: ['gzip'] }) await fastify.register(require('@fastify/url-data')) await fastify.register(require('@fastify/websocket'))