This commit is contained in:
proteriax
2021-07-18 16:12:04 -04:00
parent 99fa963fc0
commit 98cc916432
24 changed files with 726 additions and 269 deletions

14
repl.ts
View File

@ -1,11 +1,13 @@
#!/usr/bin/env ts-node-transpile-only
#!/usr/bin/env node -r ts-node/register/transpile-only
import fs from "fs"
import chalk from "chalk"
import prompts from "prompts"
import { OnePassword } from "./src/index"
const path = "./freddy"
async function main(args: string[]) {
const instance = new OnePassword({ path: args[0] })
const instance = new OnePassword({ path })
const profiles = await instance.getProfileNames()
// const { profile } = await prompts({
@ -28,13 +30,17 @@ async function main(args: string[]) {
vault.unlock(password)
const find = vault.overviews.get("A note with some attachments")!
const item = vault.getItem(find.uuid!)
const d = vault.decryptAttachment(
item!.original,
fs.readFileSync(
"./freddy-2013-12-04.opvault/default/1C7D72EFA19A4EE98DB7A9661D2F5732_3B94A1F475014E27BFB00C99A42214DF.attachment"
"./freddy/default/F2DB5DA3FCA64372A751E0E85C67A538_AFBDA49A5F684179A78161E40CA2AAD3.attachment"
)
)
fs.writeFileSync("./test", d)
fs.writeFileSync("./test2.png", d.file)
// console.log(vault.overviews.values())
}