@weave-js/core 0.9.2 → 0.11.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.
Files changed (98) hide show
  1. package/lib/ExtendableError.js +33 -0
  2. package/lib/broker/context.js +25 -13
  3. package/lib/broker/{default-options.js → defaultOptions.js} +23 -5
  4. package/lib/broker/index.js +224 -194
  5. package/lib/buildRuntime.js +70 -0
  6. package/lib/cache/base.js +47 -31
  7. package/lib/cache/inMemory.js +140 -0
  8. package/lib/cache/index.js +2 -2
  9. package/lib/cache/lock.js +21 -4
  10. package/lib/constants.js +8 -5
  11. package/lib/errorHandler.js +19 -0
  12. package/lib/errors.js +17 -10
  13. package/lib/helper/{define-action.js → defineAction.js} +3 -1
  14. package/lib/helper/{define-broker-options.js → defineBrokerOptions.js} +2 -0
  15. package/lib/helper/{define-service.js → defineService.js} +4 -1
  16. package/lib/index.js +15 -89
  17. package/lib/logger/base.js +3 -3
  18. package/lib/logger/format/asHumanReadable.js +42 -0
  19. package/lib/logger/format/asJson.js +25 -0
  20. package/lib/logger/format/index.js +4 -0
  21. package/lib/logger/index.js +12 -5
  22. package/lib/logger/levels.js +9 -8
  23. package/lib/logger/tools.js +4 -25
  24. package/lib/logger/utils/colorize.js +32 -0
  25. package/lib/logger/utils/format.js +18 -4
  26. package/lib/metrics/constants.js +8 -6
  27. package/lib/metrics/types/gauge.js +1 -1
  28. package/lib/middlewares/action-hooks/index.js +62 -14
  29. package/lib/middlewares/bulkhead/index.js +5 -4
  30. package/lib/middlewares/cache/index.js +80 -0
  31. package/lib/middlewares/circuit-breaker/index.js +41 -16
  32. package/lib/middlewares/context-tracker/index.js +3 -3
  33. package/lib/middlewares/error-handler/index.js +3 -3
  34. package/lib/middlewares/index.js +2 -1
  35. package/lib/middlewares/metrics/getMiddlewareWrapper.js +2 -2
  36. package/lib/middlewares/metrics/index.js +2 -2
  37. package/lib/middlewares/retry/index.js +11 -10
  38. package/lib/middlewares/timeout/index.js +5 -5
  39. package/lib/middlewares/tracing/index.js +27 -14
  40. package/lib/middlewares/tracing/tags.js +43 -0
  41. package/lib/middlewares/validator/index.js +6 -6
  42. package/lib/registry/{action-endpoint.js → actionEndpoint.js} +0 -0
  43. package/lib/registry/collections/{action-collection.js → actionCollection.js} +2 -2
  44. package/lib/registry/collections/{endpoint-collection.js → endpointCollection.js} +19 -3
  45. package/lib/registry/collections/{event-collection.js → eventCollection.js} +15 -9
  46. package/lib/registry/collections/{node-collection.js → nodeCollection.js} +1 -1
  47. package/lib/registry/collections/{service-collection.js → serviceCollection.js} +2 -2
  48. package/lib/registry/{event-endpoint.js → eventEndpoint.js} +1 -1
  49. package/lib/registry/node.js +1 -1
  50. package/lib/registry/registry.js +10 -23
  51. package/lib/registry/service/service.js +2 -2
  52. package/lib/registry/{service-item.js → serviceItem.js} +1 -1
  53. package/lib/runtime/{init-action-invoker.js → initActionInvoker.js} +3 -3
  54. package/lib/runtime/{init-cache.js → initCache.js} +0 -0
  55. package/lib/runtime/{init-context-factory.js → initContextFactory.js} +2 -2
  56. package/lib/runtime/{init-eventbus.js → initEventbus.js} +11 -10
  57. package/lib/runtime/{init-logger.js → initLogger.js} +0 -0
  58. package/lib/runtime/{init-metrics.js → initMetrics.js} +11 -10
  59. package/lib/runtime/{init-middleware-manager.js → initMiddlewareManager.js} +1 -1
  60. package/lib/runtime/{init-registry.js → initRegistry.js} +1 -1
  61. package/lib/runtime/{init-service-manager.js → initServiceManager.js} +0 -0
  62. package/lib/runtime/{init-tracing.js → initTracing.js} +2 -1
  63. package/lib/runtime/{init-transport.js → initTransport.js} +1 -1
  64. package/lib/runtime/{init-uuid-factory.js → initUuidFactory.js} +0 -0
  65. package/lib/runtime/{init-validator.js → initValidator.js} +1 -1
  66. package/lib/tracing/collectors/base.js +11 -19
  67. package/lib/tracing/collectors/event.js +2 -2
  68. package/lib/tracing/collectors/index.js +2 -2
  69. package/lib/tracing/span.js +8 -6
  70. package/lib/transport/InboundTransformStream.js +75 -0
  71. package/lib/transport/adapters/{adapter-base.js → adapteBase.js} +16 -1
  72. package/lib/transport/adapters/adapters.js +1 -1
  73. package/lib/transport/adapters/dummy/index.js +3 -3
  74. package/lib/transport/adapters/index.js +1 -1
  75. package/lib/transport/adapters/tcp/discovery/index.js +45 -31
  76. package/lib/transport/adapters/tcp/index.js +20 -13
  77. package/lib/transport/adapters/tcp/tcpReader.js +1 -0
  78. package/lib/transport/adapters/tcp/tcpWriteStream.js +1 -1
  79. package/lib/transport/adapters/tcp/tcpWriter.js +2 -2
  80. package/lib/transport/createMessage.js +11 -0
  81. package/lib/transport/{transport-factory.js → createTransport.js} +234 -173
  82. package/lib/transport/errorPayloadFactory.js +18 -0
  83. package/lib/transport/{message-handlers.js → messageHandlers.js} +93 -24
  84. package/lib/transport/messageTypes.js +23 -0
  85. package/lib/types.js +66 -66
  86. package/lib/utils/index.js +0 -1
  87. package/lib/utils/options.js +4 -2
  88. package/lib/utils/{restore-error.js → restoreError.js} +1 -1
  89. package/package.json +6 -12
  90. package/CHANGELOG.md +0 -1293
  91. package/lib/cache/memory.js +0 -91
  92. package/lib/middlewares/tracing/buildTags.js +0 -17
  93. package/lib/new-errors.js +0 -25
  94. package/lib/tracing/collectors/console.js +0 -34
  95. package/lib/tracing/index.js +0 -3
  96. package/lib/tracing/tracer.js +0 -64
  97. package/lib/transport/message-types.js +0 -59
  98. package/lib/transport/message.js +0 -16
