secrez 1.1.6 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -145,11 +145,9 @@ Available commands:
145
145
  bash << deprecated - use "shell" instead
146
146
  cat Shows the content of a file.
147
147
  cd Changes the working directory.
148
- chat Enters the Secrez chat
149
148
  conf Shows current configuration and allow to change password and number of iterations).
150
149
  contacts Manages your contacts
151
150
  copy Copy a text file to the clipboard.
152
- courier Configure the connection to a local courier
153
151
  ds Manages datasets
154
152
  edit Edits a file containing a secret.
155
153
  export Export encrypted data to the OS in the current local folder
@@ -168,14 +166,14 @@ Available commands:
168
166
  quit Quits Secrez.
169
167
  rm Removes one or more files and folders.
170
168
  shell Execute a shell command in the current disk folder.
169
+ show Show a card field as a QR code.
171
170
  ssh Opens a new tab and run ssh to connect to a remote server via SSH
172
171
  tag Tags a file and shows existent tags.
173
172
  totp Generate a TOTP code if a totp field exists in the card.
174
173
  touch Creates a file.
175
174
  use Uses a specific dataset.
176
175
  ver Shows the version of Secrez.
177
- whoami Show data that other users need to chat with you
178
-
176
+ whoami Show your Secrez public key
179
177
  ```
180
178
 
181
179
  ## Some example
@@ -357,7 +355,7 @@ It has been removed in version 0.11.0 due to potential critical issues with Pyth
357
355
 
358
356
  ## (experimental) End-to-end encrypted communication with other accounts
359
357
 
360
- Starting from version 0.8.0, Secrez allows you to exchange encrypted messages with other users. To do so, you must set up a local Courier ([look here for more info](https://github.com/secrez/secrez/tree/master/packages/courier)).
358
+ Starting from version 0.8.0, Secrez allowed you to exchange encrypted messages with other users. To do so, it was using the packages `@secrez/courier`, `@secrez/hub`, `@secrez/tls` and `@secrez/tunnel`. Those four packages have been removed in version 2.0.0 since the feature was hard to maintain and not very used.
361
359
 
362
360
  ## Blog posts
363
361
 
@@ -371,6 +369,15 @@ Secrez is not intended to compete with password managers, so do not expect it to
371
369
 
372
370
  ## History
373
371
 
372
+ **2.0.1**
373
+
374
+ - fix commands to change password and number of iterations
375
+
376
+ **2.0.0** (breaking changes)
377
+
378
+ - remove `@crypto/hub`, `@crypto/courier`, `@crypto/tunnel` and `@crypto/tls` since they are not maintained anymore
379
+ - add `show` command to show a card field as a QR code, for example to encode a private key and let a mobile wallet scan it
380
+
374
381
  **1.1.6**
375
382
 
376
383
  - add support for cryptoEnv format to `export` (look at https://github.com/secrez/cryptoenv for details about CryptoEnv)
@@ -832,78 +839,65 @@ Thank you for any contributions! 😉
832
839
  ## Test coverage
833
840
 
834
841
  ```
835
- 166 passing (24s)
842
+ 148 passing (15s)
836
843
  1 pending
837
844
 
