@hellena-sdk/hellena 1.0.0 → 1.0.2
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.
- package/README.md +20 -5
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,20 +1,35 @@
|
|
|
1
|
-
# hellena-
|
|
1
|
+
# hellena-SDK
|
|
2
2
|
|
|
3
3
|
A JavaScript SDK for the Hellena platform.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm
|
|
8
|
+
npm i @hellena-sdk/hellena
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```javascript
|
|
14
|
-
|
|
14
|
+
import { HellenaClient } from "@hellena-sdk/hellena";
|
|
15
|
+
import dotenv from "dotenv";
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
dotenv.config({ quiet: true });
|
|
18
|
+
|
|
19
|
+
const main = async () => {
|
|
20
|
+
const hellena = new HellenaClient(process.env.HELLENA_API_KEY!);
|
|
21
|
+
|
|
22
|
+
const product = await hellena.product.findOne({
|
|
23
|
+
id: "123"
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
return product
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
main().then((data) => {
|
|
30
|
+
console.log(data.barcode, data.name, data.quantity);
|
|
31
|
+
}).catch((error) => {
|
|
32
|
+
console.error("An error occurred:", error);
|
|
18
33
|
});
|
|
19
34
|
```
|
|
20
35
|
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hellena-sdk/hellena",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "dist/
|
|
5
|
+
"main": "dist/main.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc",
|
|
8
|
-
"start": "node dist/
|
|
8
|
+
"start": "node dist/main.js",
|
|
9
9
|
"pack": "mkdir -p packages && npm pack && mv *.tgz packages/",
|
|
10
10
|
"dev": "node --loader ts-node/esm src/index.ts"
|
|
11
11
|
},
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"access": "public"
|
|
14
14
|
},
|
|
15
15
|
"packDestination": "./packages",
|
|
16
|
-
"types": "dist/
|
|
16
|
+
"types": "dist/main.d.ts",
|
|
17
17
|
"exports": {
|
|
18
18
|
".": {
|
|
19
|
-
"import": "./dist/
|
|
20
|
-
"types": "./dist/
|
|
19
|
+
"import": "./dist/main.js",
|
|
20
|
+
"types": "./dist/main.d.ts"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"files": ["dist"],
|