aedes 0.51.2 → 1.0.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.
Files changed (67) hide show
  1. package/.github/actions/sticky-pr-comment/action.yml +55 -0
  2. package/.github/workflows/benchmark-compare-serial.yml +60 -0
  3. package/.github/workflows/ci.yml +12 -17
  4. package/.release-it.json +18 -0
  5. package/.taprc +15 -6
  6. package/README.md +6 -4
  7. package/aedes.d.ts +0 -6
  8. package/aedes.js +270 -238
  9. package/benchmarks/README.md +33 -0
  10. package/benchmarks/pingpong.js +94 -25
  11. package/benchmarks/receiver.js +77 -0
  12. package/benchmarks/report.js +150 -0
  13. package/benchmarks/runBenchmarks.js +118 -0
  14. package/benchmarks/sender.js +86 -0
  15. package/benchmarks/server.js +19 -18
  16. package/checkVersion.js +20 -0
  17. package/docs/Aedes.md +66 -8
  18. package/docs/Client.md +3 -4
  19. package/docs/Examples.md +39 -22
  20. package/docs/MIGRATION.md +50 -0
  21. package/eslint.config.js +8 -0
  22. package/example.js +51 -40
  23. package/examples/clusters/index.js +28 -23
  24. package/examples/clusters/package.json +10 -6
  25. package/lib/client.js +405 -306
  26. package/lib/handlers/connect.js +42 -38
  27. package/lib/handlers/index.js +9 -11
  28. package/lib/handlers/ping.js +2 -3
  29. package/lib/handlers/puback.js +5 -5
  30. package/lib/handlers/publish.js +29 -14
  31. package/lib/handlers/pubrec.js +9 -17
  32. package/lib/handlers/pubrel.js +34 -25
  33. package/lib/handlers/subscribe.js +54 -43
  34. package/lib/handlers/unsubscribe.js +16 -19
  35. package/lib/qos-packet.js +14 -17
  36. package/lib/utils.js +5 -12
  37. package/lib/write.js +4 -5
  38. package/package.json +134 -136
  39. package/test/auth.js +468 -804
  40. package/test/basic.js +613 -575
  41. package/test/bridge.js +44 -40
  42. package/test/client-pub-sub.js +531 -504
  43. package/test/close_socket_by_other_party.js +137 -102
  44. package/test/connect.js +487 -484
  45. package/test/drain-timeout.js +593 -0
  46. package/test/drain-toxiproxy.js +620 -0
  47. package/test/events.js +174 -144
  48. package/test/helper.js +351 -73
  49. package/test/keep-alive.js +40 -67
  50. package/test/meta.js +257 -210
  51. package/test/not-blocking.js +93 -197
  52. package/test/qos1.js +464 -554
  53. package/test/qos2.js +308 -393
  54. package/test/regr-21.js +39 -21
  55. package/test/require.cjs +22 -0
  56. package/test/retain.js +349 -398
  57. package/test/topics.js +176 -183
  58. package/test/types/aedes.test-d.ts +4 -8
  59. package/test/will.js +310 -428
  60. package/types/instance.d.ts +40 -35
  61. package/types/packet.d.ts +10 -10
  62. package/.coveralls.yml +0 -1
  63. package/benchmarks/bombing.js +0 -34
  64. package/benchmarks/bombingQoS1.js +0 -36
  65. package/benchmarks/throughputCounter.js +0 -23
  66. package/benchmarks/throughputCounterQoS1.js +0 -33
  67. package/types/.eslintrc.json +0 -47
