Skip to content

Commit

Permalink
fix(core): npm audit fix
Browse files Browse the repository at this point in the history
Updates a lot of other deps, except for the hard ones (typescript and eslint, mostly)
  • Loading branch information
dmihalcik-virtru committed Nov 12, 2024
1 parent 2fe2c43 commit e41bccf
Show file tree
Hide file tree
Showing 10 changed files with 4,582 additions and 2,836 deletions.
408 changes: 206 additions & 202 deletions cli/package-lock.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@
},
"devDependencies": {
"@esm-bundle/chai": "4.3.4-fix.0",
"@types/mocha": "10.0.1",
"@types/node": "^20.4.5",
"@types/readable-stream": "^2.3.15",
"@types/sinon": "^10.0.15",
"@types/yargs": "^17.0.24",
"@types/mocha": "10.0.9",
"@types/node": "^22.9.0",
"@types/readable-stream": "^4.0.18",
"@types/sinon": "^17.0.3",
"@types/yargs": "^17.0.33",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"chai": "^4.3.7",
"eslint": "^8.46.0",
"chai": "^5.1.2",
"eslint": "^8.9.0",
"eslint-config-prettier": "^8.9.0",
"license-checker-rseidelsohn": "^4.2.6",
"mocha": "^10.2.0",
"prettier": "^3.0.0",
"sinon": "^15.2.0",
"license-checker-rseidelsohn": "^4.4.2",
"mocha": "^10.8.2",
"prettier": "^3.3.3",
"sinon": "^19.0.2",
"ts-node": "^10.9.2",
"typescript": "^5.1.6"
},
Expand Down
13 changes: 7 additions & 6 deletions cli/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import './polyfills.js';
import { openAsBlob } from 'node:fs';
import { open, readFile, stat, writeFile } from 'node:fs/promises';
import { createWriteStream, openAsBlob } from 'node:fs';
import { readFile, stat, writeFile } from 'node:fs/promises';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import {
Expand All @@ -21,6 +21,7 @@ import { webcrypto } from 'crypto';
import * as assertions from '@opentdf/sdk/assertions';
import { attributeFQNsAsValues } from '@opentdf/sdk/nano';
import { base64 } from '@opentdf/sdk/encodings';
import { Writable } from 'node:stream';

type AuthToProcess = {
auth?: string;
Expand Down Expand Up @@ -420,8 +421,8 @@ export const handleArgs = (args: string[]) => {
log('DEBUG', `About to decrypt [${argv.file}]`);
const ct = await client.decrypt(await tdf3DecryptParamsFor(argv));
if (argv.output) {
const filehandle = await open(argv.output, 'w');
await filehandle.writeFile(ct.stream);
const destination = createWriteStream(argv.output);
await ct.stream.pipeTo(Writable.toWeb(destination));
} else {
console.log(await ct.toString());
}
Expand Down Expand Up @@ -514,8 +515,8 @@ export const handleArgs = (args: string[]) => {
throw new CLIError('CRITICAL', 'Encrypt configuration error: No output?');
}
if (argv.output) {
const filehandle = await open(argv.output, 'w');
await filehandle.writeFile(ct.stream);
const destination = createWriteStream(argv.output);
await ct.stream.pipeTo(Writable.toWeb(destination));
} else {
console.log(await ct.toString());
}
Expand Down
Loading

0 comments on commit e41bccf

Please sign in to comment.