From 8d5f2b2af5854a0b30530ac7070dad713b7d8637 Mon Sep 17 00:00:00 2001 From: David Paul Graham Date: Wed, 30 Jun 2021 21:24:33 -0400 Subject: [PATCH] docs: update readme and Todo --- README.md | 67 +++++++++++++++++++++++++++++++++++++++---------------- ToDo.md | 15 +++++++++++++ 2 files changed, 63 insertions(+), 19 deletions(-) create mode 100644 ToDo.md diff --git a/README.md b/README.md index 2cb5283..779afad 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,12 @@ The API on this package is liable to break w/o warning on a regular basis for th - [Intro](#Intro) - [Installation](#installation) - [Environment Variables](#environment-variables) - - [Example](#examples) - - [Site Exist](#site-exist) + - [Examples](#examples) + - [Site Services](#site-services) - [Manifest UI Link](#manifests-ui-link) + - [RCRAInfo Lookup Services](#rcrainfo-lookup) + - [e-Manifest Lookup Services](#e-manifest-lookup) + - [License](#license) ## Intro This packages aims to make using the e-Manifest API easier to consume. For additional information about e-Manifest, check out the below links @@ -26,12 +29,14 @@ This packages aims to make using the e-Manifest API easier to consume. For addit - [RCRAifno PreProduction](https://rcrainfopreprod.epa.gov) - [USEPA/e-Manifest Github](https://github.com/USEPA/e-manifest) - [About e-Manifest](https://www.epa.gov/e-manifest) + + All haztrak functions are asynchronous ## Installation ```bash $ npm install haztrak ``` -haztrak uses ES6 module syntax, see [Node's doc](https://nodejs.org/api/packages.html#packages_modules_packages) +haztrak uses ES6 module syntax, see [Node's doc](https://nodejs.org/api/packages.html#packages_modules_packages) for more information. ## Environment Variables @@ -48,33 +53,48 @@ Note: you'll need Site Manager level access to at least one EPA ID to get an API ## Examples -#### Site Exist and Site Details +#### Site Services ```javascript import haztrak from 'haztrak' -const siteID = 'VATEST000001' -const siteIdCheck = haztrak.siteExist(siteID) - -const siteInfo = haztrak.siteDetails(siteID) +const foobar = async () => { + const siteID = 'VATEST000001' + const siteIdCheck = await haztrak.siteExist(siteID) + const siteInfo = await haztrak.siteDetails(siteID) +} ``` - - #### manifests UI link +Returns a hyperlink to view or sign manifest(s) in RCRAinfo as the specified facility + +See [ToDo.md](ToDo.md) for future changes to api ```javascript import haztrak from 'haztrak' -const siteID = 'VATEST000001' -const page = 'BulkSign' -const mtn = ['000000001ELC', '000000002ELC', '000000003ELC'] -const siteIdCheck = haztrak.eManLink(page, siteID, mtn) +const foobar = async () => { + const siteID = 'VATEST000001' + const page = 'BulkSign' + const mtn = ['000000001ELC', '000000002ELC', '000000003ELC'] + const siteIdCheck = await haztrak.eManLink(page, siteID, mtn) +} ``` +'page' argument options include + +```'BulkSign'``` → Sign/Certify all manifest in the array +```'DashBoard'``` → link to the e-Manifest dashboard +```'BulkQuickSign'```→ Quick sign all manifests in the array (mtn) +```'Edit'```→ +```'View'```→ +```'Sign'```→ +only 1 MTN allowed for Edt, View, or Sign -#### RCRAInfo Lookup services +#### RCRAInfo Lookup ```javascript import haztrak from 'haztrak' -denCities = haztrak.lookup('den') +const foo = async () => { + const denCities = await haztrak.lookup('den') +} ```` haztrak.lookup accepts one of the below string - ```'den'``` → Density code @@ -85,15 +105,22 @@ haztrak.lookup accepts one of the below string - ```'min'``` → Waste minimization codes - ```'ports'``` → Ports of entry +#### e-Manifest Lookup +haztrak.eMaLlookup accepts one of the below strings. Parameters with 'filt require additional arguements -#### e-Manifest Lookup services +This will change to an object in version 2.0. See [ToDo.md](ToDo.md) ```javascript import haztrak from 'haztrak' -shippingNames = haztrak.eManLookup('name') +const foo = async () => { + const shippingNames = await haztrak.eManLookup('name') + console.log(shippingNames) + + const hazClass = await haztrak.eManLookup('haz-filt', 'Acetal', 'UN1088') + console.log(hazClass) +} ```` -haztrak.eMaLlookup accepts one of the below string - ```'name'``` → DOT shipping name - ```'id'``` → DOT ID number - ```'haz'``` → DOT hazard classes @@ -108,3 +135,5 @@ haztrak.eMaLlookup accepts one of the below string - ```'id-filt'``` → DOT Id Numbers by DOT Proper Shipping name - ```'name-filt'``` → DOT Proper Shipping names by DOT Id Number +## License +haztrak is licensed under the terms of the [MIT license](LICENSE.md) \ No newline at end of file diff --git a/ToDo.md b/ToDo.md new file mode 100644 index 0000000..9cb7cc3 --- /dev/null +++ b/ToDo.md @@ -0,0 +1,15 @@ +# To Do + +## general +- [ ] eManifest save/corret/update/delete +- [ ] new manifest object constructor + - constructor with methods to create new manifest +- [ ] Local session token storage + - store session tokens insteaed of requesting a new token for each request + +## haztrak v2.0 +- [ ] manifest UI link arguments to object +- [ ] eManifest Lookup arguments to object + - convert the multiargument functions to single argument +- [ ] return object type + - convert responses to object type \ No newline at end of file