package/package.json CHANGED
@@ -1,138 +1,136 @@
1
1
  {
2
- "name": "aedes",
3
- "version": "0.51.2",
4
- "description": "Stream-based MQTT broker",
5
- "main": "aedes.js",
6
- "types": "aedes.d.ts",
7
- "scripts": {
8
- "lint": "npm run lint:standard && npm run lint:typescript && npm run lint:markdown",
9
- "lint:fix": "standard --fix && eslint -c types/.eslintrc.json --fix aedes.d.ts types/**/*.ts test/types/**/*.test-d.ts",
10
- "lint:standard": "standard --verbose | snazzy",
11
- "lint:typescript": "eslint -c types/.eslintrc.json aedes.d.ts types/**/*.ts test/types/**/*.test-d.ts",
12
- "lint:markdown": "markdownlint docs/*.md README.md",
13
- "test": "npm run lint && npm run unit && npm run test:typescript",
14
- "test:ci": "npm run lint && npm run unit -- --cov --no-check-coverage --coverage-report=lcovonly && npm run test:typescript",
15
- "test:report": "npm run lint && npm run unit:report && npm run test:typescript",
16
- "test:typescript": "tsd",
17
- "unit": "tap -J test/*.js",
18
- "unit:report": "tap -J test/*.js --cov --coverage-report=html --coverage-report=cobertura | tee out.tap",
19
- "license-checker": "license-checker --production --onlyAllow=\"MIT;ISC;BSD-3-Clause;BSD-2-Clause;0BSD\"",
20
- "release": "read -p 'GITHUB_TOKEN: ' GITHUB_TOKEN && export GITHUB_TOKEN=$GITHUB_TOKEN && release-it --disable-metrics"
21
- },
22
- "release-it": {
23
- "github": {
24
- "release": true
25
- },
26
- "git": {
27
- "tagName": "v${version}"
28
- },
29
- "hooks": {
30
- "before:init": [
31
- "npm run test:ci"
32
- ]
33
- },
34
- "npm": {
35
- "publish": true
36
- }
37
- },
38
- "pre-commit": [
39
- "test"
40
- ],
41
- "tsd": {
42
- "directory": "test/types"
43
- },
44
- "standard": {
45
- "ignore": [
46
- "types/*",
47
- "test/types/*"
48
- ]
49
- },
50
- "repository": {
51
- "type": "git",
52
- "url": "git+https://github.com/moscajs/aedes.git"
53
- },
54
- "keywords": [
55
- "mqtt",
56
- "broker",
57
- "server",
58
- "mqtt-server",
59
- "stream",
60
- "streams",
61
- "publish",
62
- "subscribe",
63
- "pubsub",
64
- "messaging",
65
- "mosca",
66
- "mosquitto",
67
- "iot",
68
- "internet",
69
- "of",
70
- "things"
71
- ],
72
- "author": "Matteo Collina <hello@matteocollina.com>",
73
- "contributors": [
74
- {
75
- "name": "Gavin D'mello",
76
- "url": "https://github.com/GavinDmello"
77
- },
78
- {
79
- "name": "Behrad Zari",
80
- "url": "https://github.com/behrad"
81
- },
82
- {
83
- "name": "Gnought",
84
- "url": "https://github.com/gnought"
85
- },
86
- {
87
- "name": "Daniel Lando",
88
- "url": "https://github.com/robertsLando"
89
- }
90
- ],
91
- "license": "MIT",
92
- "funding": {
93
- "type": "opencollective",
94
- "url": "https://opencollective.com/aedes"
95
- },
96
- "bugs": {
97
- "url": "https://github.com/moscajs/aedes/issues"
98
- },
99
- "homepage": "https://github.com/moscajs/aedes#readme",
100
- "engines": {
101
- "node": ">=16"
102
- },
103
- "devDependencies": {
104
- "@sinonjs/fake-timers": "^11.2.2",
105
- "@types/node": "^20.11.17",
106
- "@typescript-eslint/eslint-plugin": "^7.0.1",
107
- "@typescript-eslint/parser": "^7.0.1",
108
- "concat-stream": "^2.0.0",
109
- "duplexify": "^4.1.2",
110
- "license-checker": "^25.0.1",
111
- "markdownlint-cli": "^0.41.0",
112
- "mqtt": "^5.3.5",
113
- "mqtt-connection": "^4.1.0",
114
- "pre-commit": "^1.2.2",
115
- "proxyquire": "^2.1.3",
116
- "release-it": "^17.0.5",
117
- "snazzy": "^9.0.0",
118
- "standard": "^17.1.0",
119
- "tap": "^16.3.10",
120
- "tsd": "^0.31.0",
121
- "typescript": "^5.3.3",
122
- "websocket-stream": "^5.5.2"
123
- },
124
- "dependencies": {
125
- "aedes-packet": "^3.0.0",
126
- "aedes-persistence": "^9.1.2",
127
- "end-of-stream": "^1.4.4",
128
- "fastfall": "^1.5.1",
129
- "fastparallel": "^2.4.1",
130
- "fastseries": "^2.0.0",
131
- "hyperid": "^3.2.0",
132
- "mqemitter": "^6.0.0",
133
- "mqtt-packet": "^9.0.0",
134
- "retimer": "^4.0.0",
135
- "reusify": "^1.0.4",
136
- "uuid": "^9.0.1"
137
- }
2
+ "name": "aedes",
3
+ "version": "1.0.0",
4
+ "description": "Stream-based MQTT broker",
5
+ "exports": "./aedes.js",
6
+ "type": "module",
7
+ "types": "aedes.d.ts",
8
+ "scripts": {
9
+ "lint": "npm run lint:code && npm run lint:markdown",
10
+ "lint:fix": "eslint --fix",
11
+ "lint:code": "eslint",
12
+ "lint:markdown": "markdownlint docs/*.md README.md",
13
+ "lint:markdown:fix": "markdownlint --fix docs/*.md README.md",
14
+ "test": "npm run lint && npm run unit && npm run test:typescript",
15
+ "test:ci": "npm run lint && npm run coverage && npm run test:typescript",
16
+ "test:report": "npm run lint && npm run unit:report && npm run test:typescript",
17
+ "test:typescript": "tsd",
18
+ "unit": "node checkVersion.js && npm run unit:v20win32 || npm run unit:other",
19
+ "unit:v20win32": "node --test --test-timeout=180000",
20
+ "unit:other": "node --test --test-timeout=180000 test/*.js test/*.cjs",
21
+ "coverage": "c8 --reporter=lcov npm run unit",
22
+ "coverage:report": "c8 report",
23
+ "license-checker": "license-checker --production --onlyAllow=\"MIT;ISC;BSD-3-Clause;BSD-2-Clause;0BSD\"",
24
+ "release": "read -p 'GITHUB_TOKEN: ' GITHUB_TOKEN && export GITHUB_TOKEN=$GITHUB_TOKEN && release-it --disable-metrics"
25
+ },
26
+ "pre-commit": [
27
+ "test"
28
+ ],
29
+ "tsd": {
30
+ "directory": "test/types"
31
+ },
32
+ "standard": {
33
+ "ignore": [
34
+ "types/*",
35
+ "test/types/*"
36
+ ]
37
+ },
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "git+https://github.com/moscajs/aedes.git"
41
+ },
42
+ "keywords": [
43
+ "mqtt",
44
+ "broker",
45
+ "server",
46
+ "mqtt-server",
47
+ "stream",
48
+ "streams",
49
+ "publish",
50
+ "subscribe",
51
+ "pubsub",
52
+ "messaging",
53
+ "mosca",
54
+ "mosquitto",
55
+ "iot",
56
+ "internet",
57
+ "of",
58
+ "things"
59
+ ],
60
+ "author": "Matteo Collina <hello@matteocollina.com>",
61
+ "contributors": [
62
+ {
63
+ "name": "Gavin D'mello",
64
+ "url": "https://github.com/GavinDmello"
65
+ },
66
+ {
67
+ "name": "Behrad Zari",
68
+ "url": "https://github.com/behrad"
69
+ },
70
+ {
71
+ "name": "Gnought",
72
+ "url": "https://github.com/gnought"
73
+ },
74
+ {
75
+ "name": "Daniel Lando",
76
+ "url": "https://github.com/robertsLando"
77
+ }
78
+ ],
79
+ "license": "MIT",
80
+ "funding": {
81
+ "type": "opencollective",
82
+ "url": "https://opencollective.com/aedes"
83
+ },
84
+ "bugs": {
85
+ "url": "https://github.com/moscajs/aedes/issues"
86
+ },
87
+ "homepage": "https://github.com/moscajs/aedes#readme",
88
+ "engines": {
89
+ "node": ">=20"
90
+ },
91
+ "devDependencies": {
92
+ "@fastify/pre-commit": "^2.2.0",
93
+ "@types/node": "^24.2.0",
94
+ "c8": "^10.1.3",
95
+ "eslint": "^9.32.0",
96
+ "license-checker": "^25.0.1",
97
+ "markdownlint-cli": "^0.45.0",
98
+ "mqtt": "^5.14.0",
99
+ "neostandard": "^0.12.2",
100
+ "release-it": "^19.0.4",
101
+ "testcontainers": "^11.9.0",
102
+ "toxiproxy-node-client": "^4.0.0",
103
+ "tsd": "^0.33.0",
104
+ "ws": "^8.18.3"
105
+ },
106
+ "dependencies": {
107
+ "aedes-packet": "^3.0.0",
108
+ "aedes-persistence": "^10.2.2",
109
+ "end-of-stream": "^1.4.5",
110
+ "fastfall": "^1.5.1",
111
+ "fastparallel": "^2.4.1",
112
+ "fastseries": "^2.0.0",
113
+ "hyperid": "^3.3.0",
114
+ "mqemitter": "^7.1.0",
115
+ "mqtt-packet": "^9.0.2",
116
+ "retimer": "^4.0.0",
117
+ "reusify": "^1.1.0",
118
+ "uuid": "^11.1.0"
119
+ },
120
+ "peerDependencies": {
121
+ "aedes-persistence-level": "^9.1.2",
122
+ "aedes-persistence-mongodb": "^9.3.1",
123
+ "aedes-persistence-redis": "^11.2.1"
124
+ },
125
+ "peerDependenciesMeta": {
126
+ "aedes-persistence-level": {
127
+ "optional": true
128
+ },
129
+ "aedes-persistence-mongodb": {
130
+ "optional": true
131
+ },
132
+ "aedes-persistence-redis": {
133
+ "optional": true
134
+ }
135
+ }
138
136
  }