box-view-cli
Advanced tools
Comparing version 0.7.0 to 0.8.0-annotations
@@ -6,3 +6,4 @@ var open = require('open'), | ||
module.exports = function (prog) { | ||
function requestSession(cmd) { | ||
function validateParams(cmd) { | ||
var params = {}; | ||
@@ -22,3 +23,20 @@ | ||
} | ||
if (cmd.annotations) { | ||
params['is_annotatable'] = true; | ||
if (!cmd.authorName) { | ||
throw new Error('--author-name is required when annotations are enabled'); | ||
} | ||
if (!cmd.authorId) { | ||
throw new Error('--author-id is required when annotations are enabled'); | ||
} | ||
params['author_name'] = cmd.authorName || 'Test User'; | ||
params['author_external_id'] = cmd.authorId || 1; | ||
} | ||
return params; | ||
} | ||
function requestSession(cmd) { | ||
var params = validateParams(cmd); | ||
if (cmd.documentId) { | ||
@@ -53,2 +71,5 @@ debug('session requested with document id "%s"', cmd.documentId); | ||
['-T, --disable-text', 'disable text selection'], | ||
['-a, --annotations', 'enable annotations'], | ||
['-N, --author-name [authorName]', 'annotation author name'], | ||
['-A, --author-id [authorId]', 'annotation author id'], | ||
['-o, --open', 'open the viewing session URL on success'] | ||
@@ -55,0 +76,0 @@ ], |
{ | ||
"name": "box-view-cli", | ||
"version": "0.7.0", | ||
"version": "0.8.0-annotations", | ||
"description": "A CLI for Box View API", | ||
@@ -5,0 +6,0 @@ "author": "Cameron Lakenen <lakenen@box.com>", |
@@ -88,9 +88,12 @@ # Box View API CLI | ||
-h, --help output usage information | ||
-i, --document-id [id] the document ID | ||
-d, --duration [duration] the duration (in minutes) of the session | ||
-e, --expires [expires] the timestamp at which this session should expire | ||
-D, --downloadable allow downloads | ||
-T, --disable-text disable text selection | ||
-o, --open open the viewing session URL on success | ||
-h, --help output usage information | ||
-i, --document-id [id] the document ID | ||
-d, --duration [duration] the duration (in minutes) of the session | ||
-e, --expires [expires] the timestamp at which this session should expire | ||
-D, --downloadable allow downloads | ||
-T, --disable-text disable text selection | ||
-a, --annotations enable annotations | ||
-N, --author-name [authorName] annotation author name | ||
-A, --author-id [authorId] annotation author id | ||
-o, --open open the viewing session URL on success | ||
``` | ||
@@ -97,0 +100,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22952
469
144