@jcbuisson/express-x 1.5.11 → 1.5.13
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/context.mjs +4 -20
- package/src/index.mjs +3 -4
package/package.json
CHANGED
package/src/context.mjs
CHANGED
|
@@ -5,12 +5,14 @@ export async function getContextConnection(context) {
|
|
|
5
5
|
return connection
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export async function
|
|
8
|
+
export async function resetConnection(context) {
|
|
9
9
|
const id = context.params.connectionId
|
|
10
10
|
await context.app.service('Connection')._update({
|
|
11
11
|
where: { id },
|
|
12
12
|
data: {
|
|
13
|
-
clientIP: ''
|
|
13
|
+
clientIP: '',
|
|
14
|
+
data: '{}',
|
|
15
|
+
channelNames: '[]',
|
|
14
16
|
}
|
|
15
17
|
})
|
|
16
18
|
}
|
|
@@ -47,21 +49,3 @@ export async function removeConnectionDataItem(context, key) {
|
|
|
47
49
|
}
|
|
48
50
|
})
|
|
49
51
|
}
|
|
50
|
-
|
|
51
|
-
export async function resetConnectionData(context) {
|
|
52
|
-
const id = context.params.connectionId
|
|
53
|
-
await context.app.service('Connection').update({
|
|
54
|
-
where: { id },
|
|
55
|
-
data: {
|
|
56
|
-
data: "{}"
|
|
57
|
-
}
|
|
58
|
-
})
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export async function resetConnectionChannels(context) {
|
|
62
|
-
const id = context.params.connectionId
|
|
63
|
-
await context.app.service('Connection').update({
|
|
64
|
-
where: { id },
|
|
65
|
-
data: { channelNames: '[]' },
|
|
66
|
-
})
|
|
67
|
-
}
|
package/src/index.mjs
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
|
|
2
2
|
import { expressX } from './server.mjs'
|
|
3
3
|
import { hashPassword, protect, isAuthenticated } from './common-hooks.mjs'
|
|
4
|
-
import { getContextConnection,
|
|
4
|
+
import { getContextConnection, resetConnection, getConnectionDataItem, setConnectionDataItem, removeConnectionDataItem } from './context.mjs'
|
|
5
5
|
|
|
6
6
|
export {
|
|
7
7
|
expressX,
|
|
8
8
|
|
|
9
9
|
getContextConnection,
|
|
10
|
-
|
|
10
|
+
resetConnection,
|
|
11
|
+
|
|
11
12
|
getConnectionDataItem,
|
|
12
13
|
setConnectionDataItem,
|
|
13
14
|
removeConnectionDataItem,
|
|
14
|
-
resetConnectionData,
|
|
15
|
-
resetConnectionChannels,
|
|
16
15
|
|
|
17
16
|
hashPassword,
|
|
18
17
|
protect,
|