Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
docs: update readme and Todo
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgraham4401 committed Jul 1, 2021
1 parent 0a54e13 commit 8d5f2b2
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 19 deletions.
67 changes: 48 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,27 @@ 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
- [RCRAInfo](https://rcrainfo.epa.gov)
- [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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)
15 changes: 15 additions & 0 deletions ToDo.md
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8d5f2b2

Please sign in to comment.