@weave-js/core 0.11.1 → 0.13.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/.eslintrc.js +1 -1
- package/jest.config.js +1 -1
- package/lib/ExtendableError.js +8 -8
- package/lib/broker/context.js +49 -49
- package/lib/broker/defaultOptions.js +8 -9
- package/lib/broker/index.js +160 -164
- package/lib/buildRuntime.js +34 -34
- package/lib/cache/adapters/base.js +50 -74
- package/lib/cache/adapters/inMemory.js +58 -58
- package/lib/cache/adapters/inMemoryLru.js +57 -57
- package/lib/cache/adapters/index.js +3 -39
- package/lib/cache/getCacheKeyByObject.js +31 -0
- package/lib/cache/getPropertyFromDataOrMetadata.js +20 -0
- package/lib/cache/lock.js +30 -24
- package/lib/constants.js +5 -5
- package/lib/errorHandler.js +8 -8
- package/lib/errors.js +64 -54
- package/lib/helper/defineAction.js +2 -2
- package/lib/helper/defineBrokerOptions.js +2 -2
- package/lib/helper/defineService.js +2 -2
- package/lib/index.js +21 -21
- package/lib/logger/base.js +38 -29
- package/lib/logger/format/asHumanReadable.js +15 -15
- package/lib/logger/format/asJson.js +10 -10
- package/lib/logger/format/index.js +3 -3
- package/lib/logger/index.js +24 -24
- package/lib/logger/levels.js +21 -21
- package/lib/logger/tools.js +15 -15
- package/lib/logger/utils/colorize.js +23 -23
- package/lib/logger/utils/format.js +75 -65
- package/lib/metrics/common.js +47 -47
- package/lib/metrics/constants.js +44 -44
- package/lib/metrics/exporter/base.js +8 -8
- package/lib/metrics/exporter/event.js +20 -20
- package/lib/metrics/exporter/index.js +15 -15
- package/lib/metrics/index.js +2 -2
- package/lib/metrics/types/base.js +20 -20
- package/lib/metrics/types/counter.js +6 -6
- package/lib/metrics/types/gauge.js +24 -24
- package/lib/metrics/types/histogram.js +26 -26
- package/lib/metrics/types/index.js +6 -6
- package/lib/metrics/types/info.js +17 -17
- package/lib/middlewares/action-hooks/index.js +38 -38
- package/lib/middlewares/bulkhead/index.js +34 -34
- package/lib/middlewares/cache/index.js +37 -37
- package/lib/middlewares/circuit-breaker/index.js +62 -62
- package/lib/middlewares/context-tracker/index.js +39 -39
- package/lib/middlewares/error-handler/index.js +47 -15
- package/lib/middlewares/index.js +2 -2
- package/lib/middlewares/metrics/getMiddlewareWrapper.js +17 -17
- package/lib/middlewares/metrics/index.js +29 -29
- package/lib/middlewares/retry/index.js +15 -15
- package/lib/middlewares/timeout/index.js +16 -16
- package/lib/middlewares/tracing/index.js +37 -37
- package/lib/middlewares/tracing/tags.js +6 -6
- package/lib/middlewares/validator/index.js +31 -31
- package/lib/registry/actionEndpoint.js +8 -8
- package/lib/registry/collections/actionCollection.js +39 -35
- package/lib/registry/collections/endpointCollection.js +63 -63
- package/lib/registry/collections/eventCollection.js +62 -62
- package/lib/registry/collections/nodeCollection.js +45 -45
- package/lib/registry/collections/serviceCollection.js +61 -55
- package/lib/registry/eventEndpoint.js +14 -14
- package/lib/registry/load-balancer/base.js +3 -3
- package/lib/registry/load-balancer/index.js +7 -7
- package/lib/registry/node.js +27 -27
- package/lib/registry/registry.js +139 -136
- package/lib/registry/service/parseAction.js +16 -16
- package/lib/registry/service/parseEvent.js +18 -18
- package/lib/registry/service/reduceMixins.js +10 -10
- package/lib/registry/service/service.js +72 -72
- package/lib/registry/serviceItem.js +21 -21
- package/lib/runtime/initActionInvoker.js +21 -21
- package/lib/runtime/initCache.js +7 -7
- package/lib/runtime/initContextFactory.js +22 -22
- package/lib/runtime/initEventbus.js +49 -49
- package/lib/runtime/initLogger.js +11 -11
- package/lib/runtime/initMetrics.js +54 -54
- package/lib/runtime/initMiddlewareManager.js +21 -21
- package/lib/runtime/initRegistry.js +6 -6
- package/lib/runtime/initServiceManager.js +90 -68
- package/lib/runtime/initTracing.js +23 -23
- package/lib/runtime/initTransport.js +5 -5
- package/lib/runtime/initUuidFactory.js +4 -4
- package/lib/runtime/initValidator.js +5 -5
- package/lib/tracing/collectors/base.js +22 -22
- package/lib/tracing/collectors/event.js +33 -33
- package/lib/tracing/collectors/index.js +15 -15
- package/lib/tracing/span.js +26 -26
- package/lib/tracing/time.js +8 -8
- package/lib/transport/InboundTransformStream.js +26 -26
- package/lib/transport/adapters/adapteBase.js +30 -30
- package/lib/transport/adapters/adapters.js +4 -4
- package/lib/transport/adapters/dummy/index.js +18 -18
- package/lib/transport/adapters/fromURI.js +13 -13
- package/lib/transport/adapters/getAdapterByName.js +5 -5
- package/lib/transport/adapters/index.js +12 -12
- package/lib/transport/adapters/tcp/discovery/codec.js +4 -4
- package/lib/transport/adapters/tcp/discovery/index.js +62 -62
- package/lib/transport/adapters/tcp/index.js +169 -171
- package/lib/transport/adapters/tcp/tcp-messagetypes.js +7 -7
- package/lib/transport/adapters/tcp/tcpReader.js +39 -39
- package/lib/transport/adapters/tcp/tcpWriteStream.js +26 -26
- package/lib/transport/adapters/tcp/tcpWriter.js +57 -57
- package/lib/transport/adapters/tcp/utils.js +12 -12
- package/lib/transport/createMessage.js +4 -4
- package/lib/transport/createTransport.js +254 -254
- package/lib/transport/errorPayloadFactory.js +13 -17
- package/lib/transport/messageHandlers.js +199 -206
- package/lib/transport/messageTypes.js +19 -19
- package/lib/types.js +28 -15
- package/lib/utils/index.js +1 -1
- package/lib/utils/options.js +44 -44
- package/lib/utils/restoreError.js +58 -6
- package/package.json +4 -4
- package/lib/cache/base.js +0 -136
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
stack: error.stack,
|
|
14
|
-
data: error.data
|
|
15
|
-
}
|
|
16
|
-
}
|
|
1
|
+
const errorPayloadFactory =
|
|
2
|
+
(runtime) =>
|
|
3
|
+
(error) => {
|
|
4
|
+
return {
|
|
5
|
+
name: error.name,
|
|
6
|
+
message: error.message,
|
|
7
|
+
nodeId: error.nodeId || runtime.nodeId,
|
|
8
|
+
code: error.code,
|
|
9
|
+
stack: error.stack,
|
|
10
|
+
data: error.data
|
|
11
|
+
};
|
|
12
|
+
};
|
|
17
13
|
|
|
18
|
-
module.exports = { errorPayloadFactory }
|
|
14
|
+
module.exports = { errorPayloadFactory };
|