Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpha - CLI, doc, report improvements #12

Merged
merged 5 commits into from
Oct 1, 2022
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ The following packages need to be installed before the the SDK will operate corr
- inquirer
You can install all dependencies at once with: `npm i adm-zip, asw-sdk axios box-plot cli-table commander configparser docx json2csv node-fetch xlsx inquirer`.

## SDK documentation for developers
Documentation for developers that want to consume the SDK is available [here](https://mediumroast.github.io/mediumroast_js/). The documentation will continue to improve over time so keep checking in on the doc.

# Command Line Interface (CLI) for the mediumroast.io
Inclued within this SDK is a CLI for users who are more inclined to use that tool for interacting with the system. These tools will be added and updated to over time as the system evolves. More information on the CLI is available in the [CLI User's Guide](./cli/CLI.md).

Expand Down
9 changes: 7 additions & 2 deletions cli/CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ To enable system management, setup of the environment for the CLIs, and backup/r
### CLI environment setup
To help users quickly get on board there is a setup utility that generates a configuration in *HOME/.mediumroast/config.ini*. Users are free to modify or create the file by hand.
#### Configure your environment to run the CLI
Command: `mr_setup --no_splash`
Command: `mr_setup`

Example output:

![mr_setup](https://user-images.githubusercontent.com/10818650/193343225-1b209b5f-3e2c-48b7-90d3-1427a55d07cf.jpg)

### Backup and restore
This utility enables a user with permissions to create full backup and perform a full restore of all core mediumroast.io objects.
Expand Down Expand Up @@ -198,5 +202,6 @@ Command: `company --report=1 --package`
Notice: This command saves the file to your environment's *HOME/Documents* directory called *<company_name>.zip*.

##### Screenshot of the resulting zip file in MacOS finder
*UPDATE ME*

![federos_package](https://user-images.githubusercontent.com/10818650/193343324-13917733-40f7-462e-bbc9-f600fbdf9d9c.jpg)

File renamed without changes.
11 changes: 6 additions & 5 deletions cli/mr_setup.js → cli/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ function parseCLIArgs() {
program
// System command line switches
.requiredOption(
'-n --no_splash',
'Whether or not to include the splash screen at startup.'
'-s --splash <yes | no>',
'Whether or not to include the splash screen at startup.',
'yes',
'no'
)

program.parse(process.argv)
Expand All @@ -40,7 +42,7 @@ function getEnv () {
return {
DEFAULT: {
// TODO Create choices for the rest_server so the user doesn't have to figure this out
rest_server: "http://cherokee.from-ca.com:46767",
rest_server: "http://cherokee.from-ca.com:16767",
user: "rflores", // For now we're not going to prompt for this it is a placeholder
secret: "password", // For now we're not going to prompt for this it is a placeholder
api_key: "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InJmbG9yZXMiLCJjb21wYW55IjoieCIsImlhdCI6MTY1NTAwNDM2NH0.znocDyjS4VSS9tu_ND-pUKw76yNgseUUHYpJ1Tq87do",
Expand Down Expand Up @@ -91,7 +93,6 @@ function splashScreen (simple=false) {
}

// Check to see if we are going to need to perform a setup operation or not.
// TODO if the config file exists we should warn the user
async function checkSetup(fileName) {
const utils = new Utilities('setup')
const [exists, message, result] = utils.checkFilesystemObject(fileName)
Expand Down Expand Up @@ -189,7 +190,7 @@ async function checkSection(env, sectionType) {
const myArgs = parseCLIArgs()

// Unless we suppress this print out the splash screen.
if (!myArgs.no_splash) {
if (myArgs.splash === 'yes') {
splashScreen()
}

Expand Down
24 changes: 15 additions & 9 deletions docs/Auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,13 @@
id="sidebarNav"
>

<div class="search-wrapper">
<input id="search" type="text" placeholder="Search docs..." class="input">
</div>

<nav>

<h2><a href="index.html">Documentation</a></h2><div class="category"><h3>Classes</h3><ul><li><a href="Auth.html">Auth</a></li><li><a href="baseObjects.html">baseObjects</a></li><li><a href="CLIUtilities.html">CLIUtilities</a></li><li><a href="Companies.html">Companies</a></li><li><a href="CompanySection.html">CompanySection</a></li><li><a href="CompanyStandalone.html">CompanyStandalone</a></li><li><a href="DOCXUtilities.html">DOCXUtilities</a></li><li><a href="Interactions.html">Interactions</a></li><li><a href="InteractionSection.html">InteractionSection</a></li><li><a href="InteractionStandalone.html">InteractionStandalone</a></li><li><a href="mrRest.html">mrRest</a></li><li><a href="Studies.html">Studies</a></li><li><a href="Users.html">Users</a></li><li><a href="Utilities.html">Utilities</a></li></ul><h3>Global</h3><ul><li><a href="global.html#basicComparisonRow">basicComparisonRow</a></li><li><a href="global.html#basicRow">basicRow</a></li><li><a href="global.html#basicTopicRow">basicTopicRow</a></li><li><a href="global.html#createObj">createObj</a></li><li><a href="global.html#createZIPArchive">createZIPArchive</a></li><li><a href="global.html#deleteObj">deleteObj</a></li><li><a href="global.html#descriptionRow">descriptionRow</a></li><li><a href="global.html#extractZIPArchive">extractZIPArchive</a></li><li><a href="global.html#findById">findById</a></li><li><a href="global.html#findByName">findByName</a></li><li><a href="global.html#findByX">findByX</a></li><li><a href="global.html#getAll">getAll</a></li><li><a href="global.html#getConfig">getConfig</a></li><li><a href="global.html#getEnv">getEnv</a></li><li><a href="global.html#getObj">getObj</a></li><li><a href="global.html#login">login</a></li><li><a href="global.html#logout">logout</a></li><li><a href="global.html#makeBookmark">makeBookmark</a></li><li><a href="global.html#makeBullet">makeBullet</a></li><li><a href="global.html#makeComparisonDOCX">makeComparisonDOCX</a></li><li><a href="global.html#makeDescriptionsDOCX">makeDescriptionsDOCX</a></li><li><a href="global.html#makeDocx">makeDocx</a></li><li><a href="global.html#makeDOCX">makeDOCX</a></li><li><a href="global.html#makeExternalHyperLink">makeExternalHyperLink</a></li><li><a href="global.html#makeFirmographicsDOCX">makeFirmographicsDOCX</a></li><li><a href="global.html#makeHeading1">makeHeading1</a></li><li><a href="global.html#makeHeading2">makeHeading2</a></li><li><a href="global.html#makeHeading3">makeHeading3</a></li><li><a href="global.html#makeHeadingBookmark1">makeHeadingBookmark1</a></li><li><a href="global.html#makeHeadingBookmark2">makeHeadingBookmark2</a></li><li><a href="global.html#makeInternalHyperLink">makeInternalHyperLink</a></li><li><a href="global.html#makeIntro">makeIntro</a></li><li><a href="global.html#makeParagraph">makeParagraph</a></li><li><a href="global.html#makeReferencesDOCX">makeReferencesDOCX</a></li><li><a href="global.html#makeTextrun">makeTextrun</a></li><li><a href="global.html#outputCLI">outputCLI</a></li><li><a href="global.html#pageBreak">pageBreak</a></li><li><a href="global.html#parseCLIArgs">parseCLIArgs</a></li><li><a href="global.html#patchObj">patchObj</a></li><li><a href="global.html#postObj">postObj</a></li><li><a href="global.html#rankTags">rankTags</a></li><li><a href="global.html#readTextFile">readTextFile</a></li><li><a href="global.html#rmDir">rmDir</a></li><li><a href="global.html#s3DownloadObjs">s3DownloadObjs</a></li><li><a href="global.html#safeMakedir">safeMakedir</a></li><li><a href="global.html#saveTextFile">saveTextFile</a></li><li><a href="global.html#topicTable">topicTable</a></li><li><a href="global.html#updateObj">updateObj</a></li><li><a href="global.html#urlRow">urlRow</a></li><li><a href="global.html#writeReport">writeReport</a></li></ul></div>
<h2><a href="index.html">Documentation</a></h2><div class="category"><h3>Classes</h3><ul><li><a href="Auth.html">Auth</a></li><li><a href="baseObjects.html">baseObjects</a></li><li><a href="CLIUtilities.html">CLIUtilities</a></li><li><a href="Companies.html">Companies</a></li><li><a href="CompanySection.html">CompanySection</a></li><li><a href="CompanyStandalone.html">CompanyStandalone</a></li><li><a href="DOCXUtilities.html">DOCXUtilities</a></li><li><a href="Interactions.html">Interactions</a></li><li><a href="InteractionSection.html">InteractionSection</a></li><li><a href="InteractionStandalone.html">InteractionStandalone</a></li><li><a href="mrRest.html">mrRest</a></li><li><a href="Studies.html">Studies</a></li><li><a href="Users.html">Users</a></li><li><a href="Utilities.html">Utilities</a></li></ul><h3>Global</h3><ul><li><a href="global.html#basicComparisonRow">basicComparisonRow</a></li><li><a href="global.html#basicRow">basicRow</a></li><li><a href="global.html#basicTopicRow">basicTopicRow</a></li><li><a href="global.html#checkFilesystemObject">checkFilesystemObject</a></li><li><a href="global.html#createObj">createObj</a></li><li><a href="global.html#createZIPArchive">createZIPArchive</a></li><li><a href="global.html#deleteObj">deleteObj</a></li><li><a href="global.html#descriptionRow">descriptionRow</a></li><li><a href="global.html#extractZIPArchive">extractZIPArchive</a></li><li><a href="global.html#findById">findById</a></li><li><a href="global.html#findByName">findByName</a></li><li><a href="global.html#findByX">findByX</a></li><li><a href="global.html#getAll">getAll</a></li><li><a href="global.html#getConfig">getConfig</a></li><li><a href="global.html#getEnv">getEnv</a></li><li><a href="global.html#getObj">getObj</a></li><li><a href="global.html#login">login</a></li><li><a href="global.html#logout">logout</a></li><li><a href="global.html#makeBookmark">makeBookmark</a></li><li><a href="global.html#makeBullet">makeBullet</a></li><li><a href="global.html#makeComparisonDOCX">makeComparisonDOCX</a></li><li><a href="global.html#makeDescriptionsDOCX">makeDescriptionsDOCX</a></li><li><a href="global.html#makeDocx">makeDocx</a></li><li><a href="global.html#makeDOCX">makeDOCX</a></li><li><a href="global.html#makeExternalHyperLink">makeExternalHyperLink</a></li><li><a href="global.html#makeFirmographicsDOCX">makeFirmographicsDOCX</a></li><li><a href="global.html#makeHeading1">makeHeading1</a></li><li><a href="global.html#makeHeading2">makeHeading2</a></li><li><a href="global.html#makeHeading3">makeHeading3</a></li><li><a href="global.html#makeHeadingBookmark1">makeHeadingBookmark1</a></li><li><a href="global.html#makeHeadingBookmark2">makeHeadingBookmark2</a></li><li><a href="global.html#makeInternalHyperLink">makeInternalHyperLink</a></li><li><a href="global.html#makeIntro">makeIntro</a></li><li><a href="global.html#makeParagraph">makeParagraph</a></li><li><a href="global.html#makeReferencesDOCX">makeReferencesDOCX</a></li><li><a href="global.html#makeTextrun">makeTextrun</a></li><li><a href="global.html#outputCLI">outputCLI</a></li><li><a href="global.html#pageBreak">pageBreak</a></li><li><a href="global.html#parseCLIArgs">parseCLIArgs</a></li><li><a href="global.html#patchObj">patchObj</a></li><li><a href="global.html#postObj">postObj</a></li><li><a href="global.html#rankTags">rankTags</a></li><li><a href="global.html#readTextFile">readTextFile</a></li><li><a href="global.html#rmDir">rmDir</a></li><li><a href="global.html#s3DownloadObjs">s3DownloadObjs</a></li><li><a href="global.html#safeMakedir">safeMakedir</a></li><li><a href="global.html#saveTextFile">saveTextFile</a></li><li><a href="global.html#topicTable">topicTable</a></li><li><a href="global.html#updateObj">updateObj</a></li><li><a href="global.html#urlRow">urlRow</a></li><li><a href="global.html#writeReport">writeReport</a></li></ul></div>

</nav>
</div>
Expand All @@ -87,7 +91,7 @@ <h1>Auth</h1>

<h2><span class="attribs"><span class="type-signature"></span></span>Auth<span class="signature">(restServer, apiKey, user, secret)</span><span class="type-signature"></span></h2>

<div class="class-description">An implementation for authenticating into the mediumroast.io application.</div>
<div class="class-description"><p>An implementation for authenticating into the mediumroast.io application.</p></div>


</header>
Expand Down Expand Up @@ -120,9 +124,9 @@ <h4 class="name" id="Auth">


<div class="description">
The present development is very simple and largely a placeholder. After the object is constructed
the user would issue a login to generate the credential for usage in the API to talk to the
mediumroast.io application and gather create, read, deleted and update various objects.
<p>The present development is very simple and largely a placeholder. After the object is constructed
the user would issue a login to generate the credential for usage in the API to talk to the
mediumroast.io application and gather create, read, deleted and update various objects.</p>
</div>


Expand Down Expand Up @@ -176,7 +180,7 @@ <h5>Parameters:</h5>



<td class="description last">the full URL and TCP/IP port for the mediumroast.io application</td>
<td class="description last"><p>the full URL and TCP/IP port for the mediumroast.io application</p></td>
</tr>


Expand All @@ -201,7 +205,7 @@ <h5>Parameters:</h5>



<td class="description last">the API key for the mediumroast.io application</td>
<td class="description last"><p>the API key for the mediumroast.io application</p></td>
</tr>


Expand All @@ -226,7 +230,7 @@ <h5>Parameters:</h5>



<td class="description last">your username for the mediumroast.io application</td>
<td class="description last"><p>your username for the mediumroast.io application</p></td>
</tr>


Expand All @@ -251,7 +255,7 @@ <h5>Parameters:</h5>



<td class="description last">your secret for the mediumroast.io application</td>
<td class="description last"><p>your secret for the mediumroast.io application</p></td>
</tr>


Expand Down Expand Up @@ -386,6 +390,8 @@ <h5>Parameters:</h5>
<script>PR.prettyPrint();</script>
<script src="scripts/linenumber.js"> </script>

<script src="scripts/search.js"> </script>


</body>
</html>
Loading