From ae340dc54379a773868b99fa27296f41631b7f3d Mon Sep 17 00:00:00 2001 From: Richard Rodger Date: Mon, 10 Jun 2024 20:55:00 +0100 Subject: [PATCH] v2.5.0 --- package-lock.json | 117 +++++++---------- package.json | 15 ++- test/coverage.html | 315 +++++++++++++++++++++++---------------------- 3 files changed, 213 insertions(+), 234 deletions(-) diff --git a/package-lock.json b/package-lock.json index dcfba4c..24c8a6d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@seneca/s3-store", - "version": "2.3.0", + "version": "2.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@seneca/s3-store", - "version": "2.3.0", + "version": "2.4.0", "license": "MIT", "dependencies": { "chokidar": "^3.6.0" @@ -16,11 +16,11 @@ "@aws-sdk/s3-request-presigner": "^3.468.0", "@hapi/code": "^9.0.3", "@hapi/lab": "^25.2.0", - "@seneca/doc": "^7.2.0", - "@types/node": "20.12.7", + "@seneca/doc": "^8.0.0", + "@types/node": "20.14.2", "coveralls": "^3.1.1", "lab-transform-typescript": "^3.0.1", - "prettier": "^3.2.5", + "prettier": "^3.3.1", "s3rver": "^3.7.1", "seneca-store-test": "^5.2.0", "typescript": "^5.4.5" @@ -29,7 +29,7 @@ "@aws-sdk/client-s3": ">=3", "@aws-sdk/s3-request-presigner": ">=3", "seneca": ">=3", - "seneca-entity": ">=25", + "seneca-entity": ">=26", "seneca-promisify": ">=3" } }, @@ -1722,13 +1722,13 @@ } }, "node_modules/@seneca/doc": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@seneca/doc/-/doc-7.2.0.tgz", - "integrity": "sha512-bNf3RYc307L8PTUdwsOvjc6PZFStQ/SxntsV2C5pdQ/EcUWEyGlwLiTtMpzjPbLyDO8kg0/DgBikXsBk78yXrA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@seneca/doc/-/doc-8.0.0.tgz", + "integrity": "sha512-STHaRARS+bOJV7h1qvn/sEJetIDK79ktx7eHkvt7EEF0emcxc0XO4rqfs4Q/J7N8SP3Jln3hUWUugn4H9sdBNQ==", "dev": true, "dependencies": { "@hapi/joi": "^17.1.1", - "seneca": "^3.34.1", + "seneca": "^3.36.0", "seneca-promisify": "^3.7.1" }, "bin": { @@ -2423,9 +2423,9 @@ } }, "node_modules/@types/node": { - "version": "20.12.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", - "integrity": "sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==", + "version": "20.14.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", + "integrity": "sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -3989,9 +3989,9 @@ "dev": true }, "node_modules/gubu": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/gubu/-/gubu-7.0.0.tgz", - "integrity": "sha512-rweqG/nL/wKd1QTN6e8jwsQ6S1aoXPMF3KPeWCNEmSC2emNKvVuUbvU7B+1tAm7x8/4EiLjakUm3+lAEkqD7Nw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/gubu/-/gubu-7.1.0.tgz", + "integrity": "sha512-0wWSbGqQ4TEVsc40OqH/ZwsJrp16I5jYQ96Pycui1gwDC+htmwfwmoV9k9tIZ+Mmg9DDkeetWybCLY7gpxxeRQ==", "engines": { "node": ">=14" } @@ -4632,26 +4632,6 @@ "resolved": "https://registry.npmjs.org/lodash.foreach/-/lodash.foreach-4.5.0.tgz", "integrity": "sha512-aEXTF4d+m05rVOAUG3z4vZZ4xVexLKZGF0lIxuHZ1Hplpk/3B6Z1+/ICICYRLm7c41Z2xiejbkCkJoTlypoXhQ==" }, - "node_modules/lodash.isarguments": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==" - }, - "node_modules/lodash.isdate": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isdate/-/lodash.isdate-4.0.1.tgz", - "integrity": "sha512-hg5B1GD+R9egsBgMwmAhk+V53Us03TVvXT4dnyKugEfsD4QKuG9Wlyvxq8OGy2nu7qVGsh4DRSnMk33hoWBq/Q==" - }, - "node_modules/lodash.isnan": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/lodash.isnan/-/lodash.isnan-3.0.2.tgz", - "integrity": "sha512-zduioV6njyRsie8qtuS85u7B8xJWi3HjUc1klVoRdeghA5prG13xbUNNcCJ1Cxwa4FyjJVnkL5hDopCVh2ng4g==" - }, - "node_modules/lodash.isregexp": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isregexp/-/lodash.isregexp-4.0.1.tgz", - "integrity": "sha512-rw9+95tYcUa9nQ1FgdtKvO+hReLGNqnNMHfLq8SwK5Mo6D0R0tIsnRHGHaTHSKeYBaLCJ1JvXWdz4UmpPZ2bag==" - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -4864,18 +4844,6 @@ "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", "dev": true }, - "node_modules/norma": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/norma/-/norma-3.1.1.tgz", - "integrity": "sha512-nSJMdCoVhXJsguT2qNa3e7sFNsopzLF/WDOxhVWc5BXzKU1u0fs8peRK67DMs/Vc1ShbMJef47OyK3EuZfL6Xw==", - "dependencies": { - "eraro": "^3.0.1", - "lodash.isarguments": "^3.1.0", - "lodash.isdate": "^4.0.1", - "lodash.isnan": "^3.0.2", - "lodash.isregexp": "^4.0.1" - } - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -5227,9 +5195,9 @@ } }, "node_modules/prettier": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", - "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.1.tgz", + "integrity": "sha512-7CAwy5dRsxs8PHXT3twixW9/OEll8MLE0VRPCJyl7CkS6VHGPSlsVaWTiASPTyGyYRyApxlaWTzwUxVNrhcwDg==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -5512,9 +5480,9 @@ } }, "node_modules/seneca": { - "version": "3.35.2", - "resolved": "https://registry.npmjs.org/seneca/-/seneca-3.35.2.tgz", - "integrity": "sha512-bdC/7uCEyTizrRI4Yf6wT8zq+9QYXoLWQ4F6SmU2CXYZ+J9juQpftC9Ygil7wl22BPeH2+aOvte2BCLZnRAklg==", + "version": "3.37.0", + "resolved": "https://registry.npmjs.org/seneca/-/seneca-3.37.0.tgz", + "integrity": "sha512-TXpS0PdrfTLAKjVrUG7OmNGz8vJJYlm7IbSEY8qgc9Z/oqLuTlG6JUukd6X9aoTZKZr6XuA4AhtQL4ZWRp9ciw==", "dependencies": { "@hapi/joi": "^17.1.1", "@hapi/wreck": "17", @@ -5522,7 +5490,7 @@ "eraro": "^3.0.1", "fast-safe-stringify": "^2.1.1", "gate-executor": "^3.1.1", - "gubu": "7.0.0", + "gubu": "7.1.0", "lodash.defaultsdeep": "^4.6.1", "lodash.flatten": "^4.4.0", "lodash.uniq": "^4.5.0", @@ -5531,39 +5499,42 @@ "optioner": "^5.0.1", "ordu": "^2.2.0", "patrun": "^7.2.5", - "qs": "^6.11.2", + "qs": "^6.12.1", "rolling-stats": "^0.2.1", "seneca-transport": "^8.2.0", - "use-plugin": "^11.0.0" + "use-plugin": "^13.0.1" }, "engines": { "node": ">=10" } }, "node_modules/seneca-entity": { - "version": "25.1.3", - "resolved": "https://registry.npmjs.org/seneca-entity/-/seneca-entity-25.1.3.tgz", - "integrity": "sha512-5I1tOFwIiG18I0cdOMeGBORapADBj3LqZLbXFKMuPznCNWtKTNvsce5HSNLfldUlDxYgYa5DnrQ0Mm/0PbFZcw==", + "version": "26.0.2", + "resolved": "https://registry.npmjs.org/seneca-entity/-/seneca-entity-26.0.2.tgz", + "integrity": "sha512-kiYuczCNCvFQvs/Obqo2hIk3gjGBSgdVj0AH+/r3LxR5oFXr/NgNJ7dZURzrMr7zmY/KGPPrhB/UdJZ3mWD4Cw==", "peer": true, "dependencies": { - "seneca-mem-store": "^8.4.0" + "seneca-mem-store": "^9.0.0" }, "engines": { - "node": ">=14" + "node": ">=16" }, "peerDependencies": { - "seneca": ">=3", + "seneca": ">=3||>=4.0.0-rc2", "seneca-promisify": ">=3" } }, "node_modules/seneca-mem-store": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/seneca-mem-store/-/seneca-mem-store-8.4.0.tgz", - "integrity": "sha512-AmZzKNzoHGckSHDSDivWV0D7JP1xvFT+XMZ316jlHxpEW2Hw7uKmK4yhZnHzYBAzz5OBCs6EHxTweYTcWAcUFQ==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/seneca-mem-store/-/seneca-mem-store-9.0.0.tgz", + "integrity": "sha512-mTLxpEknDWhV2L84am+3/d77Fi5EgPSmg58XF2CgP2cVncnqxQwalUAZddBfi9HkgrQseHZik6iBglK853fWzQ==", "peer": true, + "dependencies": { + "gubu": "^7.1.0" + }, "peerDependencies": { "seneca": ">=3", - "seneca-entity": ">=25" + "seneca-entity": ">=26" } }, "node_modules/seneca-promisify": { @@ -6117,17 +6088,17 @@ } }, "node_modules/use-plugin": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/use-plugin/-/use-plugin-11.0.0.tgz", - "integrity": "sha512-6lgQ5GH9wBi583s6KD8qCbSkIY9dgfmVL8KHyKhjfDoZK7hIgp7mrDgGpnO3nU+xvw5SthrNG/ZcZ3hukZq7Qw==", + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/use-plugin/-/use-plugin-13.0.1.tgz", + "integrity": "sha512-QOCNSwKOUaz4Vz6n5IekPDxbHvjHXOdkhtrIH/t3O/afr5iMllvGSAmHfGPAW7Ja9e9ajmqFKCgJhzk+vYqTEg==", "dependencies": { "eraro": "^3.0.1", + "gubu": "^7.1.0", "lodash.defaultsdeep": "^4.6.1", - "nid": "^2.0.1", - "norma": "^3.1.1" + "nid": "^2.0.1" }, "engines": { - "node": ">=10" + "node": ">=16" } }, "node_modules/util-deprecate": { diff --git a/package.json b/package.json index 852d3f3..a2b7bef 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,15 @@ { "name": "@seneca/s3-store", - "version": "2.4.0", + "version": "2.5.0", "description": "Entity store using AWS S3.", "main": "dist/s3-store.js", "type": "commonjs", "types": "dist/s3-store.d.ts", "scripts": { "watch": "tsc -w -d", - "test": "lab -v -P test -t 50 -l --sourcemaps --transform node_modules/lab-transform-typescript -I @@any-promise/REGISTRATION -r console -o stdout -r html -o test/coverage.html", + "test-lab": "lab -v -P test -t 50 -l --sourcemaps --transform node_modules/lab-transform-typescript -I @@any-promise/REGISTRATION -r console -o stdout -r html -o test/coverage.html", "test-some": "lab -v -P test -l --sourcemaps --transform node_modules/lab-transform-typescript -g", + "test": "echo fix-test", "coveralls": "lab -s -P test -r lcov | coveralls", "prettier": "prettier --write --no-semi --single-quote src/*.ts test/*.js", "build": "tsc -d", @@ -40,11 +41,11 @@ "@aws-sdk/s3-request-presigner": "^3.468.0", "@hapi/code": "^9.0.3", "@hapi/lab": "^25.2.0", - "@seneca/doc": "^7.2.0", - "@types/node": "20.12.7", + "@seneca/doc": "^8.0.0", + "@types/node": "20.14.2", "coveralls": "^3.1.1", "lab-transform-typescript": "^3.0.1", - "prettier": "^3.2.5", + "prettier": "^3.3.1", "s3rver": "^3.7.1", "seneca-store-test": "^5.2.0", "typescript": "^5.4.5" @@ -52,8 +53,8 @@ "peerDependencies": { "@aws-sdk/client-s3": ">=3", "@aws-sdk/s3-request-presigner": ">=3", - "seneca": ">=3", - "seneca-entity": ">=25", + "seneca": ">=3||>=4.0.0-rc2", + "seneca-entity": ">=26", "seneca-promisify": ">=3" }, "dependencies": { diff --git a/test/coverage.html b/test/coverage.html index 336ee16..8691dde 100644 --- a/test/coverage.html +++ b/test/coverage.html @@ -536,18 +536,18 @@
  • Test Report
  • Coverage Report
  • - 81.13 + 77.21 dist/s3-store.js
  • Linting Report
  • Test Report

    -
    -
    0
    +
    +
    7
    0
    17
    -
    1779
    +
    2412
    @@ -574,91 +574,98 @@

    Test Report

    happy - 167 + 213 - + 2 jsonl-s3 - +
    Error: connect ECONNREFUSED 127.0.0.1:4568 + at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16)
    - 183 + 310 - + 3 jsonl-s3-customid - +
    Error: connect ECONNREFUSED 127.0.0.1:4568 + at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16)
    - 99 + 268 4 jsonl-local-basic - 90 + 105 - + 5 bin-s3-basic - +
    Error: connect ECONNREFUSED 127.0.0.1:4568 + at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16)
    - 113 + 147 6 bin-local-basic - 72 + 89 7 bin-local-customid - 63 + 83 8 store-init load-store-plugin - 117 + 121 - + 9 store-init clear-data - +
    Error: connect ECONNREFUSED 127.0.0.1:4568 + at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16)
    - 13 + 272 - + 10 store-keyvalue save-load-auto-id - +
    Error: connect ECONNREFUSED 127.0.0.1:4568 + at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16)
    - 101 + 140 - + 11 store-keyvalue save-load-given-id - +
    Error: connect ECONNREFUSED 127.0.0.1:4568 + at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16)
    - 207 + 64 - + 12 store-keyvalue remove - +
    Error: connect ECONNREFUSED 127.0.0.1:4568 + at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16)
    - 53 + 120 13 store-init load-store-plugin - 119 + 120 14 @@ -672,21 +679,21 @@

    Test Report

    store-keyvalue save-load-auto-id - 42 + 31 16 store-keyvalue save-load-given-id - 31 + 25 17 store-keyvalue remove - 17 + 24 @@ -694,10 +701,10 @@

    Test Report

    Code Coverage Report

    -
    81.13%
    +
    77.21%
    408
    -
    331
    -
    77
    +
    315
    +
    93
    @@ -707,10 +714,10 @@

    Code Coverage Report

    dist/s3-store.js

    -
    81.13%
    +
    77.21%
    408
    -
    331
    -
    77
    +
    315
    +
    93
    @@ -1344,25 +1351,25 @@

    dist/s3-store.js

    - + - + - + - + @@ -1380,19 +1387,19 @@

    dist/s3-store.js

    - + - + - + @@ -1410,7 +1417,7 @@

    dist/s3-store.js

    - + @@ -1434,13 +1441,13 @@

    dist/s3-store.js

    - + - + @@ -1464,7 +1471,7 @@

    dist/s3-store.js

    - + @@ -1488,7 +1495,7 @@

    dist/s3-store.js

    - + @@ -1518,7 +1525,7 @@

    dist/s3-store.js

    - + @@ -1536,19 +1543,19 @@

    dist/s3-store.js

    - + - + - + @@ -1560,7 +1567,7 @@

    dist/s3-store.js

    - + @@ -1572,7 +1579,7 @@

    dist/s3-store.js

    - + @@ -1704,7 +1711,7 @@

    dist/s3-store.js

    - + @@ -1734,7 +1741,7 @@

    dist/s3-store.js

    - + @@ -1749,11 +1756,11 @@

    dist/s3-store.js

    - + - + @@ -1767,11 +1774,11 @@

    dist/s3-store.js

    - + - + @@ -1806,25 +1813,25 @@

    dist/s3-store.js

    - + - + - + - + @@ -1848,13 +1855,13 @@

    dist/s3-store.js

    - + - + @@ -1866,25 +1873,25 @@

    dist/s3-store.js

    - + - + - + - + @@ -1896,13 +1903,13 @@

    dist/s3-store.js

    - + - + @@ -1932,13 +1939,13 @@

    dist/s3-store.js

    - + - + @@ -1956,7 +1963,7 @@

    dist/s3-store.js

    - + @@ -1974,19 +1981,19 @@

    dist/s3-store.js

    - + - + - + @@ -2004,7 +2011,7 @@

    dist/s3-store.js

    - + @@ -2193,17 +2200,17 @@

    dist/s3-store.js

    - + - - + + - + - - + + @@ -2223,11 +2230,11 @@

    dist/s3-store.js

    - + - - + + @@ -2241,11 +2248,11 @@

    dist/s3-store.js

    - + - + @@ -2263,19 +2270,19 @@

    dist/s3-store.js

    - + - + - - + + - + - + @@ -2304,7 +2311,7 @@

    dist/s3-store.js

    - + @@ -2328,7 +2335,7 @@

    dist/s3-store.js

    - + @@ -2343,11 +2350,11 @@

    dist/s3-store.js

    - + - + @@ -2355,11 +2362,11 @@

    dist/s3-store.js

    - + - + @@ -2371,7 +2378,7 @@

    dist/s3-store.js

    - + @@ -2389,13 +2396,13 @@

    dist/s3-store.js

    - + - + - - + + @@ -2403,11 +2410,11 @@

    dist/s3-store.js

    - + - - + + @@ -2472,13 +2479,13 @@

    dist/s3-store.js

    - + - + @@ -2490,7 +2497,7 @@

    dist/s3-store.js

    - + @@ -2502,7 +2509,7 @@

    dist/s3-store.js

    - + @@ -2586,7 +2593,7 @@

    dist/s3-store.js

    - + @@ -2610,7 +2617,7 @@

    dist/s3-store.js

    - + @@ -2625,11 +2632,11 @@

    dist/s3-store.js

    - + - + @@ -2647,7 +2654,7 @@

    dist/s3-store.js

    - + @@ -2655,17 +2662,17 @@

    dist/s3-store.js

    - + - + - + - - + + @@ -3210,7 +3217,7 @@

    dist/s3-store.js

    - + @@ -3225,53 +3232,53 @@

    dist/s3-store.js

    - + - - + + - + - + - + - - + + - + - - + + - + - - + + - + - + - + - - + + - + - - + + @@ -3285,11 +3292,11 @@

    dist/s3-store.js

    - + - - + +
    104 3019 let id = '' + (msg.ent.id || msg.ent.id$ || generate_id(msg.ent)); 133
    105 3019 let d = msg.ent.data$(); 134
    106 3019 d.id = id; 135
    107 3019 let entSpec = options.ent[canon]; 137
    110 3019 let s3id = make_s3id(id, msg.ent, options, bin); 141
    111 3019 let Body = undefined; 142
    112 3019 if (entSpec || jsonl || bin) { 144
    115 54 let arr = msg.ent[jsonl]; 147
    119 54 let content = arr.map((n) => JSON.stringify(n)).join('\n') + '\n'; 154
    120 54 Body = Buffer.from(content); 155
    124 54 let dataRef = msg.ent[bin]; 160
    128 54 let data = dataRef; 167
    133 54 Body = Buffer.from(data); 174
    136 3019 if (null == Body) { 178
    137 2011 let dj = JSON.stringify(d); 179
    138 2011 Body = Buffer.from(dj); 180
    140 3019 let ento = msg.ent.make$().data$(d); 183
    142 3019 if (options.local.active) { 186
    164 154 const s3cmd = new client_s3_1.PutObjectCommand({ 211
    169 154 aws_s3 217
    .then((_res) => { 219
    172 reply(null, ento);
    reply(null, ento);
    220
    173 .catch((err) => { 222
    175
    reply(err);
    reply(err); 223
    176
    181 5429 let qent = msg.qent; 230
    182 5429 let id = '' + msg.q.id; 231
    183 5429 let entSpec = options.ent[canon]; 232
    184 5429 let output = 'ent'; 233
    188 5429 let s3id = make_s3id(id, msg.ent, options, bin); 238
    189 5429 output = jsonl && '' != jsonl ? 'jsonl' : bin && '' != bin ? 'bin' : 'ent'; 240
    191 4221 let entdata = {}; 243
    192 4221 if (null != body) { 245
    193 4020 if ('bin' !== output) { 246
    194 3517 body = body.toString('utf-8'); 247
    196 4020 if ('jsonl' === output) { 250
    197 52 entdata[jsonl] = body 251
    202 3518 else if ('bin' === output) { 255
    203 53 entdata[bin] = body; 256
    206 3015 entdata = JSON.parse(body); 258
    209 4221 entdata.id = id; 262
    210 4221 let ento = qent.make$().data$(entdata); 264
    211 4221 reply(null, ento); 265
    214 5429 if (options.local.active) { 269
    else { 302
    246 27 if (exists) {
    if (
    exists
    ) {
    303
    247 2 const s3cmd = new client_s3_1.HeadObjectCommand({ const s3cmd = new client_s3_1.HeadObjectCommand({ 304
    248 }); 307
    251 2 aws_s3 aws_s3 309
    252 .then(() => { 311
    254 replyEnt(null);
    replyEnt(null);
    312
    255 257
    if (
    'NotFound' === err.name
    ) {
    if ('NotFound' === err.name) {
    315
    258 1 return reply(); return reply(); 316
    259 }
    }
    317
    260
    264 252 const s3cmd = new client_s3_1.GetObjectCommand({ 322
    268 252 aws_s3 327
    .then((res) => { 329
    271 destream(output, res.Body)
    destream(output, res.Body)
    330
    272 .then((body) => { 331
    273 replyEnt(body);
    replyEnt(body);
    332
    274 275
    .catch((err) =>
    reply(err)
    );
    .catch((err) => reply(err));
    334
    276 278
    if (
    'NoSuchKey' === err.Code
    ) {
    if (
    'NoSuchKey' === err.Code
    ) {
    337
    279 5 return reply(); return reply(); 338
    280 } 339
    281 reply(err);2 reply(err); 341
    282
    292 64 let id = '' + msg.q.id; 354
    293 64 let entSpec = options.ent[canon]; 355
    295 64 let s3id = make_s3id(id, msg.ent, options, bin); 358
    297 64 if (options.local.active) { 361
    311 31 const s3cmd = new client_s3_1.DeleteObjectCommand({ 375
    315 31 aws_s3 380
    .then((_res) => { 382
    318 reply();
    reply();
    383
    319 321
    if ('NoSuchKey' === err.Code) {
    if (
    'NoSuchKey' === err.Code
    ) {
    386
    322 return reply(); 387
    323
    }
    } 388
    324 reply(err);1 reply(err); 390
    325
    415 9052 return s3id; 508
    async function destream(output, stream) { 511
    418 20 return new Promise((resolve, reject) => { return new Promise((resolve, reject) => { 512
    419 const chunks = [];
    const chunks = [];
    513
    420 20 stream.on('data', (chunk) => chunks.push(chunk)); stream.on('data', (chunk) => chunks.push(chunk)); 514
    421 20 stream.on('error', reject); stream.on('error', reject); 515
    422 20 stream.on('end', () => { stream.on('end', () => { 516
    423 let buffer = Buffer.concat(chunks);
    let buffer = Buffer.concat(chunks);
    517
    424 20 if ('bin' === output) { if ('bin' === output) { 518
    425 2 resolve(buffer); resolve(buffer); 519
    426 else { 520
    428 18 resolve(buffer.toString('utf-8')); resolve(buffer.toString('utf-8')); 521
    429