aedes 0.51.3 → 1.0.1

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