You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-13Lines changed: 21 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,23 +5,23 @@ _CWMS Data API (CDA) client library created with OpenAPI generator in TypeScript
5
5
## Getting Started
6
6
7
7
- Install CWMSjs to your react project with:
8
-
`npm install cwmsjs --save`
8
+
`npm install cwmsjs`
9
9
(This will grab the latest)
10
10
11
11
- Import the API endpoint you wish to use:
12
12
- Avaiable endpoints are here (Classes ending in API): [Endpoints](https://hydrologicengineeringcenter.github.io/cwms-data-api-client-javascript/modules.html)
13
13
- At the top of your js/jsx/file type:
14
14
```javascript
15
-
import { TimeseriesAPI } from"cwmsjs";
15
+
import { TimeSeriesAPI } from"cwmsjs";
16
16
```
17
-
- Then initialize the TimeseriesAPI with:
17
+
- Then initialize the TimeSeriesAPI with:
18
18
```javascript
19
-
const tsa = new TimeseriesAPI();
19
+
const ts_api = new TimeSeriesAPI();
20
20
```
21
-
- Fetch timeseries data with:
21
+
- Fetch time series data with:
22
22
```javascript
23
23
await ts_api
24
-
.getTimeseries({
24
+
.getTimeSeries({
25
25
office: "SWT",
26
26
name: "KEYS.Elev.Inst.1Hour.0.Ccp-Rev",
27
27
})
@@ -38,15 +38,23 @@ Documentation is available for both developers and new users:
38
38
- New Users : [Examples](https://hydrologicengineeringcenter.github.io/cwms-data-api-client-javascript/examples/)
CDA is expected to at some point expose a CalVer for the latest update. Whenthis is available, the generation date will be replaced with the current CDA CalVer.
47
+
48
+
### Publishing
49
+
Contributors with authorization can publish a newversionof cwmsjs by manually running the "Build, Test, and Publish" GitHub Action.
46
50
47
-
### Run the following commands to build the project:
51
+
The workflow will build an updated cwmsjs library using the current generator and national CDA instance OpenAPI spec. If all tests pass, the library will be published to npm and updated documentation will be deployed to GitHub Pages.
48
52
53
+
## Building CWMSjs from source
54
+
55
+
- Clone this repository
56
+
- Install dependencies with:`npm install`
49
57
- Run the generator with:
50
-
`npm run openapi`
51
-
- Transpile the typescript
52
58
`npm run build`
59
+
60
+
All generated files (source, library, and docs) will be in`[repo]/cwmsjs`
0 commit comments