838
- -----------------------|---------|----------|---------|---------|-----------------------------------
839
- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
840
- -----------------------|---------|----------|---------|---------|-----------------------------------
841
- All files | 71.22 | 58.41 | 71.25 | 71.11 |
842
- src | 59.63 | 54.79 | 55 | 60.19 |
843
- Command.js | 79.66 | 78.72 | 76.92 | 81.03 | 32,55-62,73,80,119
844
- PreCommand.js | 21.95 | 11.54 | 14.29 | 21.95 | 8-99,116
845
- cliConfig.js | 100 | 100 | 100 | 100 |
846
- src/commands | 81.53 | 67 | 89.95 | 81.4 |
847
- Alias.js | 90.54 | 77.36 | 100 | 90.41 | 101,112,139,169,173,180,190
848
- Bash.js | 75 | 0 | 66.67 | 75 | 18-19
849
- Cat.js | 98.9 | 88.89 | 100 | 98.9 | 152
850
- Cd.js | 96.43 | 86.67 | 100 | 96.43 | 44
851
- Chat.js | 19.51 | 0 | 16.67 | 19.51 | 23-144
852
- Conf.js | 10.45 | 0 | 25 | 10.45 | 134-499
853
- Contacts.js | 74.67 | 65.98 | 92.86 | 74.5 | ...90-214,240,247,259,315,328,338
854
- Copy.js | 94.87 | 74.51 | 100 | 94.81 | 111,162,179,204
855
- Courier.js | 63.54 | 41.86 | 85.71 | 63.83 | ...37,152-171,188,200-203,215-221
856
- Ds.js | 92.54 | 82.05 | 100 | 92.42 | 99,108-113,125
857
- Edit.js | 13.58 | 0 | 40 | 13.58 | 88-214
858
- Export.js | 87.63 | 67.74 | 100 | 87.63 | ...66,175,182-186,191,203,212,215
859
- Find.js | 93.59 | 86.67 | 100 | 93.42 | 101,164,200-203,209
860
- Help.js | 100 | 80 | 100 | 100 | 29
861
- Import.js | 93.2 | 85.48 | 100 | 93.14 | ...65,367,387,393,441,456-463,490
862
- Lcat.js | 100 | 85.71 | 100 | 100 | 54
863
- Lcd.js | 95.65 | 81.82 | 100 | 95.65 | 50
864
- Lls.js | 95.45 | 72.73 | 100 | 95.45 | 97
865
- Lpwd.js | 92.31 | 100 | 100 | 92.31 | 36
866
- Ls.js | 91.3 | 75 | 100 | 90.77 | 103,114-116,130,181
867
- Mkdir.js | 100 | 66.67 | 100 | 100 | 38-44
868
- Mv.js | 88.04 | 73.21 | 100 | 87.78 | 93-99,133,155,165-172
869
- Paste.js | 87.23 | 75 | 100 | 87.23 | 72,78,81,89,113,129
870
- Pwd.js | 92.31 | 100 | 100 | 92.31 | 33
871
- Quit.js | 90 | 50 | 100 | 90 | 27
872
- Rm.js | 94 | 80.95 | 100 | 93.88 | 63,126,134
873
- Shell.js | 88.24 | 60 | 100 | 88.24 | 38,55
874
- Ssh.js | 25 | 0 | 40 | 25 | 72-120
875
- Tag.js | 98.04 | 92.31 | 100 | 98.02 | 122,171
876
- Totp.js | 96.47 | 74.47 | 100 | 96.47 | 188-189,235
877
- Touch.js | 95.92 | 81.48 | 100 | 95.83 | 152,202
878
- Use.js | 96.77 | 89.47 | 100 | 96.77 | 68
879
- Ver.js | 90 | 66.67 | 100 | 90 | 25
880
- Whoami.js | 93.1 | 63.64 | 80 | 93.1 | 29,64
881
- chat.js | 85.37 | 53.85 | 100 | 85.37 | 105,117-130,136,142
882
- index.js | 91.67 | 60 | 100 | 91.3 | 22,31
883
- src/commands/chat | 79.44 | 63.29 | 92.31 | 79.33 |
884
- Contacts.js | 80 | 42.86 | 80 | 80 | 54,65,69,81
885
- Help.js | 86.67 | 60 | 100 | 86.67 | 37-38
886
- Join.js | 95.65 | 82.61 | 100 | 95.56 | 43,110
887
- Leave.js | 100 | 60 | 100 | 100 | 24,28
888
- Quit.js | 100 | 75 | 100 | 100 | 24
889
- Send.js | 67.65 | 46.67 | 100 | 67.65 | 37,41,44,77,86-95
890
- Show.js | 68.75 | 70.59 | 100 | 68.75 | 74-78,87,102-108
891
- Whoami.js | 42.86 | 0 | 60 | 42.86 | 22,30-39
892
- src/prompts | 14.72 | 0 | 13.43 | 14.85 |
893
- ChatPrompt.js | 6.1 | 0 | 0 | 6.1 | 8-164
894
- ChatPromptMock.js | 100 | 100 | 66.67 | 100 |
895
- CommandPrompt.js | 9.8 | 0 | 0 | 9.93 | 24-318
896
- Completion.js | 4.41 | 0 | 0 | 4.48 | 6-103
897
- MainPromptMock.js | 100 | 100 | 66.67 | 100 |
898
- MultiEditorPrompt.js | 25 | 0 | 0 | 25 | 7-36
899
- SigintManager.js | 25 | 0 | 20 | 25 | 10-36
900
- src/utils | 69.92 | 63.28 | 56.25 | 69.55 |
901
- AliasManager.js | 100 | 91.67 | 100 | 100 | 47
902
- ContactManager.js | 71.43 | 60 | 85.71 | 71.43 | 12,35-37
903
- Fido2Client.js | 15.38 | 0 | 11.11 | 15.38 | 14-108
904
- HelpProto.js | 91.6 | 84.06 | 100 | 91.45 | 49,153-154,171-176,195
905
- Logger.js | 63.64 | 56.25 | 36.84 | 62.79 | ...37-49,57,65-69,74,84,88,93,105
906
- -----------------------|---------|----------|---------|---------|-----------------------------------
845
+ --------------------|---------|----------|---------|---------|--------------------------------------
846
+ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
847
+ --------------------|---------|----------|---------|---------|--------------------------------------
848
+ All files | 81.16 | 67.69 | 81.02 | 81.05 |
849
+ src | 57.84 | 53.62 | 52.63 | 58.41 |
850
+ Command.js | 79.66 | 78.72 | 76.92 | 81.03 | 32,55-62,73,80,119
851
+ PreCommand.js | 8.82 | 0 | 0 | 8.82 | 6-97
852
+ cliConfig.js | 100 | 100 | 100 | 100 |
853
+ src/commands | 83.82 | 69.19 | 90.54 | 83.71 |
854
+ Alias.js | 90.54 | 77.35 | 100 | 90.41 | 101,112,139,169,173,180,190
855
+ Bash.js | 75 | 0 | 66.66 | 75 | 18-19
856
+ Cat.js | 98.9 | 88.88 | 100 | 98.9 | 152
857
+ Cd.js | 96.42 | 86.66 | 100 | 96.42 | 44
858
+ Conf.js | 9.09 | 0 | 20 | 9.09 | 98-500
859
+ Contacts.js | 87.17 | 74.32 | 100 | 87.06 | ...5-141,145,165,172,184,237,250,260
860
+ Copy.js | 94.87 | 74.5 | 100 | 94.8 | 111,162,179,204
861
+ Ds.js | 92.53 | 82.05 | 100 | 92.42 | 99,108-113,125
862
+ Edit.js | 13.58 | 0 | 40 | 13.58 | 88-214
863
+ Export.js | 88.11 | 70.58 | 100 | 88.11 | ...0-175,185,197-201,206,218,227,230
864
+ Find.js | 93.58 | 86.66 | 100 | 93.42 | 101,164,200-203,209
865
+ Help.js | 100 | 80 | 100 | 100 | 29
866
+ Import.js | 93.2 | 85.48 | 100 | 93.13 | ...5,365,367,387,393,441,456-463,490
867
+ Lcat.js | 100 | 85.71 | 100 | 100 | 54
868
+ Lcd.js | 95.65 | 81.81 | 100 | 95.65 | 50
869
+ Lls.js | 95.45 | 72.72 | 100 | 95.45 | 97
870
+ Lpwd.js | 92.3 | 100 | 100 | 92.3 | 36
871
+ Ls.js | 91.3 | 75 | 100 | 90.76 | 103,114-116,130,181
872
+ Mkdir.js | 100 | 66.66 | 100 | 100 | 38-44
873
+ Mv.js | 88.04 | 73.21 | 100 | 87.77 | 93-99,133,155,165-172
874
+ Paste.js | 87.23 | 75 | 100 | 87.23 | 72,78,81,89,113,129
875
+ Pwd.js | 92.3 | 100 | 100 | 92.3 | 33
876
+ Quit.js | 90 | 50 | 100 | 90 | 27
877
+ Rm.js | 94 | 80.95 | 100 | 93.87 | 63,126,134
878
+ Shell.js | 88.23 | 60 | 100 | 88.23 | 38,55
879
+ Show.js | 72 | 45.45 | 57.14 | 73.46 | ...8,100,106-114,117,123-126,132,143
880
+ Ssh.js | 25 | 0 | 40 | 25 | 72-120
881
+ Tag.js | 98.03 | 92.3 | 100 | 98.01 | 122,171
882
+ Totp.js | 96.47 | 74.46 | 100 | 96.47 | 188-189,235
883
+ Touch.js | 95.91 | 81.48 | 100 | 95.83 | 152,202
884
+ Use.js | 96.77 | 89.47 | 100 | 96.77 | 68
885
+ Ver.js | 90 | 66.66 | 100 | 90 | 25
886
+ Whoami.js | 83.33 | 60 | 80 | 83.33 | 27,35,48
887
+ index.js | 87.5 | 50 | 100 | 86.95 | 15,22,31
888
+ src/prompts | 100 | 100 | 50 | 100 |
889
+ MainPromptMock.js | 100 | 100 | 50 | 100 |
890
+ src/utils | 70.04 | 63.28 | 56.25 | 69.67 |
891
+ AliasManager.js | 100 | 91.66 | 100 | 100 | 47
892
+ ContactManager.js | 73.33 | 60 | 85.71 | 73.33 | 12,34-36
893
+ Fido2Client.js | 15.38 | 0 | 11.11 | 15.38 | 14-108
894
+ HelpProto.js | 91.59 | 84.05 | 100 | 91.45 | 49,153-154,171-176,195
895
+ Logger.js | 63.63 | 56.25 | 36.84 | 62.79 | ...25,37-49,57,65-69,74,84,88,93,105
896
+ --------------------|---------|----------|---------|---------|--------------------------------------
897
+
898
+ > secrez@2.1.0 posttest /Users/francescosullo/Projects/Secrez/secrez/packages/secrez
899
+ > nyc check-coverage --statements 65 --branches 50 --functions 65 --lines 65
900
+
907
901
 