package/CHANGELOG.md DELETED
@@ -1,1293 +0,0 @@
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
- ## [0.9.2](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.9.1...@weave-js/core@0.9.2) (2021-08-18)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * Fixed @weave-js/utils references ([69f2d90](https://github.com/fachw3rk/weave/commit/69f2d9010210782e42b0f168f9ac88e3d40c3150))
12
-
13
-
14
-
15
-
16
-
17
- ## [0.9.1](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.9.0...@weave-js/core@0.9.1) (2021-08-17)
18
-
19
-
20
- ### Bug Fixes
21
-
22
- * Fixed wrong gossip message constants. ([ad7ca04](https://github.com/fachw3rk/weave/commit/ad7ca04a131a7facb10cfa5a9473f167087fd894))
23
-
24
-
25
- ### Features
26
-
27
- * **core:** The possibility to validate responses via a "responseSchema" implemented in validator middleware. ([3387fe1](https://github.com/fachw3rk/weave/commit/3387fe1e9616c4ee882b7c863b53912851fd7a1b))
28
-
29
-
30
-
31
-
32
-
33
- # [0.9.0](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.9.0-beta.13...@weave-js/core@0.9.0) (2021-08-02)
34
-
35
-
36
- ### Bug Fixes
37
-
38
- * unit test ([d76bad7](https://github.com/fachw3rk/weave/commit/d76bad7b9a723c45c9e92951dd9aa88b976ec56e))
39
- * **logger:** Fixed wrong service name in log object ([56bed33](https://github.com/fachw3rk/weave/commit/56bed335d7470d118e878428744a244934fcfd81))
40
-
41
-
42
-
43
-
44
-
45
- # [0.9.0-beta.13](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.9.0-beta.12...@weave-js/core@0.9.0-beta.13) (2021-07-26)
46
-
47
-
48
- ### Bug Fixes
49
-
50
- * Added missing event name in Event parameter validation error message ([33c8365](https://github.com/fachw3rk/weave/commit/33c83659151f0926cdc02cbeb3aaf90dca819622))
51
- * Fixed context tracking ([cda3a17](https://github.com/fachw3rk/weave/commit/cda3a171029f26fb059cf9eab8fdb95835282750))
52
- * Fixed service reference for error message ([62daab6](https://github.com/fachw3rk/weave/commit/62daab6bcfa9f8bc053aa87a103c9570a9f67742))
53
- * Fixed unit tests (new Jest version) ([6db1d40](https://github.com/fachw3rk/weave/commit/6db1d407dc0b39717d9d6cb884b0d6600144326a))
54
-
55
-
56
- ### Features
57
-
58
- * **logger:** Added destination stream property to options. ([1c7531c](https://github.com/fachw3rk/weave/commit/1c7531c282487a1951b848f04c01495e023bb035))
59
-
60
-
61
-
62
-
63
-
64
- # [0.9.0-beta.12](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.9.0-beta.11...@weave-js/core@0.9.0-beta.12) (2021-06-28)
65
-
66
-
67
- ### Bug Fixes
68
-
69
- * **core:** Fixes streaming unit test ([c39672b](https://github.com/fachw3rk/weave/commit/c39672be24e89d9af4df5c0c0cc59ea6a51fe2e6))
70
-
71
-
72
- ### Features
73
-
74
- * **weave-core:** Added support for validator strict mode. ([8412c07](https://github.com/fachw3rk/weave/commit/8412c07df90014b15663c1effdbdcf2bd1a9fb49))
75
-
76
-
77
-
78
-
79
-
80
- # [0.9.0-beta.11](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.9.0-beta.10...@weave-js/core@0.9.0-beta.11) (2021-05-31)
81
-
82
-
83
- ### Bug Fixes
84
-
85
- * Removed buggy context assignment for lifecycle hooks ([b471408](https://github.com/fachw3rk/weave/commit/b471408c481752b02da26d225119f8e18e89880d))
86
-
87
-
88
-
89
-
90
-
91
- # [0.9.0-beta.10](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.9.0-beta.9...@weave-js/core@0.9.0-beta.10) (2021-05-30)
92
-
93
-
94
- ### Bug Fixes
95
-
96
- * Fixed log action names if the actionName param refers to an endpoint. ([3100b42](https://github.com/fachw3rk/weave/commit/3100b427b126cd826b6f7fd0a25208bc4ceba255))
97
-
98
-
99
-
100
-
101
-
102
- # [0.9.0-beta.9](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.9.0-beta.8...@weave-js/core@0.9.0-beta.9) (2021-05-27)
103
-
104
-
105
- ### Bug Fixes
106
-
107
- * Fixed context tracker ([ab2869e](https://github.com/fachw3rk/weave/commit/ab2869e98f5459256faafa7955e5b817a611639e))
108
- * fixed unrefed timers ([04fe50b](https://github.com/fachw3rk/weave/commit/04fe50b2e88e863f6783b4804ce4cfb74f910e3c))
109
-
110
-
111
- ### Features
112
-
113
- * **metrics:** Added time measurement tool ([245d272](https://github.com/fachw3rk/weave/commit/245d272aa300f926df44088233ea10379008e055))
114
- * Added validator for events ([da5044e](https://github.com/fachw3rk/weave/commit/da5044ef5acbe3bd4a9984e98e0d2caa00cb0f26))
115
- * **core:** Added afterSchemasMerged service lifetime hook ([0f8a19a](https://github.com/fachw3rk/weave/commit/0f8a19ac592786b54621eb52486405efbcb6c126))
116
- * **core:** Added stoping sequence to metric adapters ([cf7b657](https://github.com/fachw3rk/weave/commit/cf7b6573f93c8d3cdaa128fbc3eaf9962d529725))
117
- * **core:** Refactoring metrics ([edf2a62](https://github.com/fachw3rk/weave/commit/edf2a62a46417a3221949519fb46c28b070f327b))
118
- * Refactoring ([b79ca4f](https://github.com/fachw3rk/weave/commit/b79ca4fe4a07bd4c1cdf433f514d89f028fd8d9d))
119
-
120
-
121
-
122
-
123
-
124
- # [0.9.0-beta.8](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.9.0-beta.7...@weave-js/core@0.9.0-beta.8) (2021-04-29)
125
-
126
- **Note:** Version bump only for package @weave-js/core
127
-
128
-
129
-
130
-
131
-
132
- # [0.9.0-beta.7](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.9.0-beta.6...@weave-js/core@0.9.0-beta.7) (2021-04-28)
133
-
134
- **Note:** Version bump only for package @weave-js/core
135
-
136
-
137
-
138
-
139
-
140
- # [0.9.0-beta.6](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.9.0-beta.5...@weave-js/core@0.9.0-beta.6) (2021-04-23)
141
-
142
- **Note:** Version bump only for package @weave-js/core
143
-
144
-
145
-
146
-
147
-
148
- # [0.9.0-beta.5](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.9.0-beta.4...@weave-js/core@0.9.0-beta.5) (2021-04-22)
149
-
150
- **Note:** Version bump only for package @weave-js/core
151
-
152
-
153
-
154
-
155
-
156
- # [0.9.0-beta.4](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.9.0-beta.3...@weave-js/core@0.9.0-beta.4) (2021-04-17)
157
-
158
- **Note:** Version bump only for package @weave-js/core
159
-
160
-
161
-
162
-
163
-
164
- # [0.9.0-beta.3](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.9.0-beta.2...@weave-js/core@0.9.0-beta.3) (2021-04-13)
165
-
166
- **Note:** Version bump only for package @weave-js/core
167
-
168
-
169
-
170
-
171
-
172
- # [0.9.0-beta.2](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.9.0-beta.1...@weave-js/core@0.9.0-beta.2) (2021-04-12)
173
-
174
- **Note:** Version bump only for package @weave-js/core
175
-
176
-
177
-
178
-
179
-
180
- # [0.9.0-beta.1](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.9.0-beta.0...@weave-js/core@0.9.0-beta.1) (2021-04-12)
181
-
182
- **Note:** Version bump only for package @weave-js/core
183
-
184
-
185
-
186
-
187
-
188
- # [0.9.0-beta.0](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.8.1...@weave-js/core@0.9.0-beta.0) (2021-04-12)
189
-
190
- **Note:** Version bump only for package @weave-js/core
191
-
192
-
193
-
194
-
195
-
196
- ## [0.8.1](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.8.0...@weave-js/core@0.8.1) (2021-01-18)
197
-
198
- **Note:** Version bump only for package @weave-js/core
199
-
200
-
201
-
202
-
203
-
204
- # [0.8.0](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.8.0-alpha.7...@weave-js/core@0.8.0) (2021-01-05)
205
-
206
-
207
- ### Features
208
-
209
- * implement a max chung size for stream chunks ([d898184](https://github.com/fachw3rk/weave/commit/d89818415c94b3ee71c37358647bb3a10c65c094))
210
-
211
-
212
-
213
-
214
-
215
- # [0.8.0-alpha.7](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.8.0-alpha.6...@weave-js/core@0.8.0-alpha.7) (2020-11-09)
216
-
217
-
218
- ### Features
219
-
220
- * Added custom UUID generator function in Options ([2aed695](https://github.com/fachw3rk/weave/commit/2aed695a0075d0a445b500393243f1fea9633e0f))
221
-
222
-
223
-
224
-
225
-
226
- # [0.8.0-alpha.6](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.8.0-alpha.5...@weave-js/core@0.8.0-alpha.6) (2020-10-01)
227
-
228
- **Note:** Version bump only for package @weave-js/core
229
-
230
-
231
-
232
-
233
-
234
- # [0.8.0-alpha.5](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.8.0-alpha.4...@weave-js/core@0.8.0-alpha.5) (2020-10-01)
235
-
236
-
237
- ### Bug Fixes
238
-
239
- * fixed unit test ([d58900c](https://github.com/fachw3rk/weave/commit/d58900c7ec74a4c5681d255caa07b02af68d66cb))
240
-
241
-
242
-
243
-
244
-
245
- # [0.8.0-alpha.4](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.8.0-alpha.3...@weave-js/core@0.8.0-alpha.4) (2020-09-07)
246
-
247
- **Note:** Version bump only for package @weave-js/core
248
-
249
-
250
-
251
-
252
-
253
- # [0.8.0-alpha.3](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.8.0-alpha.2...@weave-js/core@0.8.0-alpha.3) (2020-09-02)
254
-
255
- **Note:** Version bump only for package @weave-js/core
256
-
257
-
258
-
259
-
260
-
261
- # [0.8.0-alpha.2](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.8.0-alpha.1...@weave-js/core@0.8.0-alpha.2) (2020-09-02)
262
-
263
- **Note:** Version bump only for package @weave-js/core
264
-
265
-
266
-
267
-
268
-
269
- # [0.8.0-alpha.1](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.25...@weave-js/core@0.8.0-alpha.1) (2020-09-02)
270
-
271
- **Note:** Version bump only for package @weave-js/core
272
-
273
-
274
-
275
-
276
-
277
- # [0.7.0-rc.25](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.24...@weave-js/core@0.7.0-rc.25) (2020-07-27)
278
-
279
-
280
- ### Bug Fixes
281
-
282
- * Option merging for mixins ([c76996f](https://github.com/fachw3rk/weave/commit/c76996f4cced0fb27e8aaa29d5bedbb569ce90e5))
283
-
284
-
285
-
286
-
287
-
288
- # [0.7.0-rc.24](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.23...@weave-js/core@0.7.0-rc.24) (2020-07-27)
289
-
290
-
291
- ### Bug Fixes
292
-
293
- * Fixed merging of action hooks if the target does not exist. ([9be8f28](https://github.com/fachw3rk/weave/commit/9be8f289be3ab3e93afb0bac5cc2ec317fa1d80e))
294
-
295
-
296
-
297
-
298
-
299
- # [0.7.0-rc.23](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.22...@weave-js/core@0.7.0-rc.23) (2020-06-13)
300
-
301
-
302
- ### Bug Fixes
303
-
304
- * Added missing mixin schema merge ([6b16470](https://github.com/fachw3rk/weave/commit/6b1647038bdc0094ae995c0aea70468b075b80db))
305
-
306
-
307
- ### Features
308
-
309
- * Added support for object streams ([6b174dd](https://github.com/fachw3rk/weave/commit/6b174ddd6dd66969c79f8ce9d2fa09f9fdfd55d1))
310
-
311
-
312
-
313
-
314
-
315
- # [0.7.0-rc.22](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.21...@weave-js/core@0.7.0-rc.22) (2020-06-11)
316
-
317
-
318
- ### Bug Fixes
319
-
320
- * Config merge from file ([edfdc86](https://github.com/fachw3rk/weave/commit/edfdc86a86dc96582622d15a3c914c7f2c266e41))
321
-
322
-
323
-
324
-
325
-
326
- # [0.7.0-rc.21](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.20...@weave-js/core@0.7.0-rc.21) (2020-06-09)
327
-
328
- **Note:** Version bump only for package @weave-js/core
329
-
330
-
331
-
332
-
333
-
334
- # [0.7.0-rc.20](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.19...@weave-js/core@0.7.0-rc.20) (2020-06-09)
335
-
336
- **Note:** Version bump only for package @weave-js/core
337
-
338
-
339
-
340
-
341
-
342
- # [0.7.0-rc.19](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.18...@weave-js/core@0.7.0-rc.19) (2020-04-28)
343
-
344
- **Note:** Version bump only for package @weave-js/core
345
-
346
-
347
-
348
-
349
-
350
- # [0.7.0-rc.18](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.17...@weave-js/core@0.7.0-rc.18) (2020-04-28)
351
-
352
- **Note:** Version bump only for package @weave-js/core
353
-
354
-
355
-
356
-
357
-
358
- # [0.7.0-rc.17](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.16...@weave-js/core@0.7.0-rc.17) (2020-04-28)
359
-
360
-
361
- ### Bug Fixes
362
-
363
- * linting ([a592f35](https://github.com/fachw3rk/weave/commit/a592f35524d934b61841655bb0fc794b3bf46b99))
364
-
365
-
366
-
367
-
368
-
369
- # [0.7.0-rc.16](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.15...@weave-js/core@0.7.0-rc.16) (2020-02-25)
370
-
371
- **Note:** Version bump only for package @weave-js/core
372
-
373
-
374
-
375
-
376
-
377
- # [0.7.0-rc.15](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.14...@weave-js/core@0.7.0-rc.15) (2020-02-25)
378
-
379
-
380
- ### Features
381
-
382
- * Added sequence number to streams for upcoming changes ([4252a94](https://github.com/fachw3rk/weave/commit/4252a9437173b5f002682c6e8de640d49442f0ea))
383
-
384
-
385
-
386
-
387
-
388
- # [0.7.0-rc.14](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.13...@weave-js/core@0.7.0-rc.14) (2020-01-22)
389
-
390
-
391
- ### Bug Fixes
392
-
393
- * Another fix for meta data ([243c716](https://github.com/fachw3rk/weave/commit/243c7169b7c0d54eaffa4715a5784ebabf175cfc))
394
-
395
-
396
-
397
-
398
-
399
- # [0.7.0-rc.13](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.12...@weave-js/core@0.7.0-rc.13) (2020-01-22)
400
-
401
-
402
- ### Bug Fixes
403
-
404
- * Pass meta data through response ([558752a](https://github.com/fachw3rk/weave/commit/558752ad547285bcc31c8a0256d9a9dc4bc6d413))
405
-
406
-
407
-
408
-
409
-
410
- # [0.7.0-rc.12](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.11...@weave-js/core@0.7.0-rc.12) (2020-01-22)
411
-
412
-
413
- ### Bug Fixes
414
-
415
- * Pass meta data through response ([80fb3d7](https://github.com/fachw3rk/weave/commit/80fb3d729342dfabe60ae23ec856cbd9c959b985))
416
-
417
-
418
-
419
-
420
-
421
- # [0.7.0-rc.11](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.10...@weave-js/core@0.7.0-rc.11) (2020-01-22)
422
-
423
-
424
- ### Bug Fixes
425
-
426
- * Fatal error if a stream throws an error. ([7c6c847](https://github.com/fachw3rk/weave/commit/7c6c8470f01765c27f8fce46271df5b3e71a6c7f))
427
-
428
-
429
-
430
-
431
-
432
- # [0.7.0-rc.10](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.9...@weave-js/core@0.7.0-rc.10) (2020-01-12)
433
-
434
-
435
- ### Bug Fixes
436
-
437
- * Changed service init order. ([7b09831](https://github.com/fachw3rk/weave/commit/7b09831c8ef610351ece339dbb327a0a8b211713))
438
-
439
-
440
-
441
-
442
-
443
- # [0.7.0-rc.9](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.8...@weave-js/core@0.7.0-rc.9) (2019-12-21)
444
-
445
-
446
- ### Bug Fixes
447
-
448
- * Node list ([7169b20](https://github.com/fachw3rk/weave/commit/7169b202ae502ea0de8037ae16ffdceca02896ce))
449
- * Removed raw information from node list ([fd9bad1](https://github.com/fachw3rk/weave/commit/fd9bad1a6758560d13ac2053fcc832424737eaa2))
450
-
451
-
452
- ### Features
453
-
454
- * Added support for transport connection strings. ([c3473ba](https://github.com/fachw3rk/weave/commit/c3473baa4f40f72f6e196e6615f09a9971fc4cf5))
455
- * Connection string support added. ([fbd2654](https://github.com/fachw3rk/weave/commit/fbd26546cc333510594b29ec13547e519a968c7c))
456
- * getServiceList short hand method ([cb59016](https://github.com/fachw3rk/weave/commit/cb59016ae9e7040b5c6e077fac019a8e915958da))
457
-
458
-
459
-
460
-
461
-
462
- # [0.7.0-rc.8](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.7...@weave-js/core@0.7.0-rc.8) (2019-11-27)
463
-
464
-
465
- ### Bug Fixes
466
-
467
- * Fixed blocking waitForService method on broker stop ([1c5178e](https://github.com/fachw3rk/weave/commit/1c5178eb70fb8a86c1f8715fb06add2148defb06))
468
- * Fixed object logs ([0f05dbe](https://github.com/fachw3rk/weave/commit/0f05dbe3b19c2c6ce4223b695f3c139aece75c25))
469
- * Remove circular references from remote nodes ([14ae7a8](https://github.com/fachw3rk/weave/commit/14ae7a8499d175a2221854ffd9f47124158fb157))
470
-
471
-
472
-
473
-
474
-
475
- # [0.7.0-rc.7](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.1...@weave-js/core@0.7.0-rc.7) (2019-11-06)
476
-
477
-
478
- ### Bug Fixes
479
-
480
- * Added missing dependency ([602aafb](https://github.com/fachw3rk/weave/commit/602aafb1dcbaf55dc37d5a49e7b56edcbe20aaee))
481
-
482
-
483
-
484
-
485
-
486
- # [0.7.0-rc.2](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.1...@weave-js/core@0.7.0-rc.2) (2019-11-06)
487
-
488
-
489
- ### Bug Fixes
490
-
491
- * Added missing dependency ([602aafb](https://github.com/fachw3rk/weave/commit/602aafb1dcbaf55dc37d5a49e7b56edcbe20aaee))
492
-
493
-
494
-
495
-
496
-
497
- # [0.7.0-rc.3](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.1...@weave-js/core@0.7.0-rc.3) (2019-11-06)
498
-
499
-
500
- ### Bug Fixes
501
-
502
- * Added missing dependency ([602aafb](https://github.com/fachw3rk/weave/commit/602aafb1dcbaf55dc37d5a49e7b56edcbe20aaee))
503
-
504
-
505
-
506
-
507
-
508
- # [0.7.0-rc.2](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.1...@weave-js/core@0.7.0-rc.2) (2019-11-06)
509
-
510
-
511
- ### Bug Fixes
512
-
513
- * Added missing dependency ([602aafb](https://github.com/fachw3rk/weave/commit/602aafb1dcbaf55dc37d5a49e7b56edcbe20aaee))
514
-
515
-
516
-
517
-
518
-
519
- # [0.7.0-rc.1](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.0...@weave-js/core@0.7.0-rc.1) (2019-11-06)
520
-
521
- **Note:** Version bump only for package @weave-js/core
522
-
523
-
524
-
525
-
526
-
527
- # [0.7.0-rc.0](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-alpha.20...@weave-js/core@0.7.0-rc.0) (2019-11-06)
528
-
529
-
530
- ### Bug Fixes
531
-
532
- * Fixed direct call with node ID ([8cfc1cb](https://github.com/fachw3rk/weave/commit/8cfc1cb2ff1d16367d93c292fcd43688368f5867))
533
- * Fixed silent argument fpr weave runner ([1173e9e](https://github.com/fachw3rk/weave/commit/1173e9e55aa24a679dc552eac69d0fdbda1beb9c))
534
- * Memory leak ([c255ab2](https://github.com/fachw3rk/weave/commit/c255ab2322197b6c84009e73a5d5dbe6de7463bb))
535
- * Throw an error if service creation fails ([b9f01f0](https://github.com/fachw3rk/weave/commit/b9f01f03bddab1c2ba83154a5866f4e0096774fd))
536
-
537
-
538
-
539
-
540
-
541
- # [0.7.0-alpha.20](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-alpha.19...@weave-js/core@0.7.0-alpha.20) (2019-10-03)
542
-
543
-
544
- ### Bug Fixes
545
-
546
- * made ioredis package optional for redis cache ([004c02f](https://github.com/fachw3rk/weave/commit/004c02f))
547
-
548
-
549
-
550
-
551
-
552
- # [0.7.0-alpha.19](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.6...@weave-js/core@0.7.0-alpha.19) (2019-10-02)
553
-
554
-
555
- ### Bug Fixes
556
-
557
- * Changed order of mixin merge ([40ac322](https://github.com/fachw3rk/weave/commit/40ac322))
558
- * Improved logger performance. ([0be7543](https://github.com/fachw3rk/weave/commit/0be7543))
559
- * level of trace ([84713da](https://github.com/fachw3rk/weave/commit/84713da))
560
- * Service settings for remote services are now stored correctly ([c230f03](https://github.com/fachw3rk/weave/commit/c230f03))
561
-
562
-
563
- ### Features
564
-
565
- * Added "ping" function to broker ([e43ffed](https://github.com/fachw3rk/weave/commit/e43ffed))
566
- * Added raw messages to done hook ([ad94e2f](https://github.com/fachw3rk/weave/commit/ad94e2f))
567
-
568
-
569
-
570
-
571
-
572
- # [0.7.0-rc.6](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.5...@weave-js/core@0.7.0-rc.6) (2019-03-28)
573
-
574
-
575
- ### Bug Fixes
576
-
577
- * Method "getNextActionEndpoint" now returns an error if no service is available ([63771b8](https://github.com/fachw3rk/weave/commit/63771b8))
578
-
579
-
580
-
581
-
582
-
583
- # [0.7.0-rc.5](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.4...@weave-js/core@0.7.0-rc.5) (2019-03-22)
584
-
585
-
586
- ### Bug Fixes
587
-
588
- * Added missing jsdoc schema for weave options ([78d590f](https://github.com/fachw3rk/weave/commit/78d590f))
589
-
590
-
591
- ### Features
592
-
593
- * Maximum offline time editable ([9528c17](https://github.com/fachw3rk/weave/commit/9528c17))
594
-
595
-
596
-
597
-
598
-
599
- # [0.7.0-rc.4](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.3...@weave-js/core@0.7.0-rc.4) (2019-03-11)
600
-
601
- **Note:** Version bump only for package @weave-js/core
602
-
603
-
604
-
605
-
606
-
607
- # [0.7.0-rc.3](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.7.0-rc.2...@weave-js/core@0.7.0-rc.3) (2019-03-11)
608
-
609
- **Note:** Version bump only for package @weave-js/core
610
-
611
-
612
-
613
-
614
-
615
- # [0.7.0-rc.2](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.6.2...@weave-js/core@0.7.0-rc.2) (2019-03-11)
616
-
617
-
618
- ### Features
619
-
620
- * Added the new method "multiCall" to call multiple service actions at once ([d28b969](https://github.com/fachw3rk/weave/commit/d28b969))
621
-
622
-
623
-
624
-
625
-
626
- ## [0.6.2](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.6.1...@weave-js/core@0.6.2) (2019-03-07)
627
-
628
- **Note:** Version bump only for package @weave-js/core
629
-
630
-
631
-
632
-
633
-
634
- ## [0.6.1](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.6.0...@weave-js/core@0.6.1) (2019-02-09)
635
-
636
-
637
- ### Bug Fixes
638
-
639
- * Service loader ([8669596](https://github.com/fachw3rk/weave/commit/8669596))
640
-
641
-
642
-
643
-
644
-
645
- # [0.6.0](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.33...@weave-js/core@0.6.0) (2019-02-08)
646
-
647
-
648
- ### Features
649
-
650
- * Implemented hooks by method name ([bf56291](https://github.com/fachw3rk/weave/commit/bf56291))
651
-
652
-
653
-
654
-
655
-
656
- ## [0.5.33](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.32...@weave-js/core@0.5.33) (2019-01-15)
657
-
658
- **Note:** Version bump only for package @weave-js/core
659
-
660
-
661
-
662
-
663
-
664
- ## [0.5.32](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.31...@weave-js/core@0.5.32) (2018-12-19)
665
-
666
- **Note:** Version bump only for package @weave-js/core
667
-
668
-
669
-
670
-
671
-
672
- ## [0.5.31](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.30...@weave-js/core@0.5.31) (2018-12-18)
673
-
674
- **Note:** Version bump only for package @weave-js/core
675
-
676
-
677
-
678
-
679
-
680
- ## [0.5.30](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.29...@weave-js/core@0.5.30) (2018-12-15)
681
-
682
- **Note:** Version bump only for package @weave-js/core
683
-
684
-
685
-
686
-
687
-
688
- ## [0.5.29](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.28...@weave-js/core@0.5.29) (2018-12-15)
689
-
690
- **Note:** Version bump only for package @weave-js/core
691
-
692
-
693
-
694
-
695
-
696
- ## [0.5.28](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.27...@weave-js/core@0.5.28) (2018-12-15)
697
-
698
- **Note:** Version bump only for package @weave-js/core
699
-
700
-
701
-
702
-
703
-
704
- ## [0.5.27](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.26...@weave-js/core@0.5.27) (2018-12-13)
705
-
706
- **Note:** Version bump only for package @weave-js/core
707
-
708
-
709
-
710
-
711
-
712
- ## [0.5.26](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.25...@weave-js/core@0.5.26) (2018-12-11)
713
-
714
- **Note:** Version bump only for package @weave-js/core
715
-
716
-
717
-
718
-
719
-
720
- ## [0.5.25](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.24...@weave-js/core@0.5.25) (2018-12-11)
721
-
722
- **Note:** Version bump only for package @weave-js/core
723
-
724
-
725
-
726
-
727
-
728
- ## [0.5.24](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.23...@weave-js/core@0.5.24) (2018-12-10)
729
-
730
- **Note:** Version bump only for package @weave-js/core
731
-
732
-
733
-
734
-
735
-
736
- ## [0.5.23](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.22...@weave-js/core@0.5.23) (2018-12-08)
737
-
738
- **Note:** Version bump only for package @weave-js/core
739
-
740
-
741
-
742
-
743
-
744
- ## [0.5.22](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.21...@weave-js/core@0.5.22) (2018-11-30)
745
-
746
- **Note:** Version bump only for package @weave-js/core
747
-
748
-
749
-
750
-
751
-
752
- ## [0.5.21](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.20...@weave-js/core@0.5.21) (2018-11-28)
753
-
754
- **Note:** Version bump only for package @weave-js/core
755
-
756
-
757
-
758
-
759
-
760
- ## [0.5.20](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.19...@weave-js/core@0.5.20) (2018-11-28)
761
-
762
- **Note:** Version bump only for package @weave-js/core
763
-
764
-
765
-
766
-
767
-
768
- ## [0.5.19](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.18...@weave-js/core@0.5.19) (2018-11-26)
769
-
770
- **Note:** Version bump only for package @weave-js/core
771
-
772
-
773
-
774
-
775
-
776
- ## [0.5.18](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.17...@weave-js/core@0.5.18) (2018-11-01)
777
-
778
- **Note:** Version bump only for package @weave-js/core
779
-
780
-
781
-
782
-
783
-
784
- ## [0.5.17](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.16...@weave-js/core@0.5.17) (2018-10-29)
785
-
786
- **Note:** Version bump only for package @weave-js/core
787
-
788
-
789
-
790
-
791
-
792
- ## [0.5.16](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.15...@weave-js/core@0.5.16) (2018-10-28)
793
-
794
- **Note:** Version bump only for package @weave-js/core
795
-
796
-
797
-
798
-
799
-
800
- ## [0.5.15](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.14...@weave-js/core@0.5.15) (2018-10-28)
801
-
802
- **Note:** Version bump only for package @weave-js/core
803
-
804
-
805
-
806
-
807
-
808
- ## [0.5.14](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.13...@weave-js/core@0.5.14) (2018-10-23)
809
-
810
- **Note:** Version bump only for package @weave-js/core
811
-
812
-
813
-
814
-
815
-
816
- ## [0.5.13](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.12...@weave-js/core@0.5.13) (2018-10-23)
817
-
818
- **Note:** Version bump only for package @weave-js/core
819
-
820
-
821
-
822
-
823
-
824
- ## [0.5.12](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.11...@weave-js/core@0.5.12) (2018-10-23)
825
-
826
- **Note:** Version bump only for package @weave-js/core
827
-
828
-
829
-
830
-
831
-
832
- ## [0.5.11](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.10...@weave-js/core@0.5.11) (2018-10-21)
833
-
834
- **Note:** Version bump only for package @weave-js/core
835
-
836
-
837
-
838
-
839
-
840
- ## [0.5.10](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.9...@weave-js/core@0.5.10) (2018-10-21)
841
-
842
- **Note:** Version bump only for package @weave-js/core
843
-
844
-
845
-
846
-
847
-
848
- <a name="0.5.9"></a>
849
- ## [0.5.9](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.8...@weave-js/core@0.5.9) (2018-10-21)
850
-
851
- **Note:** Version bump only for package @weave-js/core
852
-
853
-
854
-
855
-
856
-
857
- <a name="0.5.7"></a>
858
- ## [0.5.7](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.6...@weave-js/core@0.5.7) (2018-10-02)
859
-
860
- **Note:** Version bump only for package @weave-js/core
861
-
862
-
863
-
864
-
865
-
866
- <a name="0.5.6"></a>
867
- ## [0.5.6](https://github.com/fachw3rk/weave/compare/@weave-js/core@0.5.5...@weave-js/core@0.5.6) (2018-09-18)
868
-
869
- **Note:** Version bump only for package @weave-js/core
870
-
871
-
872
-
873
-
874
-
875
- <a name="0.5.5"></a>
876
- ## 0.5.5 (2018-09-18)
877
-
878
- **Note:** Version bump only for package @weave-js/core
879
-
880
-
881
-
882
-
883
-
884
- <a name="0.5.4"></a>
885
- ## 0.5.4 (2018-09-18)
886
-
887
- **Note:** Version bump only for package @weave-js/core
888
-
889
-
890
-
891
-
892
-
893
- <a name="0.5.3"></a>
894
- ## 0.5.3 (2018-09-18)
895
-
896
- **Note:** Version bump only for package @weave-js/core
897
-
898
-
899
-
900
-
901
-
902
- <a name="0.5.2"></a>
903
- ## 0.5.2 (2018-09-18)
904
-
905
- **Note:** Version bump only for package @weave-js/core
906
-
907
-
908
-
909
-
910
-
911
- <a name="0.5.1"></a>
912
- ## 0.5.1 (2018-09-18)
913
-
914
- **Note:** Version bump only for package @weave-js/core
915
-
916
-
917
-
918
-
919
-
920
- <a name="0.5.0"></a>
921
- # 0.5.0 (2018-09-18)
922
-
923
- **Note:** Version bump only for package @weave-js/core
924
-
925
-
926
-
927
-
928
-
929
- <a name="0.5.0"></a>
930
- # 0.5.0 (2018-09-17)
931
-
932
- **Note:** Version bump only for package @weave/@weave-js/core
933
-
934
-
935
-
936
-
937
-
938
- <a name="0.5.0"></a>
939
- # [0.5.0]() (2018-09-05)
940
-
941
- # Breaking Changes
942
-
943
- Changed the interface of the module. The weave factory method is now provided as a property of the module.
944
-
945
- ```js
946
- const { Weave, Errors, TransportAdapters, Constants } = require('@weave-js/core')
947
-
948
- const broker = Weave({
949
- nodeId: 'node-1',
950
- transport: TransportAdapters.Fake()
951
- })
952
- ```
953
-
954
- # New
955
-
956
-
957
- ## Service watcher
958
-
959
- Weave now supports hot reload of services. When weave detects a change in a service file, it stops the service, removes it from internal and external registries and restarts the service with the changes without stopping the node.
960
-
961
- ```js
962
- const broker = Weave({
963
- nodeId: 'node-1',
964
- watchServices: true
965
- })
966
- ```
967
-
968
- ### weave runner example
969
-
970
- ```bash
971
- weave-runner services -W
972
- ```
973
-
974
- ## Support for streams
975
-
976
- Streaming support has been implemented. Node.js streams can be transferred as params or as response. You can use it to transfer uploaded file from a gateway or encode/decode or compress/decompress streams.
977
-
978
- ### Send file example
979
-
980
- ```js
981
- const fileStream = fs.createReadStream(fileName)
982
-
983
- broker.call('storage.save', stream, { meta: { filename }})
984
- ```
985
-
986
- ### Receive file example
987
-
988
- ```js
989
- const fileStream = fs.createWriteStream(fileName);
990
-
991
- broker.createService({
992
- name: 'storage',
993
- actions: {
994
- save (context) {
995
- const fileStream = fs.createWriteStream(`/temp/${context.meta.filename}`)
996
- context.data.pipe(fileStream)
997
- }
998
- }
999
- })
1000
- ```
1001
-
1002
- ### Recturn stream example
1003
-
1004
- ```js
1005
- const fileStream = fs.createWriteStream(fileName);
1006
-
1007
- broker.createService({
1008
- name: 'storage',
1009
- params: {
1010
- filename: { type: 'string' }
1011
- }
1012
- actions: {
1013
- save (context) {
1014
- return fs.createReadStream(context.data.filename)
1015
- }
1016
- }
1017
- })
1018
- ```
1019
-
1020
- ## New beforeCreate hook for services
1021
-
1022
- Added a new hook to intercept before service is created.
1023
-
1024
- ```js
1025
- module.exports = {
1026
- name: 'math',
1027
- actions: {
1028
- ...
1029
- },
1030
- beforeCreate () {
1031
- this.actions.newAction = {
1032
- params: {...},
1033
- handler (context) {...}
1034
- }
1035
- }
1036
- }
1037
- ```
1038
- # Changes
1039
- ## Changed Log level for heartbeat
1040
-
1041
- The broker heartbeat is now only displayed at log level "trace".
1042
-
1043
-
1044
- <a name="0.4.0"></a>
1045
- # [0.4.0]() (2018-07-27)
1046
-
1047
- # New
1048
- ## Enhanced Middlewares
1049
-
1050
- Middlewares are now on state of the art. You cann use a more detailed hook system to add features to your middlewares.
1051
-
1052
- ## New beforeCreate hook for services
1053
-
1054
- Added a new hook to intercept before service is created.
1055
-
1056
- ```js
1057
- module.exports = {
1058
- name: 'math',
1059
- actions: {
1060
- ...
1061
- },
1062
- beforeCreate () {
1063
- this.actions.newAction = {
1064
- params: {...},
1065
- handler (context) {...}
1066
- }
1067
- }
1068
- }
1069
- ```
1070
-
1071
- <a name="0.3.0"></a>
1072
- # [0.3.0]() (2018-05-11)
1073
-
1074
- # New
1075
- ## NATS transporter
1076
-
1077
- New Transporter for NATS.
1078
-
1079
- ## New beforeCreate hook for services
1080
-
1081
- Added a new hook to intercept before service is created.
1082
-
1083
- ```js
1084
- module.exports = {
1085
- name: 'math',
1086
- actions: {
1087
- ...
1088
- },
1089
- beforeCreate () {
1090
- this.actions.newAction = {
1091
- params: {...},
1092
- handler (context) {...}
1093
- }
1094
- }
1095
- }
1096
- ```
1097
-
1098
-
1099
- ## Reconnect lost nodes
1100
- If a node1 get heartbeats from a actually disconnected node2. Node1 will send a discovery request to get the current infos from node2 and reconnect it.
1101
-
1102
- # Fixed
1103
-
1104
- ## Cleanup for TCP Transporter
1105
-
1106
- Old TCP-Mesh module removed.
1107
-
1108
- --------------------------------------------------
1109
- <a name="0.2.19"></a>
1110
- # [0.2.19]() (2018-02-05)
1111
-
1112
- # New
1113
-
1114
- ## Reconnect lost nodes
1115
- If a node1 get heartbeats from a actually disconnected node2. Node1 will send a discovery request to get the current infos from node2 and reconnect it.
1116
-
1117
- # Fixed
1118
-
1119
- ## Cleanup for TCP Transporter
1120
-
1121
- Old TCP-Mesh module removed.
1122
-
1123
- --------------------------------------------------
1124
- <a name="0.2.18"></a>
1125
- # [0.2.19]() (2018-02-05)
1126
-
1127
- # New
1128
-
1129
- # Fixed
1130
-
1131
- Fixed metrics finish method.
1132
-
1133
- --------------------------------------------------
1134
-
1135
- <a name="0.2.18"></a>
1136
- # [0.2.18]() (2018-02-05)
1137
-
1138
- # New
1139
-
1140
- # Fixed
1141
-
1142
- Fixed metrics for action calls.
1143
-
1144
- --------------------------------------------------
1145
- <a name="0.2.17"></a>
1146
- # [0.2.17]() (2018-01-28)
1147
-
1148
- # New
1149
-
1150
- ## Add new service setting for private services.
1151
-
1152
- If you set the property $private to true, the service is only reachable from the local node.
1153
-
1154
- ```js
1155
- module.exports = {
1156
- name: 'math',
1157
- mixins: [TestMixin],
1158
- settings: {
1159
- $private: true
1160
- },
1161
- actions: {
1162
- add: {
1163
- params: {
1164
- a: { type: 'number' },
1165
- b: { type: 'number' }
1166
- },
1167
- handler({ params }) {
1168
- return params.a + params.b;
1169
- }
1170
- }
1171
- }
1172
- }
1173
- ```
1174
-
1175
- ## Add new internal action $node.list
1176
-
1177
- List all connected nodes.
1178
-
1179
- ```js
1180
- [Node {
1181
- id: 'testnode',
1182
- local: true,
1183
- client: {
1184
- type: 'nodejs',
1185
- version: '0.2.17',
1186
- langVersion: 'v8.7.0'
1187
- },
1188
- cpu: null,
1189
- lastHeartbeatTime: 1517162496548,
1190
- isAvailable: true,
1191
- services: null,
1192
- events: null,
1193
- IPList: ['192.168.178.21', '192.168.99.1']
1194
- } ]
1195
- ```
1196
-
1197
- ## Add new internal action $node.actions
1198
-
1199
- List all actions.
1200
-
1201
- ```js
1202
- [{
1203
- name: '$node.services',
1204
- hasAvailable: true,
1205
- hasLocal: true,
1206
- count: 1,
1207
- action: {
1208
- name: '$node.services',
1209
- version: undefined
1210
- }
1211
- },
1212
- {
1213
- name: '$node.actions',
1214
- hasAvailable: true,
1215
- hasLocal: true,
1216
- count: 1,
1217
- action: {
1218
- name: '$node.actions',
1219
- version: undefined
1220
- }
1221
- }]
1222
- ```
1223
-
1224
- # Fixed
1225
-
1226
- Internal registry errors.
1227
-
1228
- --------------------------------------------------
1229
- <a name="0.2.16"></a>
1230
- # [0.2.16]() (2018-01-22)
1231
-
1232
- # New
1233
-
1234
- ## Add new cache features
1235
- In action cache, you now have the possibility to override the TTL.
1236
-
1237
- ```js
1238
- module.exports = {
1239
- name: 'example',
1240
- actions: {
1241
- show: {
1242
- cache: {
1243
- keys: ['name', 'site'],
1244
- ttl: 5 // Set ttl to 5ms.
1245
- }
1246
- }
1247
- }
1248
- }
1249
- ```
1250
-
1251
- --------------------------------------------------
1252
-
1253
- <a name="0.2.15"></a>
1254
- # [0.2.15]() (2018-01-21)
1255
-
1256
- # New
1257
-
1258
- ## Project runner script
1259
- There is a new weave project runner script in the bin folder. You can use it if you want to create small repositories for services. In this case you needn't to create a weave instance with options. Just create a weave.config.js or weave.config.json file in the root of repository, fill it with your options and call the weave-runner within the NPM scripts. As an other solution you can put it to the environment variables instead of putting options to file.
1260
-
1261
-
1262
- Example to start all services from the `services` folder.
1263
-
1264
- ```bash
1265
- $ weave-runner services
1266
- ```
1267
-
1268
-
1269
- Example weave.config.js file with a REDIS transport, placed in the root of your project.
1270
-
1271
- ```js
1272
- const Weave = require('@weave-js/core')
1273
-
1274
- module.exports = {
1275
- level: 'debug',
1276
- cacher: true,
1277
- metrics: false,
1278
- requestTimeout: 2000,
1279
- transport: Weave.transports.Redis({
1280
- host: process.env['REDIS_HOST']
1281
- })
1282
- }
1283
-
1284
- ```
1285
-
1286
- --------------------------------------------------
1287
-
1288
- <a name="0.2.14"></a>
1289
- # [0.2.14]() (2018-01-20)
1290
-
1291
- # New
1292
-
1293
- ## Add Changelog to project