Update
This commit is contained in:
21
repl.ts
21
repl.ts
@ -1,10 +1,10 @@
|
||||
#!/usr/bin/env node -r ts-node/register/transpile-only
|
||||
#!/usr/bin/env -S 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"
|
||||
const path = "./freddy-2013-12-04.opvault"
|
||||
|
||||
async function main(args: string[]) {
|
||||
const instance = new OnePassword({ path })
|
||||
@ -31,16 +31,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 item = vault.getItem(find.uuid!)!
|
||||
console.log(item.attachments[0].metadata)
|
||||
|
||||
const d = vault.decryptAttachment(
|
||||
item!.original,
|
||||
fs.readFileSync(
|
||||
"./freddy/default/F2DB5DA3FCA64372A751E0E85C67A538_AFBDA49A5F684179A78161E40CA2AAD3.attachment"
|
||||
)
|
||||
)
|
||||
// const d = vault.decryptAttachment(
|
||||
// item!.original,
|
||||
// fs.readFileSync(
|
||||
// "./freddy/default/F2DB5DA3FCA64372A751E0E85C67A538_AFBDA49A5F684179A78161E40CA2AAD3.attachment"
|
||||
// )
|
||||
// )
|
||||
|
||||
fs.writeFileSync("./test2.png", d.file)
|
||||
// fs.writeFileSync("./test2.png", d.file)
|
||||
|
||||
// console.log(vault.overviews.values())
|
||||
}
|
||||
|
Reference in New Issue
Block a user