@sockethub/platform-irc 4.0.0-alpha.6 → 4.0.0-alpha.7
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/dist/index.js +2194 -0
- package/dist/index.js.map +23 -0
- package/package.json +23 -10
- package/API.md +0 -421
- package/typedoc.json +0 -11
package/API.md
DELETED
|
@@ -1,421 +0,0 @@
|
|
|
1
|
-
# Members
|
|
2
|
-
|
|
3
|
-
<dl>
|
|
4
|
-
<dt><a href="#schema">schema</a></dt>
|
|
5
|
-
<dd><p>JSON schema defining the types this platform accepts.</p>
|
|
6
|
-
<p>In the below example, Sockethub will validate the incoming credentials object
|
|
7
|
-
against whatever is defined in the <code>credentials</code> portion of the schema
|
|
8
|
-
object.</p>
|
|
9
|
-
<p>It will also check if the incoming AS object uses a type which exists in the
|
|
10
|
-
<code>types</code> portion of the schema object (should be an array of type names).</p>
|
|
11
|
-
<ul>
|
|
12
|
-
<li><strong>NOTE</strong>: For more information on using the credentials object from a client,
|
|
13
|
-
see <a href="https://github.com/sockethub/sockethub/wiki/Sockethub-Client">Sockethub Client</a></li>
|
|
14
|
-
</ul>
|
|
15
|
-
<p>Valid AS object for setting IRC credentials:</p>
|
|
16
|
-
</dd>
|
|
17
|
-
</dl>
|
|
18
|
-
|
|
19
|
-
# Functions
|
|
20
|
-
|
|
21
|
-
<dl>
|
|
22
|
-
<dt><a href="#connect">connect(job, credentials, done)</a></dt>
|
|
23
|
-
<dd><p>Function: connect</p>
|
|
24
|
-
<p>Connect to an IRC server.</p>
|
|
25
|
-
</dd>
|
|
26
|
-
<dt><a href="#join">join(job, done)</a></dt>
|
|
27
|
-
<dd><p>Function: join</p>
|
|
28
|
-
<p>Join a room or private conversation.</p>
|
|
29
|
-
</dd>
|
|
30
|
-
<dt><a href="#leave">leave(job, done)</a></dt>
|
|
31
|
-
<dd><p>Function leave</p>
|
|
32
|
-
<p>Leave a room or private conversation.</p>
|
|
33
|
-
</dd>
|
|
34
|
-
<dt><a href="#send">send(job, done)</a></dt>
|
|
35
|
-
<dd><p>Function: send</p>
|
|
36
|
-
<p>Send a message to a room or private conversation.</p>
|
|
37
|
-
</dd>
|
|
38
|
-
<dt><a href="#update">update(job, credentials, done)</a></dt>
|
|
39
|
-
<dd><p>Function: update</p>
|
|
40
|
-
<p>Indicate a change (i.e. room topic update, or nickname change).</p>
|
|
41
|
-
</dd>
|
|
42
|
-
<dt><a href="#query">query(job, done)</a></dt>
|
|
43
|
-
<dd><p>Function: query</p>
|
|
44
|
-
<p>Indicate an intent to query something (e.g. get a list of users in a room).</p>
|
|
45
|
-
</dd>
|
|
46
|
-
<dt><a href="#disconnect">disconnect(job, done)</a></dt>
|
|
47
|
-
<dd><p>Disconnect IRC client</p>
|
|
48
|
-
</dd>
|
|
49
|
-
</dl>
|
|
50
|
-
|
|
51
|
-
<a name="schema"></a>
|
|
52
|
-
|
|
53
|
-
# schema
|
|
54
|
-
JSON schema defining the types this platform accepts.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
In the below example, Sockethub will validate the incoming credentials object
|
|
58
|
-
against whatever is defined in the `credentials` portion of the schema
|
|
59
|
-
object.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
It will also check if the incoming AS object uses a type which exists in the
|
|
63
|
-
`types` portion of the schema object (should be an array of type names).
|
|
64
|
-
|
|
65
|
-
* **NOTE**: For more information on using the credentials object from a client,
|
|
66
|
-
see [Sockethub Client](https://github.com/sockethub/sockethub/wiki/Sockethub-Client)
|
|
67
|
-
|
|
68
|
-
Valid AS object for setting IRC credentials:
|
|
69
|
-
|
|
70
|
-
**Kind**: global variable
|
|
71
|
-
**Example**
|
|
72
|
-
```js
|
|
73
|
-
{
|
|
74
|
-
type: 'credentials',
|
|
75
|
-
context: 'irc',
|
|
76
|
-
actor: {
|
|
77
|
-
id: 'testuser@irc.host.net',
|
|
78
|
-
type: 'person',
|
|
79
|
-
name: 'Mr. Test User',
|
|
80
|
-
userName: 'testuser'
|
|
81
|
-
},
|
|
82
|
-
object: {
|
|
83
|
-
type: 'credentials',
|
|
84
|
-
server: 'irc.host.net',
|
|
85
|
-
nick: 'testuser',
|
|
86
|
-
password: 'secret',
|
|
87
|
-
port: 6697,
|
|
88
|
-
secure: true,
|
|
89
|
-
sasl: true
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
```
|
|
93
|
-
<a name="connect"></a>
|
|
94
|
-
|
|
95
|
-
# connect(job, credentials, done)
|
|
96
|
-
Function: connect
|
|
97
|
-
|
|
98
|
-
Connect to an IRC server.
|
|
99
|
-
|
|
100
|
-
**Kind**: global function
|
|
101
|
-
<table>
|
|
102
|
-
<thead>
|
|
103
|
-
<tr>
|
|
104
|
-
<th>Param</th><th>Type</th><th>Description</th>
|
|
105
|
-
</tr>
|
|
106
|
-
</thead>
|
|
107
|
-
<tbody>
|
|
108
|
-
<tr>
|
|
109
|
-
<td>job</td><td><code>object</code></td><td><p>activity streams object</p>
|
|
110
|
-
</td>
|
|
111
|
-
</tr><tr>
|
|
112
|
-
<td>credentials</td><td><code>object</code></td><td><p>credentials object</p>
|
|
113
|
-
</td>
|
|
114
|
-
</tr><tr>
|
|
115
|
-
<td>done</td><td><code>object</code></td><td><p>callback when job is done</p>
|
|
116
|
-
</td>
|
|
117
|
-
</tr> </tbody>
|
|
118
|
-
</table>
|
|
119
|
-
|
|
120
|
-
<a name="join"></a>
|
|
121
|
-
|
|
122
|
-
# join(job, done)
|
|
123
|
-
Function: join
|
|
124
|
-
|
|
125
|
-
Join a room or private conversation.
|
|
126
|
-
|
|
127
|
-
**Kind**: global function
|
|
128
|
-
<table>
|
|
129
|
-
<thead>
|
|
130
|
-
<tr>
|
|
131
|
-
<th>Param</th><th>Type</th><th>Description</th>
|
|
132
|
-
</tr>
|
|
133
|
-
</thead>
|
|
134
|
-
<tbody>
|
|
135
|
-
<tr>
|
|
136
|
-
<td>job</td><td><code>object</code></td><td><p>activity streams object</p>
|
|
137
|
-
</td>
|
|
138
|
-
</tr><tr>
|
|
139
|
-
<td>done</td><td><code>object</code></td><td><p>callback when job is done</p>
|
|
140
|
-
</td>
|
|
141
|
-
</tr> </tbody>
|
|
142
|
-
</table>
|
|
143
|
-
|
|
144
|
-
**Example**
|
|
145
|
-
```js
|
|
146
|
-
{
|
|
147
|
-
context: 'irc',
|
|
148
|
-
type: 'join',
|
|
149
|
-
actor: {
|
|
150
|
-
id: 'slvrbckt@irc.freenode.net',
|
|
151
|
-
type: 'person',
|
|
152
|
-
name: 'slvrbckt'
|
|
153
|
-
},
|
|
154
|
-
target: {
|
|
155
|
-
id: 'irc.freenode.net/a-room',
|
|
156
|
-
type: 'room',
|
|
157
|
-
name: '#a-room'
|
|
158
|
-
},
|
|
159
|
-
object: {}
|
|
160
|
-
}
|
|
161
|
-
```
|
|
162
|
-
<a name="leave"></a>
|
|
163
|
-
|
|
164
|
-
# leave(job, done)
|
|
165
|
-
Function leave
|
|
166
|
-
|
|
167
|
-
Leave a room or private conversation.
|
|
168
|
-
|
|
169
|
-
**Kind**: global function
|
|
170
|
-
<table>
|
|
171
|
-
<thead>
|
|
172
|
-
<tr>
|
|
173
|
-
<th>Param</th><th>Type</th><th>Description</th>
|
|
174
|
-
</tr>
|
|
175
|
-
</thead>
|
|
176
|
-
<tbody>
|
|
177
|
-
<tr>
|
|
178
|
-
<td>job</td><td><code>object</code></td><td><p>activity streams object</p>
|
|
179
|
-
</td>
|
|
180
|
-
</tr><tr>
|
|
181
|
-
<td>done</td><td><code>object</code></td><td><p>callback when job is done</p>
|
|
182
|
-
</td>
|
|
183
|
-
</tr> </tbody>
|
|
184
|
-
</table>
|
|
185
|
-
|
|
186
|
-
**Example**
|
|
187
|
-
```js
|
|
188
|
-
{
|
|
189
|
-
context: 'irc',
|
|
190
|
-
type: 'leave',
|
|
191
|
-
actor: {
|
|
192
|
-
id: 'slvrbckt@irc.freenode.net',
|
|
193
|
-
type: 'person',
|
|
194
|
-
name: 'slvrbckt'
|
|
195
|
-
},
|
|
196
|
-
target: {
|
|
197
|
-
id: 'irc.freenode.net/remotestorage',
|
|
198
|
-
type: 'room',
|
|
199
|
-
name: '#remotestorage'
|
|
200
|
-
},
|
|
201
|
-
object: {}
|
|
202
|
-
}
|
|
203
|
-
```
|
|
204
|
-
<a name="send"></a>
|
|
205
|
-
|
|
206
|
-
# send(job, done)
|
|
207
|
-
Function: send
|
|
208
|
-
|
|
209
|
-
Send a message to a room or private conversation.
|
|
210
|
-
|
|
211
|
-
**Kind**: global function
|
|
212
|
-
<table>
|
|
213
|
-
<thead>
|
|
214
|
-
<tr>
|
|
215
|
-
<th>Param</th><th>Type</th><th>Description</th>
|
|
216
|
-
</tr>
|
|
217
|
-
</thead>
|
|
218
|
-
<tbody>
|
|
219
|
-
<tr>
|
|
220
|
-
<td>job</td><td><code>object</code></td><td><p>activity streams object</p>
|
|
221
|
-
</td>
|
|
222
|
-
</tr><tr>
|
|
223
|
-
<td>done</td><td><code>object</code></td><td><p>callback when job is done</p>
|
|
224
|
-
</td>
|
|
225
|
-
</tr> </tbody>
|
|
226
|
-
</table>
|
|
227
|
-
|
|
228
|
-
**Example**
|
|
229
|
-
```js
|
|
230
|
-
{
|
|
231
|
-
context: 'irc',
|
|
232
|
-
type: 'send',
|
|
233
|
-
actor: {
|
|
234
|
-
id: 'slvrbckt@irc.freenode.net',
|
|
235
|
-
type: 'person',
|
|
236
|
-
name: 'Nick Jennings',
|
|
237
|
-
userName: 'slvrbckt'
|
|
238
|
-
},
|
|
239
|
-
target: {
|
|
240
|
-
id: 'irc.freenode.net/remotestorage',
|
|
241
|
-
type: 'room',
|
|
242
|
-
name: '#remotestorage'
|
|
243
|
-
},
|
|
244
|
-
object: {
|
|
245
|
-
type: 'message',
|
|
246
|
-
content: 'Hello from Sockethub!'
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
```
|
|
250
|
-
<a name="update"></a>
|
|
251
|
-
|
|
252
|
-
# update(job, credentials, done)
|
|
253
|
-
Function: update
|
|
254
|
-
|
|
255
|
-
Indicate a change (i.e. room topic update, or nickname change).
|
|
256
|
-
|
|
257
|
-
**Kind**: global function
|
|
258
|
-
<table>
|
|
259
|
-
<thead>
|
|
260
|
-
<tr>
|
|
261
|
-
<th>Param</th><th>Type</th><th>Description</th>
|
|
262
|
-
</tr>
|
|
263
|
-
</thead>
|
|
264
|
-
<tbody>
|
|
265
|
-
<tr>
|
|
266
|
-
<td>job</td><td><code>object</code></td><td><p>activity streams object</p>
|
|
267
|
-
</td>
|
|
268
|
-
</tr><tr>
|
|
269
|
-
<td>credentials</td><td><code>object</code></td><td><p>credentials to verify this user is the right one</p>
|
|
270
|
-
</td>
|
|
271
|
-
</tr><tr>
|
|
272
|
-
<td>done</td><td><code>object</code></td><td><p>callback when job is done</p>
|
|
273
|
-
</td>
|
|
274
|
-
</tr> </tbody>
|
|
275
|
-
</table>
|
|
276
|
-
|
|
277
|
-
**Example**
|
|
278
|
-
```js
|
|
279
|
-
change topic
|
|
280
|
-
|
|
281
|
-
{
|
|
282
|
-
context: 'irc',
|
|
283
|
-
type: 'update',
|
|
284
|
-
actor: {
|
|
285
|
-
id: 'slvrbckt@irc.freenode.net',
|
|
286
|
-
type: 'person',
|
|
287
|
-
name: 'Nick Jennings',
|
|
288
|
-
userName: 'slvrbckt'
|
|
289
|
-
},
|
|
290
|
-
target: {
|
|
291
|
-
id: 'irc.freenode.net/a-room',
|
|
292
|
-
type: 'room',
|
|
293
|
-
name: '#a-room'
|
|
294
|
-
},
|
|
295
|
-
object: {
|
|
296
|
-
type: 'topic',
|
|
297
|
-
content: 'New version of Sockethub released!'
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
```
|
|
301
|
-
**Example**
|
|
302
|
-
```js
|
|
303
|
-
change nickname
|
|
304
|
-
{
|
|
305
|
-
context: 'irc'
|
|
306
|
-
type: 'update',
|
|
307
|
-
actor: {
|
|
308
|
-
id: 'slvrbckt@irc.freenode.net',
|
|
309
|
-
type: 'person',
|
|
310
|
-
name: 'slvrbckt'
|
|
311
|
-
},
|
|
312
|
-
object: {
|
|
313
|
-
type: "address",
|
|
314
|
-
},
|
|
315
|
-
target: {
|
|
316
|
-
id: 'cooldude@irc.freenode.net',
|
|
317
|
-
type: 'person',
|
|
318
|
-
name: 'cooldude'
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
```
|
|
322
|
-
<a name="query"></a>
|
|
323
|
-
|
|
324
|
-
# query(job, done)
|
|
325
|
-
Function: query
|
|
326
|
-
|
|
327
|
-
Indicate an intent to query something (e.g. get a list of users in a room).
|
|
328
|
-
|
|
329
|
-
**Kind**: global function
|
|
330
|
-
<table>
|
|
331
|
-
<thead>
|
|
332
|
-
<tr>
|
|
333
|
-
<th>Param</th><th>Type</th><th>Description</th>
|
|
334
|
-
</tr>
|
|
335
|
-
</thead>
|
|
336
|
-
<tbody>
|
|
337
|
-
<tr>
|
|
338
|
-
<td>job</td><td><code>object</code></td><td><p>activity streams object</p>
|
|
339
|
-
</td>
|
|
340
|
-
</tr><tr>
|
|
341
|
-
<td>done</td><td><code>object</code></td><td><p>callback when job is done</p>
|
|
342
|
-
</td>
|
|
343
|
-
</tr> </tbody>
|
|
344
|
-
</table>
|
|
345
|
-
|
|
346
|
-
**Example**
|
|
347
|
-
```js
|
|
348
|
-
{
|
|
349
|
-
context: 'irc',
|
|
350
|
-
type: 'query',
|
|
351
|
-
actor: {
|
|
352
|
-
id: 'slvrbckt@irc.freenode.net',
|
|
353
|
-
type: 'person',
|
|
354
|
-
name: 'Nick Jennings',
|
|
355
|
-
userName: 'slvrbckt'
|
|
356
|
-
},
|
|
357
|
-
target: {
|
|
358
|
-
id: 'irc.freenode.net/a-room',
|
|
359
|
-
type: 'room',
|
|
360
|
-
name: '#a-room'
|
|
361
|
-
},
|
|
362
|
-
object: {
|
|
363
|
-
type: 'attendance'
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
// The above object might return:
|
|
369
|
-
{
|
|
370
|
-
context: 'irc',
|
|
371
|
-
type: 'query',
|
|
372
|
-
actor: {
|
|
373
|
-
id: 'irc.freenode.net/a-room',
|
|
374
|
-
type: 'room',
|
|
375
|
-
name: '#a-room'
|
|
376
|
-
},
|
|
377
|
-
target: {},
|
|
378
|
-
object: {
|
|
379
|
-
type: 'attendance'
|
|
380
|
-
members: [
|
|
381
|
-
'RyanGosling',
|
|
382
|
-
'PeeWeeHerman',
|
|
383
|
-
'Commando',
|
|
384
|
-
'Smoochie',
|
|
385
|
-
'neo'
|
|
386
|
-
]
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
```
|
|
390
|
-
<a name="disconnect"></a>
|
|
391
|
-
|
|
392
|
-
# disconnect(job, done)
|
|
393
|
-
Disconnect IRC client
|
|
394
|
-
|
|
395
|
-
**Kind**: global function
|
|
396
|
-
<table>
|
|
397
|
-
<thead>
|
|
398
|
-
<tr>
|
|
399
|
-
<th>Param</th><th>Type</th><th>Description</th>
|
|
400
|
-
</tr>
|
|
401
|
-
</thead>
|
|
402
|
-
<tbody>
|
|
403
|
-
<tr>
|
|
404
|
-
<td>job</td><td><code>object</code></td><td><p>activity streams object</p>
|
|
405
|
-
</td>
|
|
406
|
-
</tr><tr>
|
|
407
|
-
<td>done</td><td></td><td></td>
|
|
408
|
-
</tr> </tbody>
|
|
409
|
-
</table>
|
|
410
|
-
|
|
411
|
-
**Example**
|
|
412
|
-
```js
|
|
413
|
-
{
|
|
414
|
-
context: 'irc',
|
|
415
|
-
type: 'disconnect',
|
|
416
|
-
actor: {
|
|
417
|
-
id: 'slvrbckt@irc.freenode.net',
|
|
418
|
-
type: 'person'
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
```
|
package/typedoc.json
DELETED