amqplib 0.10.9 → 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.
- package/.claude/commands/lint-disable.md +9 -0
- package/.claude/commands/lint-enable.md +12 -0
- package/.claude/settings.local.json +16 -0
- package/.github/workflows/publish.yml +1 -1
- package/.github/workflows/test.yml +1 -1
- package/CHANGELOG.md +34 -0
- package/CLAUDE.md +12 -0
- package/Makefile +5 -12
- package/README.md +0 -5
- package/bin/generate-defs.js +382 -369
- package/biome.json +51 -0
- package/callback_api.js +12 -8
- package/channel_api.js +5 -10
- package/examples/direct_reply_to_client.js +9 -5
- package/examples/direct_reply_to_server.js +8 -6
- package/examples/headers.js +13 -10
- package/examples/receive_generator.js +13 -20
- package/examples/send_generators.js +2 -9
- package/examples/ssl.js +2 -3
- package/examples/stream_queues/receive_stream.js +39 -36
- package/examples/stream_queues/send_stream.js +26 -29
- package/examples/tutorials/callback_api/emit_log.js +4 -3
- package/examples/tutorials/callback_api/emit_log_direct.js +5 -4
- package/examples/tutorials/callback_api/emit_log_topic.js +5 -4
- package/examples/tutorials/callback_api/new_task.js +5 -4
- package/examples/tutorials/callback_api/receive.js +16 -10
- package/examples/tutorials/callback_api/receive_logs.js +17 -11
- package/examples/tutorials/callback_api/receive_logs_direct.js +19 -13
- package/examples/tutorials/callback_api/receive_logs_topic.js +19 -14
- package/examples/tutorials/callback_api/rpc_client.js +20 -16
- package/examples/tutorials/callback_api/rpc_server.js +27 -21
- package/examples/tutorials/callback_api/send.js +4 -3
- package/examples/tutorials/callback_api/worker.js +18 -13
- package/examples/tutorials/emit_log.js +4 -6
- package/examples/tutorials/emit_log_direct.js +5 -7
- package/examples/tutorials/emit_log_topic.js +5 -7
- package/examples/tutorials/new_task.js +4 -6
- package/examples/tutorials/receive.js +8 -4
- package/examples/tutorials/receive_logs.js +10 -6
- package/examples/tutorials/receive_logs_direct.js +16 -10
- package/examples/tutorials/receive_logs_topic.js +16 -11
- package/examples/tutorials/rpc_client.js +17 -15
- package/examples/tutorials/rpc_server.js +9 -8
- package/examples/tutorials/send.js +4 -6
- package/examples/tutorials/worker.js +17 -14
- package/examples/waitForConfirms.js +2 -2
- package/lefthook.yml +14 -0
- package/lib/api_args.js +124 -149
- package/lib/bitset.js +28 -18
- package/lib/callback_model.js +134 -190
- package/lib/channel.js +175 -213
- package/lib/channel_model.js +41 -85
- package/lib/codec.js +257 -228
- package/lib/connect.js +76 -83
- package/lib/connection.js +204 -240
- package/lib/credentials.js +21 -29
- package/lib/defs.js +2559 -1927
- package/lib/error.js +5 -6
- package/lib/format.js +15 -33
- package/lib/frame.js +66 -66
- package/lib/heartbeat.js +17 -24
- package/lib/mux.js +32 -41
- package/package.json +8 -5
- package/test/bitset.test.js +65 -0
- package/test/callback_api.test.js +438 -0
- package/test/channel.test.js +592 -0
- package/test/channel_api.test.js +537 -0
- package/test/codec.test.js +172 -0
- package/test/connect.test.js +196 -0
- package/test/connection.test.js +330 -0
- package/test/data.test.js +33 -0
- package/test/frame.test.js +180 -0
- package/test/lib/data.js +249 -0
- package/test/lib/util.js +223 -0
- package/test/mux.test.js +215 -0
- package/test/bitset.js +0 -69
- package/test/callback_api.js +0 -379
- package/test/channel.js +0 -621
- package/test/channel_api.js +0 -606
- package/test/codec.js +0 -237
- package/test/connect.js +0 -204
- package/test/connection.js +0 -390
- package/test/data.js +0 -269
- package/test/frame.js +0 -191
- package/test/mux.js +0 -203
- package/test/util.js +0 -217
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Please follow the following process when I ask you to disable a lint rule using /lint-disable $rule
|
|
2
|
+
|
|
3
|
+
1. Create and change to a new branch. Ask for the branch name.
|
|
4
|
+
2. If the rule is off by default, delete it (See https://biomejs.dev/linter/javascript/rules/ for rule details)
|
|
5
|
+
3. If the rule is on by default, configure it to off in biome.json
|
|
6
|
+
4. Update the project changelog
|
|
7
|
+
5. Add the changes
|
|
8
|
+
6. Commit the changes
|
|
9
|
+
7. Push the changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Please follow the following process when I ask you to enable a lint rule using /lint-enable $rule
|
|
2
|
+
|
|
3
|
+
1. Create and change to a new branch. Ask for the branch name.
|
|
4
|
+
2. Configure the rule to error in biome.json
|
|
5
|
+
3. Run lint (npm run lint). If there are NO errors, goto step 8
|
|
6
|
+
4. Use biome to SAFELY auto fix (npm run lint -- --fix). If there are errors stop and ask for instruction.
|
|
7
|
+
5. Run the tests (npm test). If there are errors, stop and ask for instruction.
|
|
8
|
+
6. If the rule defaults to error, delete it (See https://biomejs.dev/linter/javascript/rules/ for rule details)
|
|
9
|
+
7. Update the project changelog
|
|
10
|
+
8. Add the changes
|
|
11
|
+
9. Commit the changes
|
|
12
|
+
10. Push the changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(npx oxlint:*)",
|
|
5
|
+
"Bash(npm t)",
|
|
6
|
+
"Bash(git add:*)",
|
|
7
|
+
"Bash(git commit:*)",
|
|
8
|
+
"Bash(npm run lint:*)",
|
|
9
|
+
"Bash(git checkout:*)",
|
|
10
|
+
"Bash(npx biome lint:*)",
|
|
11
|
+
"Bash(node:*)"
|
|
12
|
+
],
|
|
13
|
+
"deny": [],
|
|
14
|
+
"ask": []
|
|
15
|
+
}
|
|
16
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# Change log for amqplib
|
|
2
2
|
|
|
3
|
+
## v1.0.1
|
|
4
|
+
- Fix TLS connection failure when connecting to an AMQPS broker using an IP address (IPv4 or IPv6) — setting servername to an IP is not permitted by TLS SNI and throws ERR_INVALID_ARG_VALUE in Node.js 25+
|
|
5
|
+
|
|
6
|
+
## v1.0.0
|
|
7
|
+
- **BREAKING**: Update minimum Node.js requirement to v18
|
|
8
|
+
- Introduce Biome formatter for consistent code formatting
|
|
9
|
+
- Add automated formatting via pre-commit hooks using Lefthook
|
|
10
|
+
- Format entire codebase with standardised formatting rules
|
|
11
|
+
- Add npm format script for manual code formatting
|
|
12
|
+
- Enable noUnusedFunctionParameters lint rule and fix all violations
|
|
13
|
+
- Enable noUnusedVariables lint rule and remove all unused variables from codebase
|
|
14
|
+
- Replace all var declarations with let/const for modern JavaScript standards
|
|
15
|
+
- Ensure parseInt calls use explicit radix parameter for clarity and reliability
|
|
16
|
+
- Fix precision loss in test data generators by using JavaScript safe integer limits
|
|
17
|
+
- Add block scoping to switch statement cases to prevent variable declaration issues
|
|
18
|
+
- Enforce const usage for variables that are never reassigned
|
|
19
|
+
- Add node: protocol prefix to Node.js builtin module imports for clarity
|
|
20
|
+
- Use modern exponentiation operator (**) instead of Math.pow()
|
|
21
|
+
- Replace string concatenation with modern template literals
|
|
22
|
+
- Remove redundant 'use strict' directives as modules are automatically in strict mode
|
|
23
|
+
- Refactor assignment-in-expression patterns to improve code clarity and readability
|
|
24
|
+
- Replace comma operators with individual statements for clearer, more readable code
|
|
25
|
+
- Split comma-separated variable declarations into individual statements for consistency
|
|
26
|
+
- Replace Object.prototype.hasOwnProperty() with safer Object.hasOwn() method
|
|
27
|
+
- Enforce strict equality checks (=== and !==) instead of loose equality (== and !=)
|
|
28
|
+
- Replace global isNaN with Number.isNaN for safer type checking
|
|
29
|
+
- Ensure no variable redeclarations exist to prevent shadowing issues
|
|
30
|
+
- Replace global isFinite with Number.isFinite for safer numeric validation
|
|
31
|
+
- Enable useArrowFunction lint rule to prefer arrow functions for cleaner syntax
|
|
32
|
+
- Enable noUselessCatch lint rule to prevent useless catch blocks that only rethrow errors
|
|
33
|
+
- Enable noArguments rule to enforce modern rest parameters instead of legacy arguments object
|
|
34
|
+
- Enable bracketSpacing formatting rule to add spaces inside object literals
|
|
35
|
+
- Migrate test suite from Mocha to Node.js built-in test runner
|
|
36
|
+
|
|
3
37
|
## v0.10.9
|
|
4
38
|
- Add support for IPv6 urls
|
|
5
39
|
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Project-Specific Guidelines for amqplib
|
|
2
|
+
|
|
3
|
+
## Generated Files - DO NOT EDIT
|
|
4
|
+
- `lib/defs.js` - This file is generated code. NEVER modify it directly.
|
|
5
|
+
- Generated via `make lib/defs.js` from the AMQP specification
|
|
6
|
+
- If linting issues arise, exclude this file from linting rules rather than modifying it
|
|
7
|
+
|
|
8
|
+
## Commit Requirements
|
|
9
|
+
- NEVER commit when tests are failing
|
|
10
|
+
- NEVER commit when there are lint errors
|
|
11
|
+
- Always run `npm test` and `npm run lint` before committing
|
|
12
|
+
- If tests are failing, investigate and fix the issue before proceeding
|
package/Makefile
CHANGED
|
@@ -2,12 +2,9 @@ RABBITMQ_SRC_VERSION=v3.12.13
|
|
|
2
2
|
JSON=amqp-rabbitmq-0.9.1.json
|
|
3
3
|
AMQP_JSON=https://raw.githubusercontent.com/rabbitmq/rabbitmq-server/$(RABBITMQ_SRC_VERSION)/deps/rabbitmq_codegen/$(JSON)
|
|
4
4
|
|
|
5
|
-
NODEJS_VERSIONS='
|
|
5
|
+
NODEJS_VERSIONS='18.1.0' '20.10.0' '22.14.0' '24.7.0'
|
|
6
6
|
|
|
7
|
-
MOCHA=./node_modules/.bin/mocha
|
|
8
|
-
_MOCHA=./node_modules/.bin/_mocha
|
|
9
7
|
UGLIFY=./node_modules/.bin/uglifyjs
|
|
10
|
-
NYC=./node_modules/.bin/nyc
|
|
11
8
|
|
|
12
9
|
.PHONY: test test-all-nodejs coverage lib/defs.js
|
|
13
10
|
|
|
@@ -16,17 +13,16 @@ error:
|
|
|
16
13
|
@exit 1
|
|
17
14
|
|
|
18
15
|
test:
|
|
19
|
-
|
|
16
|
+
node --test
|
|
20
17
|
|
|
21
18
|
test-all-nodejs:
|
|
22
19
|
for v in $(NODEJS_VERSIONS); \
|
|
23
20
|
do echo "-- Node version $$v --"; \
|
|
24
|
-
nave use $$v
|
|
21
|
+
nave use $$v node --test; \
|
|
25
22
|
done
|
|
26
23
|
|
|
27
|
-
coverage:
|
|
28
|
-
|
|
29
|
-
@echo "HTML report at file://$$(pwd)/coverage/lcov-report/index.html"
|
|
24
|
+
coverage:
|
|
25
|
+
node --test --test-coverage
|
|
30
26
|
|
|
31
27
|
lib/defs.js: clean bin/generate-defs test
|
|
32
28
|
|
|
@@ -42,8 +38,5 @@ bin/generate-defs: $(UGLIFY) bin/generate-defs.js bin/amqp-rabbitmq-0.9.1.json
|
|
|
42
38
|
bin/amqp-rabbitmq-0.9.1.json:
|
|
43
39
|
curl -L $(AMQP_JSON) > $@
|
|
44
40
|
|
|
45
|
-
$(ISTANBUL):
|
|
46
|
-
npm install
|
|
47
|
-
|
|
48
41
|
$(UGLIFY):
|
|
49
42
|
npm install
|
package/README.md
CHANGED
|
@@ -9,11 +9,6 @@ A library for making AMQP 0-9-1 clients for Node.JS, and an AMQP 0-9-1 client fo
|
|
|
9
9
|
|
|
10
10
|
npm install amqplib
|
|
11
11
|
|
|
12
|
-
## ❤️ Help Support Jack
|
|
13
|
-
One of my close friends, Jack, was recently diagnosed with terminal brain cancer (grade 4 astrocytoma). He’s a young father facing an unimaginably tough road with remarkable courage. Thanks to chemotherapy, radiotherapy, and your support, two of his tumours have stopped showing activity. Donations help Jack continue accessing promising complementary therapies, attend hospital appointments, and spend meaningful time with his children.
|
|
14
|
-
|
|
15
|
-
If you’ve benefited from amqplib, please consider supporting Jack’s journey through his [J Crushing Cancer](https://www.gofundme.com/f/j-crushing-cancer) gofundme page. Thank you - @cressie176
|
|
16
|
-
|
|
17
12
|
## RabbitMQ Compatibility
|
|
18
13
|
|
|
19
14
|
Only `0.10.7` and later versions of this library are compatible with RabbitMQ 4.1.0 (and later releases).
|