@sockethub/platform-irc 4.0.0-alpha.4 → 4.0.0-alpha.6
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/API.md +123 -77
- package/README.md +68 -73
- package/package.json +17 -22
- package/src/index.test.data.ts +60 -0
- package/src/index.test.ts +277 -0
- package/src/index.ts +764 -0
- package/src/octal-hack.js +4 -0
- package/src/schema.ts +66 -0
- package/src/types.ts +18 -0
- package/typedoc.json +11 -0
- package/index.js +0 -700
- package/index.test.data.js +0 -61
- package/index.test.js +0 -204
package/API.md
CHANGED
|
@@ -1,45 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</
|
|
39
|
-
|
|
40
|
-
<a
|
|
41
|
-
|
|
42
|
-
|
|
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
|
|
43
54
|
JSON schema defining the types this platform accepts.
|
|
44
55
|
|
|
45
56
|
|
|
@@ -56,7 +67,7 @@ see [Sockethub Client](https://github.com/sockethub/sockethub/wiki/Sockethub-Cli
|
|
|
56
67
|
|
|
57
68
|
Valid AS object for setting IRC credentials:
|
|
58
69
|
|
|
59
|
-
**Kind**:
|
|
70
|
+
**Kind**: global variable
|
|
60
71
|
**Example**
|
|
61
72
|
```js
|
|
62
73
|
{
|
|
@@ -72,21 +83,21 @@ Valid AS object for setting IRC credentials:
|
|
|
72
83
|
type: 'credentials',
|
|
73
84
|
server: 'irc.host.net',
|
|
74
85
|
nick: 'testuser',
|
|
75
|
-
password: '
|
|
86
|
+
password: 'secret',
|
|
76
87
|
port: 6697,
|
|
77
88
|
secure: true,
|
|
78
89
|
sasl: true
|
|
79
90
|
}
|
|
80
91
|
}
|
|
81
92
|
```
|
|
82
|
-
<a name="
|
|
93
|
+
<a name="connect"></a>
|
|
83
94
|
|
|
84
|
-
|
|
95
|
+
# connect(job, credentials, done)
|
|
85
96
|
Function: connect
|
|
86
97
|
|
|
87
|
-
|
|
98
|
+
Connect to an IRC server.
|
|
88
99
|
|
|
89
|
-
**Kind**:
|
|
100
|
+
**Kind**: global function
|
|
90
101
|
<table>
|
|
91
102
|
<thead>
|
|
92
103
|
<tr>
|
|
@@ -106,14 +117,14 @@ Conenct to an IRC server.
|
|
|
106
117
|
</tr> </tbody>
|
|
107
118
|
</table>
|
|
108
119
|
|
|
109
|
-
<a name="
|
|
120
|
+
<a name="join"></a>
|
|
110
121
|
|
|
111
|
-
|
|
122
|
+
# join(job, done)
|
|
112
123
|
Function: join
|
|
113
124
|
|
|
114
125
|
Join a room or private conversation.
|
|
115
126
|
|
|
116
|
-
**Kind**:
|
|
127
|
+
**Kind**: global function
|
|
117
128
|
<table>
|
|
118
129
|
<thead>
|
|
119
130
|
<tr>
|
|
@@ -122,10 +133,10 @@ Join a room or private conversation.
|
|
|
122
133
|
</thead>
|
|
123
134
|
<tbody>
|
|
124
135
|
<tr>
|
|
125
|
-
<td>job</td><td><code>object</code></td><td><p>activity streams object
|
|
136
|
+
<td>job</td><td><code>object</code></td><td><p>activity streams object</p>
|
|
126
137
|
</td>
|
|
127
138
|
</tr><tr>
|
|
128
|
-
<td>done</td><td><code>object</code></td><td><p>callback when job is done
|
|
139
|
+
<td>done</td><td><code>object</code></td><td><p>callback when job is done</p>
|
|
129
140
|
</td>
|
|
130
141
|
</tr> </tbody>
|
|
131
142
|
</table>
|
|
@@ -148,14 +159,14 @@ Join a room or private conversation.
|
|
|
148
159
|
object: {}
|
|
149
160
|
}
|
|
150
161
|
```
|
|
151
|
-
<a name="
|
|
162
|
+
<a name="leave"></a>
|
|
152
163
|
|
|
153
|
-
|
|
164
|
+
# leave(job, done)
|
|
154
165
|
Function leave
|
|
155
166
|
|
|
156
167
|
Leave a room or private conversation.
|
|
157
168
|
|
|
158
|
-
**Kind**:
|
|
169
|
+
**Kind**: global function
|
|
159
170
|
<table>
|
|
160
171
|
<thead>
|
|
161
172
|
<tr>
|
|
@@ -164,10 +175,10 @@ Leave a room or private conversation.
|
|
|
164
175
|
</thead>
|
|
165
176
|
<tbody>
|
|
166
177
|
<tr>
|
|
167
|
-
<td>job</td><td><code>object</code></td><td><p>activity streams object
|
|
178
|
+
<td>job</td><td><code>object</code></td><td><p>activity streams object</p>
|
|
168
179
|
</td>
|
|
169
180
|
</tr><tr>
|
|
170
|
-
<td>done</td><td><code>object</code></td><td><p>callback when job is done
|
|
181
|
+
<td>done</td><td><code>object</code></td><td><p>callback when job is done</p>
|
|
171
182
|
</td>
|
|
172
183
|
</tr> </tbody>
|
|
173
184
|
</table>
|
|
@@ -190,14 +201,14 @@ Leave a room or private conversation.
|
|
|
190
201
|
object: {}
|
|
191
202
|
}
|
|
192
203
|
```
|
|
193
|
-
<a name="
|
|
204
|
+
<a name="send"></a>
|
|
194
205
|
|
|
195
|
-
|
|
206
|
+
# send(job, done)
|
|
196
207
|
Function: send
|
|
197
208
|
|
|
198
209
|
Send a message to a room or private conversation.
|
|
199
210
|
|
|
200
|
-
**Kind**:
|
|
211
|
+
**Kind**: global function
|
|
201
212
|
<table>
|
|
202
213
|
<thead>
|
|
203
214
|
<tr>
|
|
@@ -206,10 +217,10 @@ Send a message to a room or private conversation.
|
|
|
206
217
|
</thead>
|
|
207
218
|
<tbody>
|
|
208
219
|
<tr>
|
|
209
|
-
<td>job</td><td><code>object</code></td><td><p>activity streams object
|
|
220
|
+
<td>job</td><td><code>object</code></td><td><p>activity streams object</p>
|
|
210
221
|
</td>
|
|
211
222
|
</tr><tr>
|
|
212
|
-
<td>done</td><td><code>object</code></td><td><p>callback when job is done
|
|
223
|
+
<td>done</td><td><code>object</code></td><td><p>callback when job is done</p>
|
|
213
224
|
</td>
|
|
214
225
|
</tr> </tbody>
|
|
215
226
|
</table>
|
|
@@ -236,14 +247,14 @@ Send a message to a room or private conversation.
|
|
|
236
247
|
}
|
|
237
248
|
}
|
|
238
249
|
```
|
|
239
|
-
<a name="
|
|
250
|
+
<a name="update"></a>
|
|
240
251
|
|
|
241
|
-
|
|
252
|
+
# update(job, credentials, done)
|
|
242
253
|
Function: update
|
|
243
254
|
|
|
244
|
-
Indicate a change (
|
|
255
|
+
Indicate a change (i.e. room topic update, or nickname change).
|
|
245
256
|
|
|
246
|
-
**Kind**:
|
|
257
|
+
**Kind**: global function
|
|
247
258
|
<table>
|
|
248
259
|
<thead>
|
|
249
260
|
<tr>
|
|
@@ -252,10 +263,13 @@ Indicate a change (ie. room topic update, or nickname change).
|
|
|
252
263
|
</thead>
|
|
253
264
|
<tbody>
|
|
254
265
|
<tr>
|
|
255
|
-
<td>job</td><td><code>object</code></td><td><p>activity streams object
|
|
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>
|
|
256
270
|
</td>
|
|
257
271
|
</tr><tr>
|
|
258
|
-
<td>done</td><td><code>object</code></td><td><p>callback when job is done
|
|
272
|
+
<td>done</td><td><code>object</code></td><td><p>callback when job is done</p>
|
|
259
273
|
</td>
|
|
260
274
|
</tr> </tbody>
|
|
261
275
|
</table>
|
|
@@ -280,7 +294,7 @@ change topic
|
|
|
280
294
|
},
|
|
281
295
|
object: {
|
|
282
296
|
type: 'topic',
|
|
283
|
-
content: 'New version of
|
|
297
|
+
content: 'New version of Sockethub released!'
|
|
284
298
|
}
|
|
285
299
|
}
|
|
286
300
|
```
|
|
@@ -289,7 +303,7 @@ change topic
|
|
|
289
303
|
change nickname
|
|
290
304
|
{
|
|
291
305
|
context: 'irc'
|
|
292
|
-
type: '
|
|
306
|
+
type: 'update',
|
|
293
307
|
actor: {
|
|
294
308
|
id: 'slvrbckt@irc.freenode.net',
|
|
295
309
|
type: 'person',
|
|
@@ -301,18 +315,18 @@ change nickname
|
|
|
301
315
|
target: {
|
|
302
316
|
id: 'cooldude@irc.freenode.net',
|
|
303
317
|
type: 'person',
|
|
304
|
-
name: cooldude
|
|
318
|
+
name: 'cooldude'
|
|
305
319
|
}
|
|
306
320
|
}
|
|
307
321
|
```
|
|
308
|
-
<a name="
|
|
322
|
+
<a name="query"></a>
|
|
309
323
|
|
|
310
|
-
|
|
324
|
+
# query(job, done)
|
|
311
325
|
Function: query
|
|
312
326
|
|
|
313
327
|
Indicate an intent to query something (e.g. get a list of users in a room).
|
|
314
328
|
|
|
315
|
-
**Kind**:
|
|
329
|
+
**Kind**: global function
|
|
316
330
|
<table>
|
|
317
331
|
<thead>
|
|
318
332
|
<tr>
|
|
@@ -321,10 +335,10 @@ Indicate an intent to query something (e.g. get a list of users in a room).
|
|
|
321
335
|
</thead>
|
|
322
336
|
<tbody>
|
|
323
337
|
<tr>
|
|
324
|
-
<td>job</td><td><code>object</code></td><td><p>activity streams object
|
|
338
|
+
<td>job</td><td><code>object</code></td><td><p>activity streams object</p>
|
|
325
339
|
</td>
|
|
326
340
|
</tr><tr>
|
|
327
|
-
<td>done</td><td><code>object</code></td><td><p>callback when job is done
|
|
341
|
+
<td>done</td><td><code>object</code></td><td><p>callback when job is done</p>
|
|
328
342
|
</td>
|
|
329
343
|
</tr> </tbody>
|
|
330
344
|
</table>
|
|
@@ -373,3 +387,35 @@ Indicate an intent to query something (e.g. get a list of users in a room).
|
|
|
373
387
|
}
|
|
374
388
|
}
|
|
375
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/README.md
CHANGED
|
@@ -1,96 +1,91 @@
|
|
|
1
|
-
# sockethub
|
|
1
|
+
# @sockethub/platform-irc
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A Sockethub platform module implementing IRC (Internet Relay Chat) functionality.
|
|
4
4
|
|
|
5
5
|
## About
|
|
6
6
|
|
|
7
|
-
This
|
|
8
|
-
|
|
7
|
+
This platform provides IRC client functionality, allowing web applications to connect to
|
|
8
|
+
IRC servers, join channels, send messages, and handle IRC events through ActivityStreams
|
|
9
|
+
messages.
|
|
9
10
|
|
|
10
|
-
## Implemented (`@type`)
|
|
11
|
-
<kbd> send</kbd>
|
|
12
|
-
<kbd> join</kbd>
|
|
13
|
-
<kbd> leave</kbd>
|
|
14
|
-
<kbd> observe</kbd>
|
|
15
|
-
<kbd> update</kbd>
|
|
11
|
+
## Implemented Verbs (`@type`)
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
* **send** - Send messages to channels or users
|
|
14
|
+
* **join** - Join IRC channels
|
|
15
|
+
* **leave** - Leave IRC channels
|
|
16
|
+
* **observe** - Monitor channel activity and user events
|
|
17
|
+
* **update** - Update user information (nick, etc.)
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
## Usage
|
|
20
20
|
|
|
21
|
-
###
|
|
22
|
-
Connected to IRC
|
|
21
|
+
### Send Message Example
|
|
23
22
|
|
|
24
23
|
```json
|
|
25
24
|
{
|
|
26
|
-
"@type": "
|
|
25
|
+
"@type": "send",
|
|
27
26
|
"context": "irc",
|
|
28
27
|
"actor": {
|
|
29
|
-
"@id": "irc.
|
|
30
|
-
"@type": "service"
|
|
28
|
+
"@id": "mynick@irc.libera.chat"
|
|
31
29
|
},
|
|
32
|
-
"published": "2015-05-20T22:32:06.212Z",
|
|
33
30
|
"target": {
|
|
34
|
-
"@id": "
|
|
35
|
-
"@type": "person",
|
|
36
|
-
"displayName": "Foobar McUser"
|
|
31
|
+
"@id": "#general@irc.libera.chat"
|
|
37
32
|
},
|
|
38
33
|
"object": {
|
|
39
|
-
"@type": "
|
|
40
|
-
"content":
|
|
41
|
-
"network":{
|
|
42
|
-
"name":"freenode",
|
|
43
|
-
"hostname":"orwell.freenode.net",
|
|
44
|
-
"ircd":"ircd-seven-1.1.3",
|
|
45
|
-
"nicklength":16,
|
|
46
|
-
"maxtargets":{
|
|
47
|
-
"NAMES":1,
|
|
48
|
-
"LIST":1,
|
|
49
|
-
"KICK":1,
|
|
50
|
-
"WHOIS":1,
|
|
51
|
-
"PRIVMSG":4,
|
|
52
|
-
"NOTICE":4,
|
|
53
|
-
"ACCEPT":0,
|
|
54
|
-
"MONITOR":0
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
"channel":{
|
|
58
|
-
"idlength":{
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
"limit":{
|
|
62
|
-
"#":120
|
|
63
|
-
},
|
|
64
|
-
"length":50,
|
|
65
|
-
"modes":4,
|
|
66
|
-
"types":"#",
|
|
67
|
-
"kicklength":0,
|
|
68
|
-
"topiclength":390
|
|
69
|
-
},
|
|
70
|
-
"modes":{
|
|
71
|
-
"user":"DOQRSZaghilopswz",
|
|
72
|
-
"channel":"CFILMPQSbcefgijklmnopqrstvz",
|
|
73
|
-
"param":"bkloveqjfI",
|
|
74
|
-
"types":{
|
|
75
|
-
"a":"eIbq",
|
|
76
|
-
"b":"kov",
|
|
77
|
-
"c":"flj",
|
|
78
|
-
"d":"CFLMPQScgimnprstz"
|
|
79
|
-
},
|
|
80
|
-
"prefixes":"@+",
|
|
81
|
-
"prefixmodes":{
|
|
82
|
-
"o":"@",
|
|
83
|
-
"v":"+"
|
|
84
|
-
},
|
|
85
|
-
"maxlist":{
|
|
86
|
-
"bqeI":100
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
34
|
+
"@type": "Note",
|
|
35
|
+
"content": "Hello IRC channel!"
|
|
90
36
|
}
|
|
91
37
|
}
|
|
92
38
|
```
|
|
93
39
|
|
|
40
|
+
### Join Channel Example
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"@type": "join",
|
|
45
|
+
"context": "irc",
|
|
46
|
+
"actor": {
|
|
47
|
+
"@id": "mynick@irc.libera.chat"
|
|
48
|
+
},
|
|
49
|
+
"target": {
|
|
50
|
+
"@id": "#general@irc.libera.chat"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Private Message Example
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"@type": "send",
|
|
60
|
+
"context": "irc",
|
|
61
|
+
"actor": {
|
|
62
|
+
"@id": "mynick@irc.libera.chat"
|
|
63
|
+
},
|
|
64
|
+
"target": {
|
|
65
|
+
"@id": "friend@irc.libera.chat"
|
|
66
|
+
},
|
|
67
|
+
"object": {
|
|
68
|
+
"@type": "Note",
|
|
69
|
+
"content": "Hello friend!"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Features
|
|
75
|
+
|
|
76
|
+
* **Channel communication**: Join and participate in IRC channels
|
|
77
|
+
* **Private messaging**: Send direct messages to other users
|
|
78
|
+
* **User management**: Handle nick changes and user information
|
|
79
|
+
* **Network support**: Connect to various IRC networks
|
|
80
|
+
* **Event handling**: Process IRC events and convert to ActivityStreams
|
|
81
|
+
|
|
82
|
+
## Use Cases
|
|
83
|
+
|
|
84
|
+
* **Web IRC clients**: Build browser-based IRC chat applications
|
|
85
|
+
* **Chatbots**: Create IRC bots that integrate with web services
|
|
86
|
+
* **Notification systems**: Send alerts to IRC channels
|
|
87
|
+
* **Community integration**: Connect web platforms to IRC communities
|
|
88
|
+
|
|
94
89
|
## API
|
|
95
90
|
|
|
96
|
-
API
|
|
91
|
+
Detailed API documentation can be found [here](API.md)
|
package/package.json
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sockethub/platform-irc",
|
|
3
3
|
"description": "A sockethub platform module implementing IRC functionality",
|
|
4
|
-
"version": "4.0.0-alpha.
|
|
4
|
+
"version": "4.0.0-alpha.6",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Nick Jennings <nick@silverbucket.net>",
|
|
7
7
|
"license": "LGPL-3.0+",
|
|
8
|
-
"
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "src/index.ts",
|
|
13
|
+
"engines": {
|
|
14
|
+
"bun": ">=1.2"
|
|
15
|
+
},
|
|
9
16
|
"keywords": [
|
|
10
17
|
"sockethub",
|
|
11
18
|
"messaging",
|
|
@@ -22,20 +29,16 @@
|
|
|
22
29
|
},
|
|
23
30
|
"homepage": "https://github.com/sockethub/sockethub/tree/master/packages/platform-irc",
|
|
24
31
|
"dependencies": {
|
|
25
|
-
"@sockethub/irc2as": "
|
|
32
|
+
"@sockethub/irc2as": "4.0.0-alpha.6",
|
|
26
33
|
"irc-socket-sasl": "4.0.0"
|
|
27
34
|
},
|
|
28
35
|
"devDependencies": {
|
|
29
|
-
"@sockethub/schemas": "
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"eslint": "8.23.1",
|
|
33
|
-
"jsdoc-to-markdown": "7.1.1",
|
|
34
|
-
"proxyquire": "2.1.3",
|
|
35
|
-
"sinon": "14.0.0"
|
|
36
|
+
"@sockethub/schemas": "3.0.0-alpha.6",
|
|
37
|
+
"@types/bun": "latest",
|
|
38
|
+
"typedoc": "^0.28.14"
|
|
36
39
|
},
|
|
37
40
|
"peerDependencies": {
|
|
38
|
-
"@sockethub/server": "
|
|
41
|
+
"@sockethub/server": "5.0.0-alpha.6"
|
|
39
42
|
},
|
|
40
43
|
"peerDependenciesMeta": {
|
|
41
44
|
"@sockethub/server": {
|
|
@@ -43,15 +46,7 @@
|
|
|
43
46
|
}
|
|
44
47
|
},
|
|
45
48
|
"scripts": {
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"compliance": "yarn run lint && yarn run test && yarn run coverage",
|
|
50
|
-
"test": "c8 mocha *.test.js",
|
|
51
|
-
"coverage": "c8 check-coverage --statements 80 --branches 55 --functions 85 --lines 80",
|
|
52
|
-
"doc": "jsdoc2md --no-gfm --heading-depth 1 index.js > API.md",
|
|
53
|
-
"lint": "eslint \"**/*.js\"",
|
|
54
|
-
"lint:fix": "eslint --fix \"**/*.js\""
|
|
55
|
-
},
|
|
56
|
-
"gitHead": "c6d34ff44d2be479e4ea42c46da649612342a680"
|
|
49
|
+
"doc": "typedoc --options typedoc.json"
|
|
50
|
+
},
|
|
51
|
+
"gitHead": "f8a937e071e7a209f94b94f63e68faa27784e00e"
|
|
57
52
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
name: "irc credentials",
|
|
4
|
+
valid: true,
|
|
5
|
+
type: "credentials",
|
|
6
|
+
input: {
|
|
7
|
+
context: "irc",
|
|
8
|
+
type: "credentials",
|
|
9
|
+
actor: {
|
|
10
|
+
id: "sh-9K3Vk@irc.freenode.net",
|
|
11
|
+
type: "person",
|
|
12
|
+
name: "sh-9K3Vk",
|
|
13
|
+
image: {
|
|
14
|
+
height: 250,
|
|
15
|
+
mediaType: "image/jpeg",
|
|
16
|
+
url: "http://example.org/image.jpg",
|
|
17
|
+
width: 250,
|
|
18
|
+
},
|
|
19
|
+
url: "http://sockethub.org",
|
|
20
|
+
},
|
|
21
|
+
object: {
|
|
22
|
+
type: "credentials",
|
|
23
|
+
nick: "sh-9K3Vk",
|
|
24
|
+
port: 6667,
|
|
25
|
+
secure: false,
|
|
26
|
+
server: "irc.freenode.net",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
output: "same",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "bad irc credentials: user/nick host/server",
|
|
33
|
+
valid: false,
|
|
34
|
+
type: "credentials",
|
|
35
|
+
input: {
|
|
36
|
+
context: "irc",
|
|
37
|
+
type: "credentials",
|
|
38
|
+
actor: {
|
|
39
|
+
id: "sh-9K3Vk@irc.freenode.net",
|
|
40
|
+
type: "person",
|
|
41
|
+
name: "sh-9K3Vk",
|
|
42
|
+
image: {
|
|
43
|
+
height: 250,
|
|
44
|
+
mediaType: "image/jpeg",
|
|
45
|
+
url: "http://example.org/image.jpg",
|
|
46
|
+
width: 250,
|
|
47
|
+
},
|
|
48
|
+
url: "http://sockethub.org",
|
|
49
|
+
},
|
|
50
|
+
object: {
|
|
51
|
+
type: "credentials",
|
|
52
|
+
user: "sh-9K3Vk",
|
|
53
|
+
port: 6667,
|
|
54
|
+
secure: false,
|
|
55
|
+
host: "irc.freenode.net",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
error: "Error: [irc] /object: must NOT have additional properties: host",
|
|
59
|
+
},
|
|
60
|
+
];
|