Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
93 views
in Technique[技术] by (71.8m points)

How to load a file generated with buttercup desktop in buttercup node.js?

I've created a .bcup file using the windows desktop tool. Now I wan't to open it using this code from the example:

  const credentials = Credentials.fromDatasource({
    path: './data.bcup'
  }, 'password');
  const fileDatasource = new FileDatasource(credentials);

  // @ts-ignore
  const archive = await fileDatasource.load(credentials).then(Vault.createFromHistory);

I'm getting the following exception:

Error: Provided credentials don't allow vault decryption
    at FileDatasource.load (webpack://kurserio-api/./node_modules/buttercup/dist/datasources/TextDatasource.js?:131:35)
    at eval (webpack://kurserio-api/./node_modules/buttercup/dist/datasources/FileDatasource.js?:93:30)

Also the sample gives me a type error at the part then(Vault.createFromHistory);:

TS2345: Argument of type '(history: History, format?: any) => Vault' is not assignable to parameter of type '(value: DatasourceLoadedData) => Vault | PromiseLike<Vault>'. ??Types of parameters 'history' and 'value' are incompatible. ????Type 'DatasourceLoadedData' is missing the following properties from type 'History': length, pop, push, concat, and 26 more.
question from:https://stackoverflow.com/questions/66064338/how-to-load-a-file-generated-with-buttercup-desktop-in-buttercup-node-js

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...