totalum-api-sdk 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.MD +45 -1
  2. package/index.ts +1 -1
  3. package/package.json +1 -1
package/README.MD CHANGED
@@ -1,3 +1,47 @@
1
1
  ## Totalum api sdk wraper
2
2
 
3
- This library wraps the totalum public api, so you can easy call all endpoints
3
+ This library wraps the totalum public api, so you can easy call all endpoints.
4
+
5
+
6
+ ## Usage:
7
+
8
+ ```bash
9
+ npm i totalum-api-sdk
10
+ ```
11
+
12
+
13
+ ```javascript
14
+ // IN TYPESCRIPT
15
+
16
+ import {AuthOptions, TotalumApiSdk} from 'totalum-api-sdk';
17
+
18
+ const options: AuthOptions = {
19
+ token:{
20
+ accessToken: 'YOUR TOKEN'
21
+ }
22
+ }
23
+
24
+
25
+ const totalumClient = new TotalumApiSdk(options);
26
+
27
+ // execute some function
28
+
29
+ const result = await totalumClient.getItems('your_item', {});
30
+ ```
31
+
32
+ ```javascript
33
+ // IN JAVASCRIPT
34
+
35
+ const totalum = require('totalum-api-sdk');
36
+
37
+ const options = {
38
+ token:{
39
+ accessToken: 'YOUR TOKEN'
40
+ }
41
+ }
42
+
43
+ const totalumClient = new totalum.TotalumApiSdk(options);
44
+
45
+ const result = await totalumClient.getItems('your_item', {});
46
+
47
+ ```
package/index.ts CHANGED
@@ -112,7 +112,7 @@ export class TotalumApiSdk {
112
112
  this.authOptions = authOptions;
113
113
  if (this.authOptions.token?.accessToken){
114
114
  this.headers = {
115
- authorization: 'Bearer ' + this.authOptions.token.accessToken
115
+ authorization: this.authOptions.token.accessToken
116
116
  }
117
117
  } else if(this.authOptions.apiKey?.apiKey && this.authOptions.apiKey?.organizationId) {
118
118
  this.headers = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "totalum-api-sdk",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Totalum sdk wraper of totalum api",
5
5
  "main": "index.js",
6
6
  "scripts": {