@next-k8s/nats-test 1.0.9

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/CHANGELOG.md ADDED
@@ -0,0 +1,72 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## [1.0.9](https://github.com/mathiscode/next-k8s-boilerplate/compare/@next-k8s/nats-test@1.0.8...@next-k8s/nats-test@1.0.9) (2022-07-06)
7
+
8
+ **Note:** Version bump only for package @next-k8s/nats-test
9
+
10
+
11
+
12
+
13
+
14
+ ## 1.0.8 (2022-07-06)
15
+
16
+ **Note:** Version bump only for package @next-k8s/nats-test
17
+
18
+
19
+
20
+
21
+
22
+ ## 1.0.7 (2022-07-06)
23
+
24
+ **Note:** Version bump only for package @next-k8s/nats-test
25
+
26
+
27
+
28
+
29
+
30
+ ## 1.0.6 (2022-07-06)
31
+
32
+ **Note:** Version bump only for package @next-k8s/nats-test
33
+
34
+
35
+
36
+
37
+
38
+ ## 1.0.5 (2022-07-05)
39
+
40
+ **Note:** Version bump only for package @next-k8s/nats-test
41
+
42
+
43
+
44
+
45
+
46
+ ## 1.0.4 (2022-07-05)
47
+
48
+ **Note:** Version bump only for package @next-k8s/nats-test
49
+
50
+
51
+
52
+
53
+
54
+ ## 1.0.3 (2022-07-05)
55
+
56
+ **Note:** Version bump only for package @next-k8s/nats-test
57
+
58
+
59
+
60
+
61
+
62
+ ## 1.0.2 (2022-07-05)
63
+
64
+ **Note:** Version bump only for package @next-k8s/nats-test
65
+
66
+
67
+
68
+
69
+
70
+ ## 1.0.1 (2022-07-05)
71
+
72
+ **Note:** Version bump only for package @next-k8s/nats-test
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@next-k8s/nats-test",
3
+ "version": "1.0.9",
4
+ "description": "nats-test",
5
+ "scripts": {
6
+ "publisher": "ts-node-dev --rs --notify false src/publisher.ts",
7
+ "listener": "ts-node-dev --rs --notify false src/listener.ts"
8
+ },
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "dependencies": {
13
+ "@types/node": "^18.0.1",
14
+ "node-nats-streaming": "^0.3.2",
15
+ "ts-node-dev": "^2.0.0",
16
+ "typescript": "^4.7.4"
17
+ },
18
+ "gitHead": "e28ae26195b5a105e974ff366741832500b17b31"
19
+ }
package/pnpm-lock.yaml ADDED
@@ -0,0 +1,476 @@
1
+ lockfileVersion: 5.4
2
+
3
+ specifiers:
4
+ '@types/node': ^18.0.1
5
+ node-nats-streaming: ^0.3.2
6
+ ts-node-dev: ^2.0.0
7
+ typescript: ^4.7.4
8
+
9
+ dependencies:
10
+ '@types/node': 18.0.1
11
+ node-nats-streaming: 0.3.2
12
+ ts-node-dev: 2.0.0_qqrtuuv3y2pz7xoxv47yka6pmi
13
+ typescript: 4.7.4
14
+
15
+ packages:
16
+
17
+ /@cspotcode/source-map-support/0.8.1:
18
+ resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
19
+ engines: {node: '>=12'}
20
+ dependencies:
21
+ '@jridgewell/trace-mapping': 0.3.9
22
+ dev: false
23
+
24
+ /@jridgewell/resolve-uri/3.0.8:
25
+ resolution: {integrity: sha512-YK5G9LaddzGbcucK4c8h5tWFmMPBvRZ/uyWmN1/SbBdIvqGUdWGkJ5BAaccgs6XbzVLsqbPJrBSFwKv3kT9i7w==}
26
+ engines: {node: '>=6.0.0'}
27
+ dev: false
28
+
29
+ /@jridgewell/sourcemap-codec/1.4.14:
30
+ resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==}
31
+ dev: false
32
+
33
+ /@jridgewell/trace-mapping/0.3.9:
34
+ resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==}
35
+ dependencies:
36
+ '@jridgewell/resolve-uri': 3.0.8
37
+ '@jridgewell/sourcemap-codec': 1.4.14
38
+ dev: false
39
+
40
+ /@tsconfig/node10/1.0.9:
41
+ resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==}
42
+ dev: false
43
+
44
+ /@tsconfig/node12/1.0.11:
45
+ resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==}
46
+ dev: false
47
+
48
+ /@tsconfig/node14/1.0.3:
49
+ resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==}
50
+ dev: false
51
+
52
+ /@tsconfig/node16/1.0.3:
53
+ resolution: {integrity: sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==}
54
+ dev: false
55
+
56
+ /@types/node/18.0.1:
57
+ resolution: {integrity: sha512-CmR8+Tsy95hhwtZBKJBs0/FFq4XX7sDZHlGGf+0q+BRZfMbOTkzkj0AFAuTyXbObDIoanaBBW0+KEW+m3N16Wg==}
58
+ dev: false
59
+
60
+ /@types/strip-bom/3.0.0:
61
+ resolution: {integrity: sha512-xevGOReSYGM7g/kUBZzPqCrR/KYAo+F0yiPc85WFTJa0MSLtyFTVTU6cJu/aV4mid7IffDIWqo69THF2o4JiEQ==}
62
+ dev: false
63
+
64
+ /@types/strip-json-comments/0.0.30:
65
+ resolution: {integrity: sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==}
66
+ dev: false
67
+
68
+ /acorn-walk/8.2.0:
69
+ resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==}
70
+ engines: {node: '>=0.4.0'}
71
+ dev: false
72
+
73
+ /acorn/8.7.1:
74
+ resolution: {integrity: sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==}
75
+ engines: {node: '>=0.4.0'}
76
+ hasBin: true
77
+ dev: false
78
+
79
+ /anymatch/3.1.2:
80
+ resolution: {integrity: sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==}
81
+ engines: {node: '>= 8'}
82
+ dependencies:
83
+ normalize-path: 3.0.0
84
+ picomatch: 2.3.1
85
+ dev: false
86
+
87
+ /arg/4.1.3:
88
+ resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==}
89
+ dev: false
90
+
91
+ /balanced-match/1.0.2:
92
+ resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
93
+ dev: false
94
+
95
+ /binary-extensions/2.2.0:
96
+ resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==}
97
+ engines: {node: '>=8'}
98
+ dev: false
99
+
100
+ /brace-expansion/1.1.11:
101
+ resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==}
102
+ dependencies:
103
+ balanced-match: 1.0.2
104
+ concat-map: 0.0.1
105
+ dev: false
106
+
107
+ /braces/3.0.2:
108
+ resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==}
109
+ engines: {node: '>=8'}
110
+ dependencies:
111
+ fill-range: 7.0.1
112
+ dev: false
113
+
114
+ /buffer-from/1.1.2:
115
+ resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==}
116
+ dev: false
117
+
118
+ /chokidar/3.5.3:
119
+ resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==}
120
+ engines: {node: '>= 8.10.0'}
121
+ dependencies:
122
+ anymatch: 3.1.2
123
+ braces: 3.0.2
124
+ glob-parent: 5.1.2
125
+ is-binary-path: 2.1.0
126
+ is-glob: 4.0.3
127
+ normalize-path: 3.0.0
128
+ readdirp: 3.6.0
129
+ optionalDependencies:
130
+ fsevents: 2.3.2
131
+ dev: false
132
+
133
+ /concat-map/0.0.1:
134
+ resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
135
+ dev: false
136
+
137
+ /create-require/1.1.1:
138
+ resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==}
139
+ dev: false
140
+
141
+ /diff/4.0.2:
142
+ resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==}
143
+ engines: {node: '>=0.3.1'}
144
+ dev: false
145
+
146
+ /dynamic-dedupe/0.3.0:
147
+ resolution: {integrity: sha512-ssuANeD+z97meYOqd50e04Ze5qp4bPqo8cCkI4TRjZkzAUgIDTrXV1R8QCdINpiI+hw14+rYazvTRdQrz0/rFQ==}
148
+ dependencies:
149
+ xtend: 4.0.2
150
+ dev: false
151
+
152
+ /fill-range/7.0.1:
153
+ resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==}
154
+ engines: {node: '>=8'}
155
+ dependencies:
156
+ to-regex-range: 5.0.1
157
+ dev: false
158
+
159
+ /fs.realpath/1.0.0:
160
+ resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
161
+ dev: false
162
+
163
+ /fsevents/2.3.2:
164
+ resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
165
+ engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
166
+ os: [darwin]
167
+ requiresBuild: true
168
+ dev: false
169
+ optional: true
170
+
171
+ /function-bind/1.1.1:
172
+ resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==}
173
+ dev: false
174
+
175
+ /glob-parent/5.1.2:
176
+ resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}
177
+ engines: {node: '>= 6'}
178
+ dependencies:
179
+ is-glob: 4.0.3
180
+ dev: false
181
+
182
+ /glob/7.2.3:
183
+ resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
184
+ dependencies:
185
+ fs.realpath: 1.0.0
186
+ inflight: 1.0.6
187
+ inherits: 2.0.4
188
+ minimatch: 3.1.2
189
+ once: 1.4.0
190
+ path-is-absolute: 1.0.1
191
+ dev: false
192
+
193
+ /google-protobuf/3.20.1:
194
+ resolution: {integrity: sha512-XMf1+O32FjYIV3CYu6Tuh5PNbfNEU5Xu22X+Xkdb/DUexFlCzhvv7d5Iirm4AOwn8lv4al1YvIhzGrg2j9Zfzw==}
195
+ dev: false
196
+
197
+ /has/1.0.3:
198
+ resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==}
199
+ engines: {node: '>= 0.4.0'}
200
+ dependencies:
201
+ function-bind: 1.1.1
202
+ dev: false
203
+
204
+ /inflight/1.0.6:
205
+ resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==}
206
+ dependencies:
207
+ once: 1.4.0
208
+ wrappy: 1.0.2
209
+ dev: false
210
+
211
+ /inherits/2.0.4:
212
+ resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
213
+ dev: false
214
+
215
+ /is-binary-path/2.1.0:
216
+ resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==}
217
+ engines: {node: '>=8'}
218
+ dependencies:
219
+ binary-extensions: 2.2.0
220
+ dev: false
221
+
222
+ /is-core-module/2.9.0:
223
+ resolution: {integrity: sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==}
224
+ dependencies:
225
+ has: 1.0.3
226
+ dev: false
227
+
228
+ /is-extglob/2.1.1:
229
+ resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
230
+ engines: {node: '>=0.10.0'}
231
+ dev: false
232
+
233
+ /is-glob/4.0.3:
234
+ resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
235
+ engines: {node: '>=0.10.0'}
236
+ dependencies:
237
+ is-extglob: 2.1.1
238
+ dev: false
239
+
240
+ /is-number/7.0.0:
241
+ resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
242
+ engines: {node: '>=0.12.0'}
243
+ dev: false
244
+
245
+ /make-error/1.3.6:
246
+ resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==}
247
+ dev: false
248
+
249
+ /minimatch/3.1.2:
250
+ resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
251
+ dependencies:
252
+ brace-expansion: 1.1.11
253
+ dev: false
254
+
255
+ /minimist/1.2.6:
256
+ resolution: {integrity: sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==}
257
+ dev: false
258
+
259
+ /mkdirp/1.0.4:
260
+ resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==}
261
+ engines: {node: '>=10'}
262
+ hasBin: true
263
+ dev: false
264
+
265
+ /nats/1.4.12:
266
+ resolution: {integrity: sha512-Jf4qesEF0Ay0D4AMw3OZnKMRTQm+6oZ5q8/m4gpy5bTmiDiK6wCXbZpzEslmezGpE93LV3RojNEG6dpK/mysLQ==}
267
+ engines: {node: '>= 8.0.0'}
268
+ hasBin: true
269
+ dependencies:
270
+ nuid: 1.1.6
271
+ ts-nkeys: 1.0.16
272
+ dev: false
273
+
274
+ /node-nats-streaming/0.3.2:
275
+ resolution: {integrity: sha512-exeT+FwGYW3UbBSzu8a7ykwWoY6R/vjQLr1RoZ1gnoJ9F66WVvpMZQWCZzLxlf9XRpJTTygcp6P1+WRw9h07Sg==}
276
+ engines: {node: '>= 8.0.0'}
277
+ hasBin: true
278
+ dependencies:
279
+ google-protobuf: 3.20.1
280
+ nats: 1.4.12
281
+ nuid: 1.1.6
282
+ dev: false
283
+
284
+ /normalize-path/3.0.0:
285
+ resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}
286
+ engines: {node: '>=0.10.0'}
287
+ dev: false
288
+
289
+ /nuid/1.1.6:
290
+ resolution: {integrity: sha512-Eb3CPCupYscP1/S1FQcO5nxtu6l/F3k0MQ69h7f5osnsemVk5pkc8/5AyalVT+NCfra9M71U8POqF6EZa6IHvg==}
291
+ engines: {node: '>= 8.16.0'}
292
+ dev: false
293
+
294
+ /once/1.4.0:
295
+ resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
296
+ dependencies:
297
+ wrappy: 1.0.2
298
+ dev: false
299
+
300
+ /path-is-absolute/1.0.1:
301
+ resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}
302
+ engines: {node: '>=0.10.0'}
303
+ dev: false
304
+
305
+ /path-parse/1.0.7:
306
+ resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
307
+ dev: false
308
+
309
+ /picomatch/2.3.1:
310
+ resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
311
+ engines: {node: '>=8.6'}
312
+ dev: false
313
+
314
+ /readdirp/3.6.0:
315
+ resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}
316
+ engines: {node: '>=8.10.0'}
317
+ dependencies:
318
+ picomatch: 2.3.1
319
+ dev: false
320
+
321
+ /resolve/1.22.1:
322
+ resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==}
323
+ hasBin: true
324
+ dependencies:
325
+ is-core-module: 2.9.0
326
+ path-parse: 1.0.7
327
+ supports-preserve-symlinks-flag: 1.0.0
328
+ dev: false
329
+
330
+ /rimraf/2.7.1:
331
+ resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==}
332
+ hasBin: true
333
+ dependencies:
334
+ glob: 7.2.3
335
+ dev: false
336
+
337
+ /source-map-support/0.5.21:
338
+ resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==}
339
+ dependencies:
340
+ buffer-from: 1.1.2
341
+ source-map: 0.6.1
342
+ dev: false
343
+
344
+ /source-map/0.6.1:
345
+ resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
346
+ engines: {node: '>=0.10.0'}
347
+ dev: false
348
+
349
+ /strip-bom/3.0.0:
350
+ resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==}
351
+ engines: {node: '>=4'}
352
+ dev: false
353
+
354
+ /strip-json-comments/2.0.1:
355
+ resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==}
356
+ engines: {node: '>=0.10.0'}
357
+ dev: false
358
+
359
+ /supports-preserve-symlinks-flag/1.0.0:
360
+ resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
361
+ engines: {node: '>= 0.4'}
362
+ dev: false
363
+
364
+ /to-regex-range/5.0.1:
365
+ resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
366
+ engines: {node: '>=8.0'}
367
+ dependencies:
368
+ is-number: 7.0.0
369
+ dev: false
370
+
371
+ /tree-kill/1.2.2:
372
+ resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==}
373
+ hasBin: true
374
+ dev: false
375
+
376
+ /ts-nkeys/1.0.16:
377
+ resolution: {integrity: sha512-1qrhAlavbm36wtW+7NtKOgxpzl+70NTF8xlz9mEhiA5zHMlMxjj3sEVKWm3pGZhHXE0Q3ykjrj+OSRVaYw+Dqg==}
378
+ dependencies:
379
+ tweetnacl: 1.0.3
380
+ dev: false
381
+
382
+ /ts-node-dev/2.0.0_qqrtuuv3y2pz7xoxv47yka6pmi:
383
+ resolution: {integrity: sha512-ywMrhCfH6M75yftYvrvNarLEY+SUXtUvU8/0Z6llrHQVBx12GiFk5sStF8UdfE/yfzk9IAq7O5EEbTQsxlBI8w==}
384
+ engines: {node: '>=0.8.0'}
385
+ hasBin: true
386
+ peerDependencies:
387
+ node-notifier: '*'
388
+ typescript: '*'
389
+ peerDependenciesMeta:
390
+ node-notifier:
391
+ optional: true
392
+ dependencies:
393
+ chokidar: 3.5.3
394
+ dynamic-dedupe: 0.3.0
395
+ minimist: 1.2.6
396
+ mkdirp: 1.0.4
397
+ resolve: 1.22.1
398
+ rimraf: 2.7.1
399
+ source-map-support: 0.5.21
400
+ tree-kill: 1.2.2
401
+ ts-node: 10.8.2_qqrtuuv3y2pz7xoxv47yka6pmi
402
+ tsconfig: 7.0.0
403
+ typescript: 4.7.4
404
+ transitivePeerDependencies:
405
+ - '@swc/core'
406
+ - '@swc/wasm'
407
+ - '@types/node'
408
+ dev: false
409
+
410
+ /ts-node/10.8.2_qqrtuuv3y2pz7xoxv47yka6pmi:
411
+ resolution: {integrity: sha512-LYdGnoGddf1D6v8REPtIH+5iq/gTDuZqv2/UJUU7tKjuEU8xVZorBM+buCGNjj+pGEud+sOoM4CX3/YzINpENA==}
412
+ hasBin: true
413
+ peerDependencies:
414
+ '@swc/core': '>=1.2.50'
415
+ '@swc/wasm': '>=1.2.50'
416
+ '@types/node': '*'
417
+ typescript: '>=2.7'
418
+ peerDependenciesMeta:
419
+ '@swc/core':
420
+ optional: true
421
+ '@swc/wasm':
422
+ optional: true
423
+ dependencies:
424
+ '@cspotcode/source-map-support': 0.8.1
425
+ '@tsconfig/node10': 1.0.9
426
+ '@tsconfig/node12': 1.0.11
427
+ '@tsconfig/node14': 1.0.3
428
+ '@tsconfig/node16': 1.0.3
429
+ '@types/node': 18.0.1
430
+ acorn: 8.7.1
431
+ acorn-walk: 8.2.0
432
+ arg: 4.1.3
433
+ create-require: 1.1.1
434
+ diff: 4.0.2
435
+ make-error: 1.3.6
436
+ typescript: 4.7.4
437
+ v8-compile-cache-lib: 3.0.1
438
+ yn: 3.1.1
439
+ dev: false
440
+
441
+ /tsconfig/7.0.0:
442
+ resolution: {integrity: sha512-vZXmzPrL+EmC4T/4rVlT2jNVMWCi/O4DIiSj3UHg1OE5kCKbk4mfrXc6dZksLgRM/TZlKnousKH9bbTazUWRRw==}
443
+ dependencies:
444
+ '@types/strip-bom': 3.0.0
445
+ '@types/strip-json-comments': 0.0.30
446
+ strip-bom: 3.0.0
447
+ strip-json-comments: 2.0.1
448
+ dev: false
449
+
450
+ /tweetnacl/1.0.3:
451
+ resolution: {integrity: sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==}
452
+ dev: false
453
+
454
+ /typescript/4.7.4:
455
+ resolution: {integrity: sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==}
456
+ engines: {node: '>=4.2.0'}
457
+ hasBin: true
458
+ dev: false
459
+
460
+ /v8-compile-cache-lib/3.0.1:
461
+ resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==}
462
+ dev: false
463
+
464
+ /wrappy/1.0.2:
465
+ resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
466
+ dev: false
467
+
468
+ /xtend/4.0.2:
469
+ resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
470
+ engines: {node: '>=0.4'}
471
+ dev: false
472
+
473
+ /yn/3.1.1:
474
+ resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==}
475
+ engines: {node: '>=6'}
476
+ dev: false
@@ -0,0 +1,44 @@
1
+ import type { Message, Stan } from 'node-nats-streaming'
2
+ import Subjects from './subjects'
3
+
4
+ interface Event {
5
+ subject: Subjects;
6
+ data: any;
7
+ }
8
+
9
+ abstract class Listener<T extends Event> {
10
+ abstract subject: T['subject']
11
+ abstract queueGroupName: string
12
+ abstract onMessage (data: T['data'], msg: Message): void
13
+ private client: Stan
14
+ protected ackWait = 5000
15
+
16
+ constructor (client: Stan) {
17
+ this.client = client
18
+ }
19
+
20
+ subscriptionOptions () {
21
+ return this.client
22
+ .subscriptionOptions()
23
+ .setDeliverAllAvailable()
24
+ .setManualAckMode(true)
25
+ .setAckWait(this.ackWait)
26
+ .setDurableName(this.queueGroupName)
27
+ }
28
+
29
+ listen () {
30
+ const subscription = this.client.subscribe(this.subject, this.queueGroupName, this.subscriptionOptions())
31
+ subscription.on('message', (msg: Message) => {
32
+ const { subject, queueGroupName } = this
33
+ const data = this.parseMessage(msg)
34
+ this.onMessage(data, msg)
35
+ })
36
+ }
37
+
38
+ parseMessage (msg: Message) {
39
+ const data = msg.getData()
40
+ return typeof data === 'string' ? JSON.parse(data) : JSON.parse(data.toString('utf8'))
41
+ }
42
+ }
43
+
44
+ export default Listener
@@ -0,0 +1,29 @@
1
+ import type { Stan } from 'node-nats-streaming'
2
+
3
+ import Subjects from './subjects'
4
+
5
+ interface Event {
6
+ subject: Subjects,
7
+ data: any
8
+ }
9
+
10
+ abstract class Publisher<T extends Event> {
11
+ abstract subject: T['subject']
12
+ private client: Stan
13
+
14
+ constructor (client: Stan) {
15
+ this.client = client
16
+ }
17
+
18
+ publish (data: T['data']): Promise<T['data']> {
19
+ return new Promise((resolve, reject) => {
20
+ this.client.publish(this.subject, JSON.stringify(data), err => {
21
+ if (err) return reject(err)
22
+ console.log('Event published: ', this.subject)
23
+ resolve(data)
24
+ })
25
+ })
26
+ }
27
+ }
28
+
29
+ export default Publisher
@@ -0,0 +1,6 @@
1
+ enum Subjects {
2
+ TicketCreated = 'ticket:created',
3
+ OrderUpdated = 'order:updated'
4
+ }
5
+
6
+ export default Subjects
@@ -0,0 +1,12 @@
1
+ import Subjects from './subjects'
2
+
3
+ export interface TicketCreatedEvent {
4
+ subject: Subjects.TicketCreated;
5
+ data: {
6
+ id: string;
7
+ title: string;
8
+ price: number;
9
+ }
10
+ }
11
+
12
+ export default TicketCreatedEvent
@@ -0,0 +1,17 @@
1
+ import type { Message } from 'node-nats-streaming'
2
+ import type { TicketCreatedEvent } from './ticket-created-event'
3
+
4
+ import Listener from './base-listener'
5
+ import Subjects from './subjects'
6
+
7
+ class TicketCreatedListener extends Listener<TicketCreatedEvent> {
8
+ readonly subject = Subjects.TicketCreated
9
+ queueGroupName = 'payments-service'
10
+
11
+ onMessage (data: TicketCreatedEvent['data'], msg: Message) {
12
+ console.log('Ticket Created:', data.id, data.title, data.price)
13
+ msg.ack()
14
+ }
15
+ }
16
+
17
+ export default TicketCreatedListener
@@ -0,0 +1,10 @@
1
+ import type TicketCreatedEvent from './ticket-created-event'
2
+
3
+ import Publisher from './base-publisher'
4
+ import Subjects from './subjects'
5
+
6
+ class TicketCreatedPublisher extends Publisher<TicketCreatedEvent> {
7
+ subject: Subjects.TicketCreated = Subjects.TicketCreated
8
+ }
9
+
10
+ export default TicketCreatedPublisher
@@ -0,0 +1,26 @@
1
+ import nats from 'node-nats-streaming'
2
+ import { randomBytes } from 'crypto'
3
+
4
+ import TicketCreatedListener from './events/ticket-created-listener'
5
+
6
+ console.clear()
7
+
8
+ const clientId = randomBytes(4).toString('hex')
9
+ const client = nats.connect('next-k8s-nats', clientId, { url: 'http://localhost:4222' })
10
+
11
+ client.on('connect', () => {
12
+ console.log('Listener connected to NATS')
13
+
14
+ client.on('close', () => {
15
+ console.log('NATS connection closed')
16
+ process.exit()
17
+ })
18
+
19
+ new TicketCreatedListener(client).listen()
20
+ })
21
+
22
+ process.on('SIGINT', () => client.close())
23
+ process.on('SIGTERM', () => client.close())
24
+
25
+
26
+
@@ -0,0 +1,13 @@
1
+ import nats from 'node-nats-streaming'
2
+
3
+ import TicketCreatedPublisher from './events/ticket-created-publisher'
4
+
5
+ console.clear()
6
+
7
+ const client = nats.connect('next-k8s-nats', 'next-k8s-nats-ticket-publisher', { url: 'http://localhost:4222' })
8
+
9
+ client.on('connect', async () => {
10
+ console.log('Publisher connected to NATS')
11
+ const publisher = new TicketCreatedPublisher(client)
12
+ await publisher.publish({ id: '1234', title: 'Ticket#1234', price: 20000 })
13
+ })
package/tsconfig.json ADDED
@@ -0,0 +1,103 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig to read more about this file */
4
+
5
+ /* Projects */
6
+ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7
+ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
+ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
+
13
+ /* Language and Environment */
14
+ "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
15
+ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
+ // "jsx": "preserve", /* Specify what JSX code is generated. */
17
+ // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
18
+ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
20
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21
+ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
22
+ // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
23
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
24
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
26
+
27
+ /* Modules */
28
+ "module": "commonjs", /* Specify what module code is generated. */
29
+ // "rootDir": "./", /* Specify the root folder within your source files. */
30
+ // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
31
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
33
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34
+ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
35
+ // "types": [], /* Specify type package names to be included without being referenced in a source file. */
36
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
37
+ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
38
+ // "resolveJsonModule": true, /* Enable importing .json files. */
39
+ // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
40
+
41
+ /* JavaScript Support */
42
+ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
43
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
44
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
45
+
46
+ /* Emit */
47
+ // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
48
+ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
49
+ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
50
+ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
51
+ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
52
+ "outDir": "./build", /* Specify an output folder for all emitted files. */
53
+ // "removeComments": true, /* Disable emitting comments. */
54
+ // "noEmit": true, /* Disable emitting files from a compilation. */
55
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
56
+ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
57
+ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
58
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
59
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
60
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
61
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
62
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
63
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
64
+ // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
65
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
66
+ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
67
+ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
68
+ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
69
+ // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
70
+
71
+ /* Interop Constraints */
72
+ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
73
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
74
+ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
75
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
76
+ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
77
+
78
+ /* Type Checking */
79
+ "strict": true, /* Enable all strict type-checking options. */
80
+ // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
81
+ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
82
+ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
83
+ // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
84
+ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
85
+ // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
86
+ // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
87
+ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
88
+ // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
89
+ // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
90
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
91
+ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
92
+ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
93
+ // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
94
+ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
95
+ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
96
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
97
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
98
+
99
+ /* Completeness */
100
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
101
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
102
+ }
103
+ }