Skip to content

Commit 832bea6

Browse files
committed
documentation
1 parent 1699bba commit 832bea6

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,20 @@ $ yarn add @chriscdn/cs-rest
2727
Using unpkg CDN:
2828

2929
```html
30+
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js"></script>
3031
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
31-
<script src="https://unpkg.com/browse/@chriscdn/cs-rest/lib/index.min.js"></script>
32+
<script src="https://unpkg.com/@chriscdn/cs-rest/lib/index.min.js"></script>
3233
```
3334

3435
## Example
3536

3637
Authenticate with a username and password and get the details of a node:
3738

3839
```js
39-
const {Session} = require('@chriscdn/cs-rest')
40+
const CSREST = require('@chriscdn/cs-rest')
4041

4142
// session wraps an axios instance
42-
const session = new Session({
43+
const session = new CSREST.Session({
4344
baseURL: 'https://.../cs.exe',
4445
username: 'Admin',
4546
password: '******'
@@ -52,7 +53,7 @@ const response = await session.get('/api/v1/nodes/2000')
5253
Authenticate with an `OTCSTicket`:
5354

5455
```js
55-
const session = auth({
56+
const session = new CSREST.Session({
5657
baseURL: 'https://.../cs.exe',
5758
otcsticket: '<token>'
5859
})
@@ -66,7 +67,7 @@ Content Server returns a fresh `OTCSTicket` with each successful API call. The
6667

6768
#### POST, PUT, & PATCH
6869

69-
The OpenText Content Server REST API doesn't accept requests that use the `application/json` content type. This means POST, PUT, & PATCH requests need to use a content type of `multipart/form-data`, which makes writing the request a little verbose. For example, to create a new folder:
70+
The OpenText Content Server REST API doesn't accept requests that use the `application/json` content type. This means post, put, & patch requests need to use a content type of `multipart/form-data`, which makes writing the request a little more verbose. For example, to create a new folder:
7071

7172
```js
7273
const formData = new FormData()
@@ -123,6 +124,4 @@ See the `src/` directory for more examples.
123124

124125
## License
125126

126-
[MIT](LICENSE)
127-
128-
127+
[MIT](LICENSE)

package.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
{
22
"name": "@chriscdn/cs-rest",
3-
"version": "1.0.3",
4-
"description": "An authentication and wrapper for the OpenText Content Server REST API.",
3+
"version": "1.0.4",
4+
"description": "Simplified authentication and REST calls for OpenText Content Server.",
55
"main": "lib/index.cjs.js",
66
"module": "lib/index.es.js",
77
"unpkg": "lib/index.min.js",
88
"repository": "https://github.com/chriscdn/cs-rest",
99
"author": "Christopher Meyer",
1010
"license": "MIT",
11+
"scripts": {
12+
"build": "rollup -c"
13+
},
1114
"dependencies": {
1215
"@babel/runtime-corejs3": "^7.9.2",
1316
"axios": "^0.19.2",
1417
"form-data": "^3.0.0",
1518
"lodash.get": "^4.4.2"
1619
},
17-
"keywords": [
18-
"opentext",
19-
"content server"
20-
],
2120
"devDependencies": {
2221
"@babel/core": "^7.9.0",
2322
"@babel/preset-env": "^7.9.0",
@@ -26,5 +25,11 @@
2625
"@rollup/plugin-replace": "^2.3.1",
2726
"rollup-plugin-babel": "^4.4.0",
2827
"rollup-plugin-terser": "^5.3.0"
29-
}
28+
},
29+
"keywords": [
30+
"opentext",
31+
"content-server",
32+
"rest",
33+
"axios"
34+
]
3035
}

0 commit comments

Comments
 (0)