@yourrentals/cloudevent-publisher-hapi 0.4.2 → 0.4.3
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 +34 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,11 +1,39 @@
|
|
|
1
|
-
# cloudevent-publisher-hapi
|
|
1
|
+
# @yourrentals/cloudevent-publisher-hapi
|
|
2
2
|
|
|
3
|
-
This library
|
|
3
|
+
This library defines a JS library to publish messages to the message bus.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```bash
|
|
8
|
+
yarn add @yourrentals/cloudevent-publisher-hapi
|
|
9
|
+
```
|
|
8
10
|
|
|
9
|
-
##
|
|
11
|
+
## Usage
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
```ts
|
|
14
|
+
import { Publisher } from '@yourrentals/cloudevent-publisher-hapi';
|
|
15
|
+
|
|
16
|
+
const publisher = new Publisher({
|
|
17
|
+
source: 'publisher',
|
|
18
|
+
topics: [
|
|
19
|
+
{
|
|
20
|
+
eventType: 'my-event',
|
|
21
|
+
topicArn: 'arn:aws:sns:eu-west-1:123456789012:my-topic',
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
await publisher.publish('my-event', {
|
|
27
|
+
data: {
|
|
28
|
+
foo: 'bar',
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
await publisher.publishBatch('my-event', [
|
|
33
|
+
{
|
|
34
|
+
data: {
|
|
35
|
+
foo: 'bar',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
]);
|
|
39
|
+
```
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yourrentals/cloudevent-publisher-hapi",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@yourrentals/cloudevent-publisher-core": "0.4.
|
|
5
|
+
"@yourrentals/cloudevent-publisher-core": "0.4.3"
|
|
6
6
|
},
|
|
7
7
|
"type": "commonjs",
|
|
8
8
|
"main": "./index.cjs.js",
|