@@ -4,26 +4,41 @@ import LoginType = Authentication.LoginType;
44
55process . env . NODE_TLS_REJECT_UNAUTHORIZED = '0'
66
7- const clientVersion = 'w16.4 .0'
7+ const clientVersion = 'w17.5 .0'
88
99async function printVault ( username : string , password : string ) {
1010 try {
1111 let auth = new Auth ( {
1212 host : KeeperEnvironment . DEV ,
13- clientVersion : clientVersion
13+ clientVersion : clientVersion ,
14+ deviceConfig : { deviceName : "JS SDK Example" } ,
1415 } )
1516 await auth . loginV3 ( { username, password, loginType : LoginType . NORMAL } )
16- console . log ( 'login successful' )
1717
18- const records = [ ] as DRecord [ ]
19- const storage = { } as VaultStorage
18+ const storage : VaultStorage = {
19+ async put ( data ) {
20+ if ( data . kind === 'record' ) {
21+ console . log ( JSON . stringify ( data , null , 2 ) )
22+ }
23+ } ,
24+ // remaing methods are no-ops
25+ async getDependencies ( uid ) { return undefined } ,
26+ async addDependencies ( ) { return } ,
27+ async removeDependencies ( ) { return } ,
28+ async clear ( ) { return } ,
29+ async get ( kind , uid ) { return undefined } ,
30+ async delete ( kind , uid ) { return } ,
31+ async getKeyBytes ( ) { return undefined } ,
32+ async saveKeyBytes ( ) { }
33+ }
2034 await syncDown ( {
2135 auth,
2236 storage,
2337 } )
24- records . forEach ( x => console . log ( JSON . stringify ( x ) ) )
38+ process . exit ( 0 )
2539 } catch ( e ) {
2640 console . log ( e )
41+ process . exit ( 1 )
2742 }
2843}
2944
0 commit comments