From c5c4626236b1ee4f9e78f5a00b71ebf04302a0ef Mon Sep 17 00:00:00 2001 From: David Taylor Date: Tue, 24 Nov 2020 12:51:46 -0500 Subject: [PATCH 1/3] Updated package.json and yarn.lock --- package.json | 3 ++- yarn.lock | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5b018f3..35dfbff 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,8 @@ "stream-csv-as-json": "^1.0.1", "stream-json": "^1.2.1", "uuid": "^3.3.2", - "yargs": "^12.0.5" + "yargs": "^12.0.5", + "yarn": "^1.22.4" }, "devDependencies": { "@lifeomic/eslint-plugin-node": "^1.3.0", diff --git a/yarn.lock b/yarn.lock index e3d5b7c..5627fc1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5548,3 +5548,8 @@ yargs@^12.0.5: which-module "^2.0.0" y18n "^3.2.1 || ^4.0.0" yargs-parser "^11.1.1" + +yarn@^1.22.4: + version "1.22.4" + resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.22.4.tgz#01c1197ca5b27f21edc8bc472cd4c8ce0e5a470e" + integrity sha512-oYM7hi/lIWm9bCoDMEWgffW8aiNZXCWeZ1/tGy0DWrN6vmzjCXIKu2Y21o8DYVBUtiktwKcNoxyGl/2iKLUNGA== From 20b85e3907a5db2587d187fac791abda5ce3c349 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Tue, 24 Nov 2020 13:12:28 -0500 Subject: [PATCH 2/3] Added ocr-file command to ocr commands that triggers OCR on a given fileId. --- lib/cmds/ocr_cmds/ocr-file.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lib/cmds/ocr_cmds/ocr-file.js diff --git a/lib/cmds/ocr_cmds/ocr-file.js b/lib/cmds/ocr_cmds/ocr-file.js new file mode 100644 index 0000000..a30b5cc --- /dev/null +++ b/lib/cmds/ocr_cmds/ocr-file.js @@ -0,0 +1,28 @@ +'use strict'; + +const { post } = require('../../api'); +const print = require('../../print'); + +exports.command = 'ocr-file '; +exports.desc = 'Submit file to be processed for OCR and Analytics if configured by . NOTE: This will create an extra OCR specfic Document Reference.'; +exports.builder = yargs => { + yargs.positional('projectId', { + describe: 'The ID of the project.', + type: 'string' + }).positional('subjectId', { + describe: 'The subject ID.', + type: 'string' + }).positional('fileId', { + describe: 'The ID of the file to OCR.', + type: 'string' + }); +}; + +exports.handler = async argv => { + const response = await post(argv, '/v1/ocr/documents', { + project: argv.projectId, + subject: argv.subjectId, + fileId: argv.fileId + }); + print(response.data, argv); +}; From c4420d2640bf1995b37f2ce65fad64dcf7735439 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Tue, 24 Nov 2020 13:16:31 -0500 Subject: [PATCH 3/3] undid change to package.json and yarn.lock --- package.json | 3 +-- yarn.lock | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/package.json b/package.json index 62c0ff2..e2d78e3 100644 --- a/package.json +++ b/package.json @@ -47,8 +47,7 @@ "stream-csv-as-json": "^1.0.1", "stream-json": "^1.2.1", "uuid": "^3.3.2", - "yargs": "^12.0.5", - "yarn": "^1.22.4" + "yargs": "^12.0.5" }, "devDependencies": { "@lifeomic/eslint-plugin-node": "^1.3.0", diff --git a/yarn.lock b/yarn.lock index ab777da..b0754b3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5548,8 +5548,3 @@ yargs@^12.0.5: which-module "^2.0.0" y18n "^3.2.1 || ^4.0.0" yargs-parser "^11.1.1" - -yarn@^1.22.4: - version "1.22.4" - resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.22.4.tgz#01c1197ca5b27f21edc8bc472cd4c8ce0e5a470e" - integrity sha512-oYM7hi/lIWm9bCoDMEWgffW8aiNZXCWeZ1/tGy0DWrN6vmzjCXIKu2Y21o8DYVBUtiktwKcNoxyGl/2iKLUNGA==