Skip to content

Commit cdc2ef4

Browse files
authored
Merge branch 'master' into fix-postman-request-version
2 parents a595886 + 512edc4 commit cdc2ef4

File tree

6 files changed

+252
-37
lines changed

6 files changed

+252
-37
lines changed

example/update.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// file: example/update.js
2+
3+
process.env.DEBUG = 'node-vault'; // switch on debug mode
4+
5+
const vault = require('./../src/index')();
6+
7+
vault.update('secret/hello', { value: 'world', lease: '1s' })
8+
.then(() => vault.read('secret/hello'))
9+
.catch((err) => console.error(err.message));
10+
11+
vault.update('secret/hello', { value: 'everyone', lease: '1s' })
12+
.then(() => vault.read('secret/hello'))
13+
.catch((err) => console.error(err.message));
14+
15+
vault.update('secret/hello', { value: { 'foo': 'bar', 'world': 'everyone' } })
16+
.then(() => vault.read('secret/hello'))
17+
.catch((err) => console.error(err.message));

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ declare namespace NodeVault {
4747
read(path: string, requestOptions?: Option): Promise<any>;
4848
list(path: string, requestOptions?: Option): Promise<any>;
4949
delete(path: string, requestOptions?: Option): Promise<any>;
50+
update(path: string, data: any, requestOptions?: Option): Promise<any>;
5051

5152
generateFunction(name: string, conf: functionConf): void;
5253

0 commit comments

Comments
 (0)