Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions lib/cmds/ocr_cmds/ocr-file.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
'use strict';

const { post } = require('../../api');
const print = require('../../print');

exports.command = 'ocr-file <projectId> <subjectId> <fileId>';
exports.desc = 'Submit file to be processed for OCR and Analytics if configured by <projectId> <subjectId> <fileId>. 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);
};