@jcbuisson/express-x 1.5.9 → 1.5.10
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/package.json +1 -1
- package/src/channels.mjs +0 -7
- package/src/context.mjs +8 -0
- package/src/index.mjs +2 -4
package/package.json
CHANGED
package/src/channels.mjs
CHANGED
|
@@ -23,10 +23,3 @@ export async function removeChannelFromConnection(connection, channelName) {
|
|
|
23
23
|
data: { channelNames: JSON.stringify(channelNames) },
|
|
24
24
|
})
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
export async function resetConnectionChannels(connectionId) {
|
|
28
|
-
await app.service('Connection').update({
|
|
29
|
-
where: { id: connectionId },
|
|
30
|
-
data: { channelNames: '[]' },
|
|
31
|
-
})
|
|
32
|
-
}
|
package/src/context.mjs
CHANGED
|
@@ -57,3 +57,11 @@ export async function resetConnectionData(context) {
|
|
|
57
57
|
}
|
|
58
58
|
})
|
|
59
59
|
}
|
|
60
|
+
|
|
61
|
+
export async function resetConnectionChannels(context) {
|
|
62
|
+
const id = context.params.connectionId
|
|
63
|
+
await app.service('Connection').update({
|
|
64
|
+
where: { id },
|
|
65
|
+
data: { channelNames: '[]' },
|
|
66
|
+
})
|
|
67
|
+
}
|
package/src/index.mjs
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
|
|
2
2
|
import { expressX } from './server.mjs'
|
|
3
3
|
import { hashPassword, protect, isAuthenticated } from './common-hooks.mjs'
|
|
4
|
-
import { getContextConnection, resetConnectionIP, getConnectionDataItem, setConnectionDataItem, removeConnectionDataItem, resetConnectionData } from './context.mjs'
|
|
5
|
-
import { resetConnectionChannels } from './channels.mjs'
|
|
4
|
+
import { getContextConnection, resetConnectionIP, getConnectionDataItem, setConnectionDataItem, removeConnectionDataItem, resetConnectionData, resetConnectionChannels } from './context.mjs'
|
|
6
5
|
|
|
7
6
|
export {
|
|
8
7
|
expressX,
|
|
9
8
|
|
|
10
9
|
getContextConnection,
|
|
11
10
|
resetConnectionIP,
|
|
12
|
-
resetConnectionChannels,
|
|
13
|
-
|
|
14
11
|
getConnectionDataItem,
|
|
15
12
|
setConnectionDataItem,
|
|
16
13
|
removeConnectionDataItem,
|
|
17
14
|
resetConnectionData,
|
|
15
|
+
resetConnectionChannels,
|
|
18
16
|
|
|
19
17
|
hashPassword,
|
|
20
18
|
protect,
|