@hailer/cli 1.1.7 → 1.1.8
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 +11 -44
- package/dist/src/client.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -10,30 +10,16 @@ Tab completion is available.
|
|
|
10
10
|
|
|
11
11
|
The result of each command is stored in the `result` variable.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
```sh
|
|
16
|
-
npx @hailer/cli
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
### Install
|
|
13
|
+
## Install
|
|
20
14
|
|
|
21
15
|
```sh
|
|
22
16
|
npm install -g @hailer/cli
|
|
23
17
|
```
|
|
24
18
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
```sh
|
|
28
|
-
USER=my@email.com HOST=api.hailer.biz hailer-cli
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Run on Windows
|
|
19
|
+
Usage:
|
|
32
20
|
|
|
33
21
|
```sh
|
|
34
|
-
|
|
35
|
-
set HOST=api.hailer.biz
|
|
36
|
-
hailer-cli
|
|
22
|
+
hailer-cli --user my.email@hailer.com
|
|
37
23
|
```
|
|
38
24
|
|
|
39
25
|
### Example usage
|
|
@@ -63,13 +49,14 @@ npm init
|
|
|
63
49
|
npm install @hailer/cli
|
|
64
50
|
```
|
|
65
51
|
|
|
66
|
-
Create a new file `run.js` and paste the following code:
|
|
52
|
+
Create a new file `run.js` and paste the following code (and works with typescript using the import line):
|
|
67
53
|
|
|
68
54
|
```javascript
|
|
55
|
+
// import { Client } from '@hailer/cli'; // Use with typescript
|
|
69
56
|
const { Client } = require('@hailer/cli');
|
|
70
57
|
|
|
71
58
|
const options = {
|
|
72
|
-
host: 'https://api.hailer.
|
|
59
|
+
host: 'https://api.hailer.com',
|
|
73
60
|
username: 'set-this',
|
|
74
61
|
password: 'set-this',
|
|
75
62
|
};
|
|
@@ -92,15 +79,16 @@ Start the program:
|
|
|
92
79
|
node run.js
|
|
93
80
|
```
|
|
94
81
|
|
|
95
|
-
Have fun!
|
|
96
|
-
|
|
97
82
|
### Inside async function
|
|
98
83
|
|
|
99
84
|
```javascript
|
|
85
|
+
// import { Client } from '@hailer/cli';
|
|
100
86
|
const { Client } = require('@hailer/cli');
|
|
101
87
|
|
|
88
|
+
// ...
|
|
89
|
+
|
|
102
90
|
const options = {
|
|
103
|
-
host: 'https://api.hailer.
|
|
91
|
+
host: 'https://api.hailer.com',
|
|
104
92
|
username: 'set-this',
|
|
105
93
|
password: 'set-this',
|
|
106
94
|
};
|
|
@@ -110,27 +98,6 @@ const client = await Client.create(options);
|
|
|
110
98
|
const post = await client.request('wall2.new_post', [{ subject: 'This is a wall post.', text: 'The content of my post' }]);
|
|
111
99
|
|
|
112
100
|
console.log('Post created:', post);
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
### Login using existing Hailer session key
|
|
116
|
-
|
|
117
|
-
Re-using a Hailer `sessionKey` instead of logging in using username and password.
|
|
118
|
-
|
|
119
|
-
```javascript
|
|
120
|
-
const { Client } = require('@hailer/cli');
|
|
121
|
-
|
|
122
|
-
const options = {
|
|
123
|
-
host: 'https://api.hailer.biz',
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
Client.create(options).then(async (client) => {
|
|
127
|
-
await client.resume(sessionKey);
|
|
128
|
-
const post = await client.request('wall2.new_post', [{ subject: 'This is a wall post.', text: 'The content of my post' }]);
|
|
129
|
-
|
|
130
|
-
console.log('Post created:', post);
|
|
131
|
-
client.disconnect();
|
|
132
|
-
});
|
|
133
101
|
|
|
102
|
+
client.disconnect();
|
|
134
103
|
```
|
|
135
|
-
|
|
136
|
-
Set the `sessionKey` parameter which you have acquired by some other means.
|
package/dist/src/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,2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AAE,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAC3F,CAAC;KAAA;IAED,gCAAgC;IAC1B,gBAAgB,CAAC,IAAY;;YAC/B,MAAM,UAAU,GAAG,IAAA,qBAAgB,EAAC,IAAI,CAAC,CAAC;YAC1C,OAAO,MAAM,IAAA,oBAAM,EAAC,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAA,eAAQ,EAAC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAC/G,CAAC;KAAA;IAED,UAAU;;QACN,MAAA,IAAI,CAAC,MAAM,0CAAE,UAAU,EAAE,CAAC;IAC9B,CAAC;IAAA,CAAC;CACL;AAjKD,wBAiKC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hailer/cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "Hailer CLI",
|
|
5
5
|
"main": "./dist/src/index",
|
|
6
6
|
"types": "./dist/src/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"lint": "eslint --ext .ts ."
|
|
12
12
|
},
|
|
13
13
|
"bin": {
|
|
14
|
-
"hailer-cli": "
|
|
14
|
+
"hailer-cli": "bin/hailer-cli"
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|