908
902
  ```
909
903
 
package/coverage.report CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- > secrez@1.1.6 test /Users/francescosullo/Projects/Secrez/secrez/packages/secrez
2
+ > secrez@2.1.0 test /Users/francescosullo/Projects/Secrez/secrez/packages/secrez
3
3
  > cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha test/*.test.js test/**/*.test.js test/**/**/*.js --exit
4
4
 
5
5
 
@@ -29,20 +29,16 @@
29
29
  #Cat
30
30
  ✓ should return the help
31
31
  ✓ should show the content of a file
32
- ✓ should show either one or all the versions of a file (1016ms)
32
+ ✓ should show either one or all the versions of a file (1036ms)
33
33
  ✓ should throw if entry is not a file or file does not exist
34
34
  ✓ should throw if trying to cat a binary file
35
- ✓ should show the content of a Yaml file (1018ms)
35
+ ✓ should show the content of a Yaml file (1029ms)
36
36
 
37
37
  #Cd
38
38
  ✓ should return the help
39
39
  ✓ change to a folder
40
40
  ✓ return en error if changing to a file
41
41
 
42
- #Chat
43
- ✓ should return the help
44
- ✓ should run the chat if the courier is ready (551ms)
45
-
46
42
  #Contacts
47
43
  ✓ should return the help
48
44
  ✓ create a contacts
@@ -55,18 +51,12 @@
55
51
 
56
52
  #Copy
57
53
  ✓ should return the help
58
- ✓ should copy a file to the clipboard (401ms)
59
- ✓ should copy a string to the clipboard (244ms)
60
- ✓ should copy a card to the clipboard (883ms)
54
+ ✓ should copy a file to the clipboard (380ms)
55
+ ✓ should copy a string to the clipboard (230ms)
56
+ ✓ should copy a card to the clipboard (866ms)
61
57
  ✓ should return an error if the file does not exist or is a folder
62
58
  ✓ should throw if copying to clipboard a binary files
63
59
 
64
- #Courier
65
- ✓ should return the help
66
- ✓ should check if it is ready
67
- ✓ should set up the courier (172ms)
68
- ✓ should set up the courier and get the default message when is already set up (171ms)
69
-
70
60
  #Ds
71
61
  ✓ should return the help
72
62
  ✓ should list all datasets
@@ -81,12 +71,12 @@
81
71
  ✓ should export an encrypted file to the current local folder
82
72
  ✓ should export a file and delete it after 1 second (1205ms)
83
73
  ✓ should return an error if the file does not exist or is a folder
84
- ✓ should export a keystore json file if a private_key exists in the entry (1050ms)
74
+ ✓ should export a keystore json file if a private_key exists in the entry (672ms)
85
75
  ✓ should export a cryptoenv file if a private_key exists in the entry
86
76
 
87
77
  #Find
88
78
  ✓ should return the help
89
- ✓ should show find a string in the tree (1024ms)
79
+ ✓ should show find a string in the tree (1018ms)
90
80
  ✓ should find no result without parameters
91
81
  ✓ should skip binary files from search
92
82
 
@@ -104,7 +94,7 @@
104
94
  ✓ should import an encrypted binary file and export it again verifying it is fine
105
95
  ✓ should import files recursively
106
96
  ✓ should read a folder and import the only text file
107
- 1) should read a folder and import text and binary files
97
+ should read a folder and import text and binary files
108
98
  ✓ should simulate the import of two files
109
99
  ✓ should move the imported file
110
100
  ✓ should import a backup from another software spanning the data among folders and files
@@ -151,7 +141,7 @@
151
141
 
152
142
  #Mv
153
143
  ✓ should return the help
154
- ✓ should rename a file (1010ms)
144
+ ✓ should rename a file (1015ms)
155
145
  ✓ should move a file to another folder
156
146
  ✓ should move many files to another folder
157
147
  ✓ should move a file to another subfolder
@@ -160,14 +150,14 @@
160
150
  ✓ should move file to another dataset using wildcards
161
151
  ✓ should move file managing duplicates
162
152
  ✓ should throw if parameters are missed or wrong
163
- ✓ should move files from and to other datasets (1018ms)
153
+ ✓ should move files from and to other datasets (1030ms)
164
154
  ✓ should move the results of a find
165
155
 
166
156
  #Paste
167
157
  ✓ should return the help
168
- ✓ should paste the clipboard content to a new file (69ms)
169
- ✓ should paste the clipboard content to an existent file (110ms)
170
- ✓ should paste a single field to a yml card (67ms)
158
+ ✓ should paste the clipboard content to a new file (55ms)
159
+ ✓ should paste the clipboard content to an existent file (61ms)
160
+ ✓ should paste a single field to a yml card
171
161
 
172
162
  #Pwd
173
163
  ✓ should return the help
@@ -181,12 +171,16 @@
181
171
  ✓ should delete a file with one version
182
172
  ✓ should delete many files usign wildcards
183
173
  ✓ should return errors if wrong parameters
184
- ✓ should delete some versions of a file (1008ms)
174
+ ✓ should delete some versions of a file (1012ms)
185
175
 
186
176
  #Shell
187
177
  ✓ should return the help
188
178
  ✓ should show the content of an external file via shell
189
179
 
180
+ #Show
181
+ ✓ should return the help
182
+ ✓ should show the field password of a card
183
+
190
184
  #Tag
191
185
  ✓ should return the help
192
186
  ✓ should tag a file
@@ -197,13 +191,13 @@
197
191
 
198
192
  #Totp
199
193
  ✓ should return the help
200
- ✓ should totp a file to the clipboard (360ms)
201
- ✓ should read a totp secret from an image and add the totp field to the card (68ms)
202
- ✓ should read a totp secret from an image and return the secret (54ms)
194
+ ✓ should totp a file to the clipboard (347ms)
195
+ ✓ should read a totp secret from an image and add the totp field to the card (39ms)
196
+ ✓ should read a totp secret from an image and return the secret
203
197
  ✓ should throw if bad image
204
198
  ✓ should throw if missing parameters
205
- ✓ should throw if the yaml is malformed (45ms)
206
- ✓ should read a totp secret from the clipboard (310ms)
199
+ ✓ should throw if the yaml is malformed
200
+ ✓ should read a totp secret from the clipboard (275ms)
207
201
 
208
202
  #Touch
209
203
  ✓ should return the help
@@ -213,7 +207,7 @@
213
207
  ✓ should throw if wrong parameters
214
208
  ✓ should create a file and generate a wallet
215
209
  New file "/folder2/file1" created.
216
- ✓ should generate 5 prefixed wallet
210
+ ✓ should generate 5 prefixed wallet (65ms)
217
211
  New file "/folder2/file1" created.
218
212
  ✓ should generate a wallet with mnemonic and 2 keys
219
213
 
@@ -226,121 +220,65 @@ New file "/folder2/file1" created.
226
220
 
227
221
  #Whoami
228
222
  ✓ should return the help
229
- ✓ should see who am I (38ms)
230
-
231
- #Help
232
- ✓ should return the help
233
-
234
- #Join
235
- ✓ should return the help
236
- ✓ should join a chat with user0x
237
- ✓ should join a chat with user0x
238
- ✓ should jump between chats (39ms)
239
- ✓ should return all the users
240
- ✓ should throw if contact not found or multiple chat
241
-
242
- #Leave
243
- ✓ should return the help
244
- ✓ should leave the room
223
+ ✓ should see who am I
245
224
 
246
- #Quit
247
- ✓ should return the help
248
- ✓ should quit the chat, even if inside a room (57ms)
249
225
 
250
- #Send
251
- should return the help
252
- ✓ should send a message to user0 (245ms)
253
-
254
- #Show
255
- ✓ should return the help
256
- ✓ should show history messages (452ms)
226
+ 148 passing (15s)
227
+ 1 pending
257
228
 
229
+ --------------------|---------|----------|---------|---------|--------------------------------------
230
+ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
231
+ --------------------|---------|----------|---------|---------|--------------------------------------
232
+ All files | 81.16 | 67.69 | 81.02 | 81.05 |
233
+ src | 57.84 | 53.62 | 52.63 | 58.41 |
234
+ Command.js | 79.66 | 78.72 | 76.92 | 81.03 | 32,55-62,73,80,119
235
+ PreCommand.js | 8.82 | 0 | 0 | 8.82 | 6-97
236
+ cliConfig.js | 100 | 100 | 100 | 100 |
237
+ src/commands | 83.82 | 69.19 | 90.54 | 83.71 |
238
+ Alias.js | 90.54 | 77.35 | 100 | 90.41 | 101,112,139,169,173,180,190
239
+ Bash.js | 75 | 0 | 66.66 | 75 | 18-19
240
+ Cat.js | 98.9 | 88.88 | 100 | 98.9 | 152
241
+ Cd.js | 96.42 | 86.66 | 100 | 96.42 | 44
242
+ Conf.js | 9.09 | 0 | 20 | 9.09 | 98-500
243
+ Contacts.js | 87.17 | 74.32 | 100 | 87.06 | ...5-141,145,165,172,184,237,250,260
244
+ Copy.js | 94.87 | 74.5 | 100 | 94.8 | 111,162,179,204
245
+ Ds.js | 92.53 | 82.05 | 100 | 92.42 | 99,108-113,125
246
+ Edit.js | 13.58 | 0 | 40 | 13.58 | 88-214
247
+ Export.js | 88.11 | 70.58 | 100 | 88.11 | ...0-175,185,197-201,206,218,227,230
248
+ Find.js | 93.58 | 86.66 | 100 | 93.42 | 101,164,200-203,209
249
+ Help.js | 100 | 80 | 100 | 100 | 29
250
+ Import.js | 93.2 | 85.48 | 100 | 93.13 | ...5,365,367,387,393,441,456-463,490
251
+ Lcat.js | 100 | 85.71 | 100 | 100 | 54
252
+ Lcd.js | 95.65 | 81.81 | 100 | 95.65 | 50
253
+ Lls.js | 95.45 | 72.72 | 100 | 95.45 | 97
254
+ Lpwd.js | 92.3 | 100 | 100 | 92.3 | 36
255
+ Ls.js | 91.3 | 75 | 100 | 90.76 | 103,114-116,130,181
256
+ Mkdir.js | 100 | 66.66 | 100 | 100 | 38-44
257
+ Mv.js | 88.04 | 73.21 | 100 | 87.77 | 93-99,133,155,165-172
258
+ Paste.js | 87.23 | 75 | 100 | 87.23 | 72,78,81,89,113,129
259
+ Pwd.js | 92.3 | 100 | 100 | 92.3 | 33
260
+ Quit.js | 90 | 50 | 100 | 90 | 27
261
+ Rm.js | 94 | 80.95 | 100 | 93.87 | 63,126,134
262
+ Shell.js | 88.23 | 60 | 100 | 88.23 | 38,55
263
+ Show.js | 72 | 45.45 | 57.14 | 73.46 | ...8,100,106-114,117,123-126,132,143
264
+ Ssh.js | 25 | 0 | 40 | 25 | 72-120
265
+ Tag.js | 98.03 | 92.3 | 100 | 98.01 | 122,171
266
+ Totp.js | 96.47 | 74.46 | 100 | 96.47 | 188-189,235
267
+ Touch.js | 95.91 | 81.48 | 100 | 95.83 | 152,202
268
+ Use.js | 96.77 | 89.47 | 100 | 96.77 | 68
269
+ Ver.js | 90 | 66.66 | 100 | 90 | 25
270
+ Whoami.js | 83.33 | 60 | 80 | 83.33 | 27,35,48
271
+ index.js | 87.5 | 50 | 100 | 86.95 | 15,22,31
272
+ src/prompts | 100 | 100 | 50 | 100 |
273
+ MainPromptMock.js | 100 | 100 | 50 | 100 |
274
+ src/utils | 70.04 | 63.28 | 56.25 | 69.67 |
275
+ AliasManager.js | 100 | 91.66 | 100 | 100 | 47
276
+ ContactManager.js | 73.33 | 60 | 85.71 | 73.33 | 12,34-36
277
+ Fido2Client.js | 15.38 | 0 | 11.11 | 15.38 | 14-108
278
+ HelpProto.js | 91.59 | 84.05 | 100 | 91.45 | 49,153-154,171-176,195
279
+ Logger.js | 63.63 | 56.25 | 36.84 | 62.79 | ...25,37-49,57,65-69,74,84,88,93,105
280
+ --------------------|---------|----------|---------|---------|--------------------------------------
281
+
282
+ > secrez@2.1.0 posttest /Users/francescosullo/Projects/Secrez/secrez/packages/secrez
283
+ > nyc check-coverage --statements 65 --branches 50 --functions 65 --lines 65
258
284
 
259
- 166 passing (30s)
260
- 1 pending
261
- 1 failing
262
-
263
- 1) #Import
264
- should read a folder and import text and binary files:
265
-
266
- AssertionError: expected 'Invalid count value' to equal 'Imported files:'
267
- + expected - actual
268
-
269
- -Invalid count value
270
- +Imported files:
271
-
272
- at assertConsole (/Users/francescosullo/Projects/Secrez/secrez/packages/test-helpers/src/index.js:121:16)
273
- at Context.<anonymous> (test/commands/Import.test.js:331:5)
274
-
275
-
276
-
277
- -----------------------|---------|----------|---------|---------|-----------------------------------
278
- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
279
- -----------------------|---------|----------|---------|---------|-----------------------------------
280
- All files | 71.26 | 58.57 | 71.25 | 71.15 |
281
- src | 59.63 | 54.79 | 55 | 60.19 |
282
- Command.js | 79.66 | 78.72 | 76.92 | 81.03 | 32,55-62,73,80,119
283
- PreCommand.js | 21.95 | 11.54 | 14.29 | 21.95 | 8-99,116
284
- cliConfig.js | 100 | 100 | 100 | 100 |
285
- src/commands | 81.57 | 67.18 | 89.95 | 81.43 |
286
- Alias.js | 90.54 | 77.36 | 100 | 90.41 | 101,112,139,169,173,180,190
287
- Bash.js | 75 | 0 | 66.67 | 75 | 18-19
288
- Cat.js | 98.9 | 88.89 | 100 | 98.9 | 152
289
- Cd.js | 96.43 | 86.67 | 100 | 96.43 | 44
290
- Chat.js | 19.51 | 0 | 16.67 | 19.51 | 23-144
291
- Conf.js | 10.45 | 0 | 25 | 10.45 | 134-499
292
- Contacts.js | 74.67 | 65.98 | 92.86 | 74.5 | ...90-214,240,247,259,315,328,338
293
- Copy.js | 94.87 | 74.51 | 100 | 94.81 | 111,162,179,204
294
- Courier.js | 63.54 | 41.86 | 85.71 | 63.83 | ...37,152-171,188,200-203,215-221
295
- Ds.js | 92.54 | 82.05 | 100 | 92.42 | 99,108-113,125
296
- Edit.js | 13.58 | 0 | 40 | 13.58 | 88-214
297
- Export.js | 88.12 | 70.59 | 100 | 88.12 | ...75,185,197-201,206,218,227,230
298
- Find.js | 93.59 | 86.67 | 100 | 93.42 | 101,164,200-203,209
299
- Help.js | 100 | 80 | 100 | 100 | 29
300
- Import.js | 93.2 | 85.48 | 100 | 93.14 | ...65,367,387,393,441,456-463,490
301
- Lcat.js | 100 | 85.71 | 100 | 100 | 54
302
- Lcd.js | 95.65 | 81.82 | 100 | 95.65 | 50
303
- Lls.js | 95.45 | 72.73 | 100 | 95.45 | 97
304
- Lpwd.js | 92.31 | 100 | 100 | 92.31 | 36
305
- Ls.js | 91.3 | 75 | 100 | 90.77 | 103,114-116,130,181
306
- Mkdir.js | 100 | 66.67 | 100 | 100 | 38-44
307
- Mv.js | 88.04 | 73.21 | 100 | 87.78 | 93-99,133,155,165-172
308
- Paste.js | 87.23 | 75 | 100 | 87.23 | 72,78,81,89,113,129
309
- Pwd.js | 92.31 | 100 | 100 | 92.31 | 33
310
- Quit.js | 90 | 50 | 100 | 90 | 27
311
- Rm.js | 94 | 80.95 | 100 | 93.88 | 63,126,134
312
- Shell.js | 88.24 | 60 | 100 | 88.24 | 38,55
313
- Ssh.js | 25 | 0 | 40 | 25 | 72-120
314
- Tag.js | 98.04 | 92.31 | 100 | 98.02 | 122,171
315
- Totp.js | 96.47 | 74.47 | 100 | 96.47 | 188-189,235
316
- Touch.js | 95.92 | 81.48 | 100 | 95.83 | 152,202
317
- Use.js | 96.77 | 89.47 | 100 | 96.77 | 68
318
- Ver.js | 90 | 66.67 | 100 | 90 | 25
319
- Whoami.js | 93.1 | 63.64 | 80 | 93.1 | 29,64
320
- chat.js | 85.37 | 53.85 | 100 | 85.37 | 105,117-130,136,142
321
- index.js | 91.67 | 60 | 100 | 91.3 | 22,31
322
- src/commands/chat | 79.44 | 63.29 | 92.31 | 79.33 |
323
- Contacts.js | 80 | 42.86 | 80 | 80 | 54,65,69,81
324
- Help.js | 86.67 | 60 | 100 | 86.67 | 37-38
325
- Join.js | 95.65 | 82.61 | 100 | 95.56 | 43,110
326
- Leave.js | 100 | 60 | 100 | 100 | 24,28
327
- Quit.js | 100 | 75 | 100 | 100 | 24
328
- Send.js | 67.65 | 46.67 | 100 | 67.65 | 37,41,44,77,86-95
329
- Show.js | 68.75 | 70.59 | 100 | 68.75 | 74-78,87,102-108
330
- Whoami.js | 42.86 | 0 | 60 | 42.86 | 22,30-39
331
- src/prompts | 14.72 | 0 | 13.43 | 14.85 |
332
- ChatPrompt.js | 6.1 | 0 | 0 | 6.1 | 8-164
333
- ChatPromptMock.js | 100 | 100 | 66.67 | 100 |
334
- CommandPrompt.js | 9.8 | 0 | 0 | 9.93 | 24-318
335
- Completion.js | 4.41 | 0 | 0 | 4.48 | 6-103
336
- MainPromptMock.js | 100 | 100 | 66.67 | 100 |
337
- MultiEditorPrompt.js | 25 | 0 | 0 | 25 | 7-36
338
- SigintManager.js | 25 | 0 | 20 | 25 | 10-36
339
- src/utils | 69.92 | 63.28 | 56.25 | 69.55 |
340
- AliasManager.js | 100 | 91.67 | 100 | 100 | 47
341
- ContactManager.js | 71.43 | 60 | 85.71 | 71.43 | 12,35-37
342
- Fido2Client.js | 15.38 | 0 | 11.11 | 15.38 | 14-108
343
- HelpProto.js | 91.6 | 84.06 | 100 | 91.45 | 49,153-154,171-176,195
344
- Logger.js | 63.64 | 56.25 | 36.84 | 62.79 | ...37-49,57,65-69,74,84,88,93,105
345
- -----------------------|---------|----------|---------|---------|-----------------------------------
346
-  ELIFECYCLE  Test failed. See above for more details.
package/package.json CHANGED
@@ -1,41 +1,39 @@
1
1
  {
2
2
  "name": "secrez",
3
- "version": "1.1.6",
3
+ "version": "2.1.0",
4
4
  "license": "MIT",
5
5
  "nyc": {
6
6
  "include": "src",
7
7
  "exclude": []
8
8
  },
9
9
  "dependencies": {
10
- "@secrez/core": "~1.0.4",
11
- "@secrez/crypto": "~1.0.3",
12
- "@secrez/eth": "~0.0.3",
13
- "@secrez/fs": "~1.0.4",
14
- "@secrez/hub": "~0.2.2",
15
- "@secrez/utils": "~1.0.3",
10
+ "@secrez/core": "~1.0.5",
11
+ "@secrez/crypto": "~1.0.4",
12
+ "@secrez/eth": "~0.0.4",
13
+ "@secrez/fs": "~1.0.5",
14
+ "@secrez/utils": "~1.0.4",
16
15
  "case": "^1.6.3",
17
16
  "chalk": "^3.0.0",
18
17
  "clipboardy": "^2.3.0",
19
- "command-line-args": "^5.1.1",
18
+ "command-line-args": "^5.2.1",
20
19
  "external-editor": "^3.1.0",
21
20
  "fs-extra": "^9.1.0",
22
21
  "homedir": "^0.6.0",
23
- "inquirer": "^7.1.0",
22
+ "inquirer": "^7.3.3",
24
23
  "inquirer-command-prompt": "^0.1.0",
25
24
  "jimp": "^0.13.0",
26
- "lodash": "^4.17.15",
25
+ "lodash": "^4.17.21",
27
26
  "otplib": "^12.0.1",
27
+ "qrcode": "^1.5.4",
28
28
  "qrcode-reader": "^1.0.4",
29
- "superagent": "^5.3.1",
30
29
  "tiny-cli-editor": "^0.1.1"
31
30
  },
32
31
  "devDependencies": {
33
- "@secrez/courier": "~0.2.3",
34
- "@secrez/test-helpers": "~2.0.0",
35
- "chai": "^4.2.0",
32
+ "@secrez/test-helpers": "~2.0.1",
33
+ "chai": "^4.5.0",
36
34
  "chalk": "^3.0.0",
37
- "cross-env": "^7.0.2",
38
- "mocha": "^7.1.1",
35
+ "cross-env": "^7.0.3",
36
+ "mocha": "^7.2.0",
39
37
  "nyc": "^15.1.0",
40
38
  "test-console": "^1.1.0"
41
39
  },
package/src/PreCommand.js CHANGED
@@ -1,7 +1,5 @@
1
1
  const { chalk } = require("./utils/Logger");
2
2
  const Crypto = require("@secrez/crypto");
3
- const { utils: hubUtils } = require("@secrez/hub");
4
- const superagent = require("superagent");
5
3
 
6
4
  class PreCommand {
7
5
  async useEditor(options) {
@@ -99,23 +97,6 @@ class PreCommand {
99
97
  return result;
100
98
  }
101
99
  }
102
-
103
- async callCourier(_payload, port, caCrt, pathname) {
104
- const { payload, signature } = hubUtils.setPayloadAndSignIt(
105
- this.secrez,
106
- _payload
107
- );
108
- try {
109
- const res = await superagent
110
- .get(`https://localhost:${port}${pathname || ""}`)
111
- .set("Accept", "application/json")
112
- .query({ payload, signature })
113
- [caCrt ? "ca" : "trustLocalhost"](caCrt);
114
- return res.body;
115
- } catch (e) {
116
- return { error: e.message };
117
- }
118
- }
119
100
  }
120
101
 
121
102
  module.exports = PreCommand;