1.0.1 • Published 7 years ago

repoz v1.0.1

Weekly downloads
4
License
ISC
Repository
github
Last release
7 years ago

repoz-cli

npm CircleCI Codecov dependencies devDependencies

NPM

Repoz node client. Can be used both as npm pacakge or client tool

Repoz: http://repoz.dextra.com.br

Client (bin)

npm install -g repoz, may require sudo

Usage

Usage: repoz [options] [command]


Commands:

list [options] <project> [urlpath]             list (urlpath is optional, default '/')
get [options] <project> <urlpath> [filepath]   get (filepath is optional, default basename(urlpath))
post [options] <project> <filepath> <urlpath>  post
put [options] <project> <filepath> <urlpath>   put
delete [options] <project> <urlpath>           delete
help [cmd]                                     display help for [cmd]

Options:

-h, --help     output usage information
-V, --version  output the version number

Examples

1) repoz post myProject local/sub/folder/another.txt /sub/folder/file.txt

Saves local/sub/folder/another.txt to https://repoz.dextra.com.br/repoz/r/myProject/sub/folder/file.txt

2) repoz get myProject /sub/folder/file.txt

Downloads https://repoz.dextra.com.br/repoz/r/myProject/sub/folder/file.txt to ./file.txt

3) repoz delete myProject /sub/folder

Deletes everything under https://repoz.dextra.com.br/repoz/r/myProject/sub/folder

4) repoz list -r myProject

List all files under https://repoz.dextra.com.br/repoz/r/myProject/ recursively

5) repoz list myProject /sub/folder

List files only in https://repoz.dextra.com.br/repoz/r/myProject/sub/folder

Credentials

Credentials are stored into user local home folder, under ~/.repoz encrypted with aes192
Also the .cipher_key used for encryption is saved in to the same folder.
Username and password will be prompt only when needed, these are the rules:

  • Project has no credentials stored at all.
  • There are only read access type credentials stored for a write command.

Access type are read and write operations, and the relations with commands are this:

  • read : get, list
  • write: post, put, delete

Write access type credentials can be used for read commands. But read access type credentials cannot be used for write commands.

Because this client does not known the access type of the credentials, it tries to guess it. So, for the first time a credential was stored, and it was a read command, then its stored as read access type. But if the same credential its used for write command (after prompt), then the credential gets updated to write access type (and also the password in the process).

Credentials are updated when:

  • Password changes
  • Access type changes from read to write

Module (lib)

npm install --save repoz

Usage

var repoz = require('repoz');
var myProject = repoz.project('myProject', 'myUser', 'myPass')

myProject.list(urlpath, recursive)
myProject.get(urlpath, filepath)
myProject.put(filepath, urlpath) 
myProject.post(filepath, urlpath) 
myProject.delete(urlpath)

Remember that all commands are promises

Examples

Same examples from above

myProject.post('local/sub/folder/another.txt', '/sub/folder/file.txt');
myProject.get('/sub/folder/file.txt');
myProject.delete('/sub/folder/');
myProject.list('/', true);
myProject.list('/sub/folder');

Overall highligths

  • Auto remove all doubles '//'
  • Auto completion of the first '/', so is not needed
  • Auto fix broken query string '/?' for list command
  • Auto resolve path like ../other/file and ~/another/file
  • Credentials are stored, prompt once, use forever

Development

Documentation: http://repoz.dextra.com.br/repoz/docs.html

Install: npm install, may require sudo

Test: npm test

Coverage: ./run-coverage

Running client: ./bin/repoz. To run as repoz only, create a symbolik link with: npm link, may require sudo

To Do

1.0.1

7 years ago

1.0.0

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago