sockethub 4.0.0 → 5.0.0-alpha.0
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 +3 -3
- package/bin/sockethub +23 -19
- package/coverage/tmp/coverage-15699-1646422276150-0.json +1 -0
- package/dist/bootstrap/init.js +14 -4
- package/dist/bootstrap/init.js.map +1 -1
- package/dist/bootstrap/platforms.js +81 -69
- package/dist/common.js +10 -12
- package/dist/common.js.map +1 -1
- package/dist/config.js +4 -22
- package/dist/config.js.map +1 -1
- package/dist/crypto.js +7 -8
- package/dist/crypto.js.map +1 -1
- package/dist/janitor.js +14 -9
- package/dist/janitor.js.map +1 -1
- package/dist/middleware/create-activity-object.js +19 -0
- package/dist/middleware/create-activity-object.js.map +1 -0
- package/dist/middleware/expand-activity-stream.js +33 -0
- package/dist/middleware/expand-activity-stream.js.map +1 -0
- package/dist/middleware/expand-activity-stream.test.data.js +360 -0
- package/dist/middleware/expand-activity-stream.test.data.js.map +1 -0
- package/dist/middleware/store-credentials.js +19 -0
- package/dist/middleware/store-credentials.js.map +1 -0
- package/dist/middleware/validate.js +77 -0
- package/dist/middleware/validate.js.map +1 -0
- package/dist/middleware/validate.test.data.js +321 -0
- package/dist/middleware/validate.test.data.js.map +1 -0
- package/dist/middleware.js +47 -49
- package/dist/middleware.js.map +1 -1
- package/dist/platform-instance.js +84 -66
- package/dist/platform-instance.js.map +1 -1
- package/dist/platform.js +50 -25
- package/dist/platform.js.map +1 -1
- package/dist/process-manager.js +7 -4
- package/dist/process-manager.js.map +1 -1
- package/dist/routes.js +9 -7
- package/dist/routes.js.map +1 -1
- package/dist/serve.js +3 -3
- package/dist/serve.js.map +1 -1
- package/dist/sockethub-client.js +2604 -0
- package/dist/sockethub-client.js.map +1 -0
- package/dist/sockethub-client.min.js +2 -0
- package/dist/sockethub-client.min.js.LICENSE.txt +24 -0
- package/dist/sockethub.js +75 -58
- package/dist/sockethub.js.map +1 -1
- package/dist/store.js +17 -0
- package/dist/store.js.map +1 -0
- package/package.json +48 -44
- package/src/bootstrap/init.ts +16 -2
- package/src/bootstrap/platforms.js +14 -18
- package/src/common.test.ts +44 -33
- package/src/common.ts +9 -17
- package/src/config.test.ts +16 -38
- package/src/config.ts +1 -23
- package/src/crypto.test.ts +15 -17
- package/src/crypto.ts +4 -5
- package/src/janitor.ts +19 -12
- package/src/middleware/create-activity-object.test.ts +10 -0
- package/src/middleware/create-activity-object.ts +13 -0
- package/src/middleware/expand-activity-stream.test.data.ts +365 -0
- package/src/middleware/expand-activity-stream.test.ts +78 -0
- package/src/middleware/expand-activity-stream.ts +27 -0
- package/src/middleware/store-credentials.test.ts +72 -0
- package/src/middleware/store-credentials.ts +16 -0
- package/src/{validate.d.ts → middleware/validate.d.ts} +0 -0
- package/src/middleware/validate.test.data.ts +320 -0
- package/src/middleware/validate.test.ts +47 -0
- package/src/middleware/validate.ts +49 -0
- package/src/middleware.test.ts +148 -0
- package/src/middleware.ts +46 -51
- package/src/platform-instance.test.ts +224 -196
- package/src/platform-instance.ts +74 -58
- package/src/platform.ts +44 -24
- package/src/process-manager.ts +7 -4
- package/src/routes.test.ts +32 -17
- package/src/routes.ts +8 -6
- package/src/serve.ts +1 -1
- package/src/sockethub-client.test.ts +235 -0
- package/src/sockethub-client.ts +164 -0
- package/src/sockethub.ts +96 -93
- package/src/store.test.ts +26 -0
- package/src/store.ts +17 -0
- package/tsconfig.json +8 -8
- package/views/examples/dummy.ejs +7 -7
- package/views/examples/feeds.ejs +10 -10
- package/views/examples/irc.ejs +65 -59
- package/views/examples/shared.js +31 -29
- package/views/examples/xmpp.ejs +49 -58
- package/webpack.minified.config.js +14 -0
- package/webpack.normal.config.js +14 -0
- package/coverage/clover.xml +0 -190
- package/coverage/coverage-final.json +0 -6
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -79
- package/coverage/lcov-report/common.ts.html +0 -143
- package/coverage/lcov-report/config.ts.html +0 -359
- package/coverage/lcov-report/crypto.ts.html +0 -203
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -171
- package/coverage/lcov-report/platform-instance.ts.html +0 -740
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/routes.ts.html +0 -353
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -170
- package/coverage/lcov-report/src/common.ts.html +0 -143
- package/coverage/lcov-report/src/config.ts.html +0 -359
- package/coverage/lcov-report/src/crypto.ts.html +0 -182
- package/coverage/lcov-report/src/index.html +0 -156
- package/coverage/lcov-report/src/platform-instance.ts.html +0 -740
- package/coverage/lcov-report/src/routes/base.ts.html +0 -359
- package/coverage/lcov-report/src/routes/examples.ts.html +0 -311
- package/coverage/lcov-report/src/routes/index.html +0 -111
- package/coverage/lcov-report/src/services/http.ts.html +0 -239
- package/coverage/lcov-report/src/services/index.html +0 -111
- package/coverage/lcov-report/src/services/redis.ts.html +0 -140
- package/coverage/lcov-report/src/shared-resources.ts.html +0 -104
- package/coverage/lcov.info +0 -336
- package/coverage/tmp/coverage-70996-1620314182345-0.json +0 -1
- package/dist/bootstrap/platforms.js.map +0 -1
- package/dist/js/client.js +0 -177
- package/dist/js/client.js.map +0 -1
- package/dist/resource-manager.js +0 -66
- package/dist/resource-manager.js.map +0 -1
- package/dist/routes/base.js +0 -92
- package/dist/routes/base.js.map +0 -1
- package/dist/routes/examples.js +0 -93
- package/dist/routes/examples.js.map +0 -1
- package/dist/services/http.js +0 -68
- package/dist/services/http.js.map +0 -1
- package/dist/services/redis.js +0 -1
- package/dist/services/redis.js.map +0 -1
- package/dist/shared-resources.js +0 -11
- package/dist/shared-resources.js.map +0 -1
- package/dist/validate.js +0 -157
- package/dist/validate.js.map +0 -1
- package/jest.config.js +0 -18
- package/src/js/client.js +0 -190
- package/src/validate.ts +0 -147
- package/test/middleware-suite.js +0 -101
- package/test/validate-suite.js +0 -338
package/README.md
CHANGED
|
@@ -29,9 +29,9 @@ Below is a list of platform contexts we're currently working on and their types,
|
|
|
29
29
|
|
|
30
30
|
## Platforms
|
|
31
31
|
|
|
32
|
-
* [Feeds](
|
|
33
|
-
* [IRC](
|
|
34
|
-
* [XMPP](
|
|
32
|
+
* [Feeds](../sockethub-platform-feeds) *(RSS, Atom)*
|
|
33
|
+
* [IRC](../sockethub-platform-irc)
|
|
34
|
+
* [XMPP](../sockethub-platform-xmpp)
|
|
35
35
|
|
|
36
36
|
## Install
|
|
37
37
|
|
package/bin/sockethub
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const baseDir = process.env.DEV ? 'src' : 'dist';
|
|
3
|
+
const Sockethub = require(`./../${baseDir}/sockethub`).default;
|
|
4
|
+
const sockethub = new Sockethub();
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
(async () => {
|
|
7
|
+
process.once('uncaughtException', function (err) {
|
|
8
|
+
console.log('UNCAUGHT EXCEPTION');
|
|
9
|
+
// eslint-disable-next-line security-node/detect-crlf
|
|
10
|
+
console.log(err.stack);
|
|
11
|
+
process.exit(1);
|
|
12
|
+
});
|
|
9
13
|
|
|
10
|
-
process.once('SIGTERM', function () {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
});
|
|
14
|
+
process.once('SIGTERM', function () {
|
|
15
|
+
console.log('Received TERM signal. Exiting.');
|
|
16
|
+
process.exit(0);
|
|
17
|
+
});
|
|
14
18
|
|
|
15
|
-
process.once('SIGINT', function () {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
});
|
|
19
|
+
process.once('SIGINT', function () {
|
|
20
|
+
console.log('Received INT signal. Exiting.');
|
|
21
|
+
process.exit(0);
|
|
22
|
+
});
|
|
19
23
|
|
|
20
|
-
process.once('exit', function () {
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
process.once('exit', async function () {
|
|
25
|
+
console.log('destroying all platform instances');
|
|
26
|
+
await sockethub.removeAllPlatformInstances();
|
|
27
|
+
});
|
|
23
28
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
sockethub.boot();
|
|
29
|
+
sockethub.boot();
|
|
30
|
+
})();
|