fastify-rabbitmq 1.0.0 → 1.1.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 -4
- package/dist/cjs/index.js +2 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/types/index.d.ts +4 -0
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Fastify RabbitMQ
|
|
2
2
|
|
|
3
3
|
A Fastify RabbitMQ Plugin Developed in Pure TypeScript.
|
|
4
|
-
It uses the [rabbitmq-client](https://github.com/
|
|
4
|
+
It uses the [rabbitmq-client](https://github.com/cody-greene/node-rabbitmq-client/) plugin as a wrapper.
|
|
5
5
|
|
|
6
6
|
The build exports this to valid ESM and CJS for ease of cross-compatibility.
|
|
7
7
|
|
|
@@ -47,6 +47,7 @@ export default fp<FastifyRabbitMQOptions>((fastify, options, done) => {
|
|
|
47
47
|
|
|
48
48
|
});
|
|
49
49
|
```
|
|
50
|
+
### Quick Setup on the Client Side
|
|
50
51
|
|
|
51
52
|
Within any "endpoint" function, or if you have access to ```fastify.rabbitmq``` you can then call:
|
|
52
53
|
|
|
@@ -63,8 +64,6 @@ fastify.get('/rabbitmq', async (request, reply) => {
|
|
|
63
64
|
|
|
64
65
|
Sending the string ```bar``` to the queue called ```foo```.
|
|
65
66
|
|
|
66
|
-
### Quick Setup on the Client Side
|
|
67
|
-
|
|
68
67
|
## Full Documentation
|
|
69
68
|
|
|
70
69
|
### Options
|
|
@@ -100,4 +99,4 @@ If not provided, your application will fail to load.
|
|
|
100
99
|
|
|
101
100
|
## License
|
|
102
101
|
|
|
103
|
-
Licensed under [MIT](./LICENSE).
|
|
102
|
+
Licensed under [MIT](./LICENSE).
|
package/dist/cjs/index.js
CHANGED
|
@@ -17,6 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.decorateFastifyInstance = void 0;
|
|
20
21
|
const fastify_plugin_1 = __importDefault(require("fastify-plugin"));
|
|
21
22
|
const rabbitmq_client_1 = require("rabbitmq-client");
|
|
22
23
|
const errors_js_1 = require("./errors.js");
|
|
@@ -47,6 +48,7 @@ const decorateFastifyInstance = (fastify, options, connection) => {
|
|
|
47
48
|
fastify.decorate('rabbitmq', connection);
|
|
48
49
|
}
|
|
49
50
|
};
|
|
51
|
+
exports.decorateFastifyInstance = decorateFastifyInstance;
|
|
50
52
|
/**
|
|
51
53
|
* Main Function
|
|
52
54
|
* @since 1.0.0
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { FastifyInstance } from 'fastify';
|
|
2
|
+
import { ConnectionOptions } from 'rabbitmq-client';
|
|
1
3
|
import { FastifyRabbitMQOptions } from './decorate.js';
|
|
2
4
|
export * from './types.js';
|
|
5
|
+
declare const decorateFastifyInstance: (fastify: FastifyInstance, options: FastifyRabbitMQOptions, connection: any) => void;
|
|
3
6
|
/**
|
|
4
7
|
* Main Function
|
|
5
8
|
* @since 1.0.0
|
|
@@ -20,3 +23,4 @@ export * from './types.js';
|
|
|
20
23
|
*/
|
|
21
24
|
declare const fastifyRabbit: import("fastify").FastifyPluginCallback<FastifyRabbitMQOptions, import("fastify").RawServerDefault, import("fastify").FastifyTypeProviderDefault, import("fastify").FastifyBaseLogger>;
|
|
22
25
|
export default fastifyRabbit;
|
|
26
|
+
export { decorateFastifyInstance, FastifyRabbitMQOptions, ConnectionOptions };
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,gBAAgB,CAAA;A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IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,WAAW,EAAE;QAC3C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAA;QACxD,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;KACzC;AACH,CAAC,CAAA;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,aAAa,GAAG,EAAE,CAAyB,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;IAC7E,MAAM,YAAY,CAAC,IAAI,CAAC,CAAA;IAExB,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAE3B,MAAM,CAAC,GAAG,IAAI,kBAAkB,CAAC,UAAU,CAAC,CAAA;IAE5C,uBAAuB,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAEzC,IAAI,EAAE,CAAA;AACR,CAAC,CAAC,CAAA;AAEF,eAAe,aAAa,CAAA;AAE5B,OAAO,EAAE,uBAAuB,EAA6C,CAAA"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { FastifyInstance } from 'fastify';
|
|
2
|
+
import { ConnectionOptions } from 'rabbitmq-client';
|
|
1
3
|
import { FastifyRabbitMQOptions } from './decorate.js';
|
|
2
4
|
export * from './types.js';
|
|
5
|
+
declare const decorateFastifyInstance: (fastify: FastifyInstance, options: FastifyRabbitMQOptions, connection: any) => void;
|
|
3
6
|
/**
|
|
4
7
|
* Main Function
|
|
5
8
|
* @since 1.0.0
|
|
@@ -20,3 +23,4 @@ export * from './types.js';
|
|
|
20
23
|
*/
|
|
21
24
|
declare const fastifyRabbit: import("fastify").FastifyPluginCallback<FastifyRabbitMQOptions, import("fastify").RawServerDefault, import("fastify").FastifyTypeProviderDefault, import("fastify").FastifyBaseLogger>;
|
|
22
25
|
export default fastifyRabbit;
|
|
26
|
+
export { decorateFastifyInstance, FastifyRabbitMQOptions, ConnectionOptions };
|
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fastify-rabbitmq",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "A Fastify RabbitMQ Plugin Developed in Pure TypeScript.",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
7
7
|
"types": "./dist/types/index.d.ts",
|
|
8
|
+
"release": {
|
|
9
|
+
"branches": [
|
|
10
|
+
"main"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
8
13
|
"exports": {
|
|
9
14
|
".": {
|
|
10
15
|
"types": "./dist/types/index.d.ts",
|