@venizia/ignis-helpers 0.0.9-0 → 0.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 +41 -204
- package/dist/common/constants/http.d.ts +8 -1
- package/dist/common/constants/http.d.ts.map +1 -1
- package/dist/common/constants/http.js +6 -0
- package/dist/common/constants/http.js.map +1 -1
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +1 -0
- package/dist/common/index.js.map +1 -1
- package/dist/common/redact.d.ts +21 -0
- package/dist/common/redact.d.ts.map +1 -0
- package/dist/common/redact.js +77 -0
- package/dist/common/redact.js.map +1 -0
- package/dist/common/types.d.ts +2 -0
- package/dist/common/types.d.ts.map +1 -1
- package/dist/common/types.js +4 -3
- package/dist/common/types.js.map +1 -1
- package/dist/modules/cron/cron.helper.d.ts +9 -1
- package/dist/modules/cron/cron.helper.d.ts.map +1 -1
- package/dist/modules/cron/cron.helper.js +53 -12
- package/dist/modules/cron/cron.helper.js.map +1 -1
- package/dist/modules/env/app-env.d.ts +14 -1
- package/dist/modules/env/app-env.d.ts.map +1 -1
- package/dist/modules/env/app-env.js +24 -3
- package/dist/modules/env/app-env.js.map +1 -1
- package/dist/modules/env/types.d.ts +4 -1
- package/dist/modules/env/types.d.ts.map +1 -1
- package/dist/modules/error/app-error.d.ts +12 -1
- package/dist/modules/error/app-error.d.ts.map +1 -1
- package/dist/modules/error/app-error.js +23 -3
- package/dist/modules/error/app-error.js.map +1 -1
- package/dist/modules/error/index.d.ts +1 -0
- package/dist/modules/error/index.d.ts.map +1 -1
- package/dist/modules/error/index.js +1 -0
- package/dist/modules/error/index.js.map +1 -1
- package/dist/modules/error/message-code.d.ts +18 -0
- package/dist/modules/error/message-code.d.ts.map +1 -0
- package/dist/modules/error/message-code.js +44 -0
- package/dist/modules/error/message-code.js.map +1 -0
- package/dist/modules/index.d.ts +0 -1
- package/dist/modules/index.d.ts.map +1 -1
- package/dist/modules/index.js +0 -1
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/logger/default-logger.d.ts.map +1 -1
- package/dist/modules/logger/default-logger.js +4 -3
- package/dist/modules/logger/default-logger.js.map +1 -1
- package/dist/modules/logger/formatters/deep-splat.d.ts +23 -0
- package/dist/modules/logger/formatters/deep-splat.d.ts.map +1 -0
- package/dist/modules/logger/formatters/deep-splat.js +83 -0
- package/dist/modules/logger/formatters/deep-splat.js.map +1 -0
- package/dist/modules/logger/formatters/index.d.ts +2 -0
- package/dist/modules/logger/formatters/index.d.ts.map +1 -0
- package/dist/modules/{testing/common → logger/formatters}/index.js +1 -2
- package/dist/modules/logger/formatters/index.js.map +1 -0
- package/dist/modules/logger/index.d.ts +1 -0
- package/dist/modules/logger/index.d.ts.map +1 -1
- package/dist/modules/logger/index.js +1 -0
- package/dist/modules/logger/index.js.map +1 -1
- package/dist/modules/network/http-request/fetcher/axios-fetcher.d.ts +3 -3
- package/dist/modules/network/http-request/fetcher/axios-fetcher.d.ts.map +1 -1
- package/dist/modules/network/http-request/fetcher/axios-fetcher.js +7 -5
- package/dist/modules/network/http-request/fetcher/axios-fetcher.js.map +1 -1
- package/dist/modules/network/http-request/fetcher/base-fetcher.d.ts +5 -2
- package/dist/modules/network/http-request/fetcher/base-fetcher.d.ts.map +1 -1
- package/dist/modules/network/http-request/fetcher/base-fetcher.js +11 -8
- package/dist/modules/network/http-request/fetcher/base-fetcher.js.map +1 -1
- package/dist/modules/network/http-request/fetcher/index.js +3 -0
- package/dist/modules/network/http-request/fetcher/index.js.map +1 -1
- package/dist/modules/network/http-request/fetcher/node-fetcher.d.ts +4 -1
- package/dist/modules/network/http-request/fetcher/node-fetcher.d.ts.map +1 -1
- package/dist/modules/network/http-request/fetcher/node-fetcher.js +24 -13
- package/dist/modules/network/http-request/fetcher/node-fetcher.js.map +1 -1
- package/dist/modules/network/tcp-socket/base-tcp-client.helper.d.ts +6 -0
- package/dist/modules/network/tcp-socket/base-tcp-client.helper.d.ts.map +1 -1
- package/dist/modules/network/tcp-socket/base-tcp-client.helper.js +24 -19
- package/dist/modules/network/tcp-socket/base-tcp-client.helper.js.map +1 -1
- package/dist/modules/network/tcp-socket/base-tcp-server.helper.d.ts +24 -1
- package/dist/modules/network/tcp-socket/base-tcp-server.helper.d.ts.map +1 -1
- package/dist/modules/network/tcp-socket/base-tcp-server.helper.js +117 -7
- package/dist/modules/network/tcp-socket/base-tcp-server.helper.js.map +1 -1
- package/dist/modules/network/tcp-socket/network-tls-tcp-server.helper.d.ts +4 -2
- package/dist/modules/network/tcp-socket/network-tls-tcp-server.helper.d.ts.map +1 -1
- package/dist/modules/network/tcp-socket/network-tls-tcp-server.helper.js.map +1 -1
- package/dist/modules/network/udp-socket/network-udp-client.helper.d.ts +2 -1
- package/dist/modules/network/udp-socket/network-udp-client.helper.d.ts.map +1 -1
- package/dist/modules/network/udp-socket/network-udp-client.helper.js +51 -13
- package/dist/modules/network/udp-socket/network-udp-client.helper.js.map +1 -1
- package/dist/modules/pool/{helper.d.ts → abstract.d.ts} +3 -23
- package/dist/modules/pool/abstract.d.ts.map +1 -0
- package/dist/modules/pool/{helper.js → abstract.js} +21 -40
- package/dist/modules/pool/abstract.js.map +1 -0
- package/dist/modules/pool/base.d.ts +24 -0
- package/dist/modules/pool/base.d.ts.map +1 -0
- package/dist/modules/pool/base.js +35 -0
- package/dist/modules/pool/base.js.map +1 -0
- package/dist/modules/pool/index.d.ts +2 -1
- package/dist/modules/pool/index.d.ts.map +1 -1
- package/dist/modules/pool/index.js +2 -1
- package/dist/modules/pool/index.js.map +1 -1
- package/dist/modules/pool/types.d.ts +2 -2
- package/dist/modules/pool/types.d.ts.map +1 -1
- package/dist/modules/queue/bullmq/helper.d.ts +10 -1
- package/dist/modules/queue/bullmq/helper.d.ts.map +1 -1
- package/dist/modules/queue/bullmq/helper.js +71 -30
- package/dist/modules/queue/bullmq/helper.js.map +1 -1
- package/dist/modules/queue/common/hook.d.ts +24 -0
- package/dist/modules/queue/common/hook.d.ts.map +1 -0
- package/dist/modules/queue/common/hook.js +36 -0
- package/dist/modules/queue/common/hook.js.map +1 -0
- package/dist/modules/queue/common/index.d.ts +1 -0
- package/dist/modules/queue/common/index.d.ts.map +1 -1
- package/dist/modules/queue/common/index.js +1 -0
- package/dist/modules/queue/common/index.js.map +1 -1
- package/dist/modules/queue/internal/hf/helper.d.ts.map +1 -1
- package/dist/modules/queue/internal/hf/helper.js +1 -1
- package/dist/modules/queue/internal/hf/helper.js.map +1 -1
- package/dist/modules/queue/internal/sequential/helper.d.ts +10 -0
- package/dist/modules/queue/internal/sequential/helper.d.ts.map +1 -1
- package/dist/modules/queue/internal/sequential/helper.js +43 -9
- package/dist/modules/queue/internal/sequential/helper.js.map +1 -1
- package/dist/modules/queue/kafka/base.d.ts +6 -1
- package/dist/modules/queue/kafka/base.d.ts.map +1 -1
- package/dist/modules/queue/kafka/base.js +47 -11
- package/dist/modules/queue/kafka/base.js.map +1 -1
- package/dist/modules/queue/kafka/common/constants.d.ts.map +1 -1
- package/dist/modules/queue/kafka/common/constants.js +0 -18
- package/dist/modules/queue/kafka/common/constants.js.map +1 -1
- package/dist/modules/queue/kafka/common/types.d.ts.map +1 -1
- package/dist/modules/queue/kafka/consumer.d.ts.map +1 -1
- package/dist/modules/queue/kafka/consumer.js +87 -45
- package/dist/modules/queue/kafka/consumer.js.map +1 -1
- package/dist/modules/queue/kafka/producer.d.ts.map +1 -1
- package/dist/modules/queue/kafka/producer.js +3 -12
- package/dist/modules/queue/kafka/producer.js.map +1 -1
- package/dist/modules/queue/kafka/schema/registry.d.ts +1 -1
- package/dist/modules/queue/kafka/schema/registry.d.ts.map +1 -1
- package/dist/modules/queue/kafka/schema/registry.js +2 -2
- package/dist/modules/queue/kafka/schema/registry.js.map +1 -1
- package/dist/modules/queue/mqtt/helper.d.ts +14 -1
- package/dist/modules/queue/mqtt/helper.d.ts.map +1 -1
- package/dist/modules/queue/mqtt/helper.js +62 -12
- package/dist/modules/queue/mqtt/helper.js.map +1 -1
- package/dist/modules/redis/base/abstract.helper.d.ts.map +1 -1
- package/dist/modules/redis/base/abstract.helper.js +21 -12
- package/dist/modules/redis/base/abstract.helper.js.map +1 -1
- package/dist/modules/redis/index.d.ts +3 -2
- package/dist/modules/redis/index.d.ts.map +1 -1
- package/dist/modules/redis/index.js +3 -2
- package/dist/modules/redis/index.js.map +1 -1
- package/dist/modules/redis/utility.d.ts +20 -0
- package/dist/modules/redis/utility.d.ts.map +1 -0
- package/dist/modules/redis/utility.js +66 -0
- package/dist/modules/redis/utility.js.map +1 -0
- package/dist/modules/socket/socket-io/client/helper.d.ts +2 -1
- package/dist/modules/socket/socket-io/client/helper.d.ts.map +1 -1
- package/dist/modules/socket/socket-io/client/helper.js +22 -4
- package/dist/modules/socket/socket-io/client/helper.js.map +1 -1
- package/dist/modules/socket/socket-io/common/types.d.ts +1 -1
- package/dist/modules/socket/socket-io/common/types.d.ts.map +1 -1
- package/dist/modules/socket/socket-io/server/helper.d.ts +10 -2
- package/dist/modules/socket/socket-io/server/helper.d.ts.map +1 -1
- package/dist/modules/socket/socket-io/server/helper.js +78 -43
- package/dist/modules/socket/socket-io/server/helper.js.map +1 -1
- package/dist/modules/socket/websocket/common/types.d.ts +1 -1
- package/dist/modules/socket/websocket/common/types.d.ts.map +1 -1
- package/dist/modules/socket/websocket/emitter/helper.d.ts +0 -1
- package/dist/modules/socket/websocket/emitter/helper.d.ts.map +1 -1
- package/dist/modules/socket/websocket/emitter/helper.js +7 -25
- package/dist/modules/socket/websocket/emitter/helper.js.map +1 -1
- package/dist/modules/socket/websocket/server/helper.d.ts +11 -2
- package/dist/modules/socket/websocket/server/helper.d.ts.map +1 -1
- package/dist/modules/socket/websocket/server/helper.js +77 -67
- package/dist/modules/socket/websocket/server/helper.js.map +1 -1
- package/dist/modules/storage/base.d.ts +34 -12
- package/dist/modules/storage/base.d.ts.map +1 -1
- package/dist/modules/storage/base.js +91 -2
- package/dist/modules/storage/base.js.map +1 -1
- package/dist/modules/storage/bun-s3/helper.d.ts +6 -12
- package/dist/modules/storage/bun-s3/helper.d.ts.map +1 -1
- package/dist/modules/storage/bun-s3/helper.js +17 -56
- package/dist/modules/storage/bun-s3/helper.js.map +1 -1
- package/dist/modules/storage/disk/helper.d.ts +6 -12
- package/dist/modules/storage/disk/helper.d.ts.map +1 -1
- package/dist/modules/storage/disk/helper.js +11 -53
- package/dist/modules/storage/disk/helper.js.map +1 -1
- package/dist/modules/storage/minio/helper.d.ts +6 -12
- package/dist/modules/storage/minio/helper.d.ts.map +1 -1
- package/dist/modules/storage/minio/helper.js +12 -53
- package/dist/modules/storage/minio/helper.js.map +1 -1
- package/dist/modules/storage/types.d.ts +2 -0
- package/dist/modules/storage/types.d.ts.map +1 -1
- package/dist/modules/uid/helper.d.ts.map +1 -1
- package/dist/modules/uid/helper.js +10 -2
- package/dist/modules/uid/helper.js.map +1 -1
- package/dist/modules/worker-thread/base.d.ts +9 -0
- package/dist/modules/worker-thread/base.d.ts.map +1 -1
- package/dist/modules/worker-thread/base.js +46 -10
- package/dist/modules/worker-thread/base.js.map +1 -1
- package/dist/modules/worker-thread/worker-bus.d.ts +9 -0
- package/dist/modules/worker-thread/worker-bus.d.ts.map +1 -1
- package/dist/modules/worker-thread/worker-bus.js +39 -18
- package/dist/modules/worker-thread/worker-bus.js.map +1 -1
- package/dist/modules/worker-thread/worker-pool.d.ts +1 -1
- package/dist/modules/worker-thread/worker-pool.d.ts.map +1 -1
- package/dist/modules/worker-thread/worker-pool.js +14 -6
- package/dist/modules/worker-thread/worker-pool.js.map +1 -1
- package/dist/utilities/index.d.ts +1 -0
- package/dist/utilities/index.d.ts.map +1 -1
- package/dist/utilities/index.js +1 -0
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/parse.utility.d.ts +5 -12
- package/dist/utilities/parse.utility.d.ts.map +1 -1
- package/dist/utilities/parse.utility.js +49 -110
- package/dist/utilities/parse.utility.js.map +1 -1
- package/dist/utilities/promise.utility.d.ts +18 -5
- package/dist/utilities/promise.utility.d.ts.map +1 -1
- package/dist/utilities/promise.utility.js +39 -17
- package/dist/utilities/promise.utility.js.map +1 -1
- package/dist/utilities/retry.utility.d.ts +97 -0
- package/dist/utilities/retry.utility.d.ts.map +1 -0
- package/dist/utilities/retry.utility.js +245 -0
- package/dist/utilities/retry.utility.js.map +1 -0
- package/package.json +10 -10
- package/dist/modules/pool/helper.d.ts.map +0 -1
- package/dist/modules/pool/helper.js.map +0 -1
- package/dist/modules/testing/base-test-plan.d.ts +0 -29
- package/dist/modules/testing/base-test-plan.d.ts.map +0 -1
- package/dist/modules/testing/base-test-plan.js +0 -73
- package/dist/modules/testing/base-test-plan.js.map +0 -1
- package/dist/modules/testing/common/constants.d.ts +0 -7
- package/dist/modules/testing/common/constants.d.ts.map +0 -1
- package/dist/modules/testing/common/constants.js +0 -10
- package/dist/modules/testing/common/constants.js.map +0 -1
- package/dist/modules/testing/common/index.d.ts +0 -3
- package/dist/modules/testing/common/index.d.ts.map +0 -1
- package/dist/modules/testing/common/index.js.map +0 -1
- package/dist/modules/testing/common/types.d.ts +0 -54
- package/dist/modules/testing/common/types.d.ts.map +0 -1
- package/dist/modules/testing/common/types.js +0 -3
- package/dist/modules/testing/common/types.js.map +0 -1
- package/dist/modules/testing/describe.d.ts +0 -16
- package/dist/modules/testing/describe.d.ts.map +0 -1
- package/dist/modules/testing/describe.js +0 -49
- package/dist/modules/testing/describe.js.map +0 -1
- package/dist/modules/testing/index.d.ts +0 -7
- package/dist/modules/testing/index.d.ts.map +0 -1
- package/dist/modules/testing/index.js +0 -23
- package/dist/modules/testing/index.js.map +0 -1
- package/dist/modules/testing/test-case.d.ts +0 -21
- package/dist/modules/testing/test-case.d.ts.map +0 -1
- package/dist/modules/testing/test-case.js +0 -42
- package/dist/modules/testing/test-case.js.map +0 -1
- package/dist/modules/testing/test-handler.d.ts +0 -27
- package/dist/modules/testing/test-handler.d.ts.map +0 -1
- package/dist/modules/testing/test-handler.js +0 -52
- package/dist/modules/testing/test-handler.js.map +0 -1
- package/dist/modules/testing/test-plan.d.ts +0 -6
- package/dist/modules/testing/test-plan.d.ts.map +0 -1
- package/dist/modules/testing/test-plan.js +0 -11
- package/dist/modules/testing/test-plan.js.map +0 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.deepSplat = exports.formatLogMessage = void 0;
|
|
7
|
+
const node_util_1 = __importDefault(require("node:util"));
|
|
8
|
+
const winston_1 = __importDefault(require("winston"));
|
|
9
|
+
/** Winston stashes the extra arguments of `logger.error(msg, ...args)` under this well-known key. */
|
|
10
|
+
const SPLAT = Symbol.for('splat');
|
|
11
|
+
/** The placeholders `util.format` understands. `%%` is an escape, not a placeholder. */
|
|
12
|
+
const PLACEHOLDER_PATTERN = /%[sjdifoOc%]/g;
|
|
13
|
+
/**
|
|
14
|
+
* How deep an object is inspected before it collapses to `[Object]`.
|
|
15
|
+
*
|
|
16
|
+
* Node's default of 2 hides the part you opened the log for (`extra`, a wrapped `cause`, a driver's
|
|
17
|
+
* payload); unbounded depth would let one object graph flood a line. 5 reaches the values that carry
|
|
18
|
+
* the diagnosis and stays bounded.
|
|
19
|
+
*
|
|
20
|
+
* `APP_ENV_LOGGER_INSPECT_DEPTH` overrides it with a NON-NEGATIVE number. There is no unlimited
|
|
21
|
+
* setting: depth is always a finite number.
|
|
22
|
+
*/
|
|
23
|
+
const DEFAULT_INSPECT_DEPTH = 5;
|
|
24
|
+
const resolveDepth = () => {
|
|
25
|
+
const configured = process.env.APP_ENV_LOGGER_INSPECT_DEPTH;
|
|
26
|
+
// Not `int()`: it answers 0 for an ABSENT value, which would silently mean "depth 0" - the one
|
|
27
|
+
// setting that hides everything.
|
|
28
|
+
if (configured === undefined || configured.trim() === '') {
|
|
29
|
+
return DEFAULT_INSPECT_DEPTH;
|
|
30
|
+
}
|
|
31
|
+
const parsed = Number.parseInt(configured, 10);
|
|
32
|
+
// A negative or unparseable value is a misconfiguration, not a request: fall back rather than hand
|
|
33
|
+
// `util.inspect` a depth it reads as "unlimited".
|
|
34
|
+
if (Number.isNaN(parsed) || parsed < 0) {
|
|
35
|
+
return DEFAULT_INSPECT_DEPTH;
|
|
36
|
+
}
|
|
37
|
+
return parsed;
|
|
38
|
+
};
|
|
39
|
+
const buildInspectOptions = () => {
|
|
40
|
+
return {
|
|
41
|
+
depth: resolveDepth(),
|
|
42
|
+
maxArrayLength: null,
|
|
43
|
+
maxStringLength: null,
|
|
44
|
+
breakLength: Infinity,
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Formats a log message the way `util.format` does - except that an object passed to `%s` is
|
|
49
|
+
* inspected {@link DEFAULT_INSPECT_DEPTH} levels deep instead of Node's hard-coded 0.
|
|
50
|
+
*
|
|
51
|
+
* Node forces `depth: 0` on `%s` (see `formatWithOptionsInternal`), which no inspect option can
|
|
52
|
+
* override: `logger.error('Error: %s', error)` therefore prints `extra: [Object]` and drops the
|
|
53
|
+
* nested `cause` of every wrapped driver error. Pre-inspecting the object into a string first is the
|
|
54
|
+
* only way to widen it, and it must be done per-placeholder: doing it to ALL arguments would turn
|
|
55
|
+
* `%j` into a JSON-quoted string instead of an object.
|
|
56
|
+
*/
|
|
57
|
+
const formatLogMessage = (opts) => {
|
|
58
|
+
const { message, args, inspectOptions = buildInspectOptions() } = opts;
|
|
59
|
+
const placeholders = (message.match(PLACEHOLDER_PATTERN) ?? []).filter(token => token !== '%%');
|
|
60
|
+
const widened = args.map((arg, index) => {
|
|
61
|
+
const isStringPlaceholder = placeholders[index] === '%s';
|
|
62
|
+
const isInspectable = typeof arg === 'object' && arg !== null;
|
|
63
|
+
if (!isStringPlaceholder || !isInspectable) {
|
|
64
|
+
return arg;
|
|
65
|
+
}
|
|
66
|
+
return node_util_1.default.inspect(arg, inspectOptions);
|
|
67
|
+
});
|
|
68
|
+
return node_util_1.default.formatWithOptions(inspectOptions, message, ...widened);
|
|
69
|
+
};
|
|
70
|
+
exports.formatLogMessage = formatLogMessage;
|
|
71
|
+
/**
|
|
72
|
+
* Drop-in replacement for `winston.format.splat()` that formats through {@link formatLogMessage}.
|
|
73
|
+
* Every transport reads `info.message`, so widening it here widens console, file and dgram at once.
|
|
74
|
+
*/
|
|
75
|
+
exports.deepSplat = winston_1.default.format(info => {
|
|
76
|
+
const args = info[SPLAT];
|
|
77
|
+
if (!args?.length || typeof info.message !== 'string') {
|
|
78
|
+
return info;
|
|
79
|
+
}
|
|
80
|
+
info.message = (0, exports.formatLogMessage)({ message: info.message, args });
|
|
81
|
+
return info;
|
|
82
|
+
});
|
|
83
|
+
//# sourceMappingURL=deep-splat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deep-splat.js","sourceRoot":"","sources":["../../../../src/modules/logger/formatters/deep-splat.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAC7B,sDAA8B;AAG9B,qGAAqG;AACrG,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAElC,wFAAwF;AACxF,MAAM,mBAAmB,GAAG,eAAe,CAAC;AAE5C;;;;;;;;;GASG;AACH,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEhC,MAAM,YAAY,GAAG,GAAW,EAAE;IAChC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC;IAE5D,+FAA+F;IAC/F,iCAAiC;IACjC,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACzD,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAE/C,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BAAgB,oBAqB3B;AAEF;;;GAGG;AACU,QAAA,SAAS,GAAG,iBAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;IAC7C,MAAM,IAAI,GAAI,IAAgB,CAAC,KAAK,CAA+B,CAAC;IAEpE,IAAI,CAAC,IAAI,EAAE,MAAM,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;QACtD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,OAAO,GAAG,IAAA,wBAAgB,EAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IACjE,OAAO,IAAI,CAAC;AACd,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/logger/formatters/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -14,6 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./types"), exports);
|
|
17
|
+
__exportStar(require("./deep-splat"), exports);
|
|
19
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/logger/formatters/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/logger/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/logger/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./application-logger"), exports);
|
|
18
18
|
__exportStar(require("./default-logger"), exports);
|
|
19
19
|
__exportStar(require("./factory"), exports);
|
|
20
|
+
__exportStar(require("./formatters"), exports);
|
|
20
21
|
__exportStar(require("./hf-logger"), exports);
|
|
21
22
|
__exportStar(require("./transports"), exports);
|
|
22
23
|
__exportStar(require("./types"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/logger/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,mDAAiC;AACjC,4CAA0B;AAC1B,8CAA4B;AAC5B,+CAA6B;AAC7B,0CAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/logger/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,mDAAiC;AACjC,4CAA0B;AAC1B,+CAA6B;AAC7B,8CAA4B;AAC5B,+CAA6B;AAC7B,0CAAwB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AnyObject } from '../../../../common';
|
|
1
|
+
import { AnyObject, THttpMethod } from '../../../../common';
|
|
2
2
|
import axios, { AxiosRequestConfig } from 'axios';
|
|
3
|
-
import { AbstractNetworkFetchableHelper, IRequestOptions } from './base-fetcher';
|
|
4
3
|
import { BaseNetworkRequest } from '../base-network-request.helper';
|
|
4
|
+
import { AbstractNetworkFetchableHelper, IRequestOptions } from './base-fetcher';
|
|
5
5
|
export interface IAxiosRequestOptions extends AxiosRequestConfig, IRequestOptions {
|
|
6
6
|
url: string;
|
|
7
|
-
method?:
|
|
7
|
+
method?: THttpMethod;
|
|
8
8
|
params?: AnyObject;
|
|
9
9
|
body?: AnyObject;
|
|
10
10
|
headers?: AnyObject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axios-fetcher.d.ts","sourceRoot":"","sources":["../../../../../src/modules/network/http-request/fetcher/axios-fetcher.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"axios-fetcher.d.ts","sourceRoot":"","sources":["../../../../../src/modules/network/http-request/fetcher/axios-fetcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAQ,WAAW,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,KAAK,EAAE,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAGlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,8BAA8B,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjF,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB,EAAE,eAAe;IAC/E,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,qBAAa,YAAa,SAAQ,8BAA8B,CAC9D,OAAO,EACP,oBAAoB,EACpB,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,CACtC;gBACa,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,kBAAkB,CAAC;QAAC,MAAM,CAAC,EAAE,GAAG,CAAA;KAAE;IAQ3E,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,CAAC,EAAE,GAAG;CAsBhE;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,GAAG;QACpD,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,qBAAa,mBAAoB,SAAQ,kBAAkB,CAAC,OAAO,CAAC;gBACtD,IAAI,EAAE,2BAA2B;CAwB9C"}
|
|
@@ -4,11 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.AxiosNetworkRequest = exports.AxiosFetcher = void 0;
|
|
7
|
+
const redact_1 = require("../../../../common/redact");
|
|
8
|
+
const common_1 = require("../../../../common");
|
|
7
9
|
const axios_1 = __importDefault(require("axios"));
|
|
8
10
|
const node_https_1 = __importDefault(require("node:https"));
|
|
9
11
|
const node_querystring_1 = require("node:querystring");
|
|
10
|
-
const base_fetcher_1 = require("./base-fetcher");
|
|
11
12
|
const base_network_request_helper_1 = require("../base-network-request.helper");
|
|
13
|
+
const base_fetcher_1 = require("./base-fetcher");
|
|
12
14
|
class AxiosFetcher extends base_fetcher_1.AbstractNetworkFetchableHelper {
|
|
13
15
|
constructor(opts) {
|
|
14
16
|
super({ name: opts.name, variant: 'axios' });
|
|
@@ -17,10 +19,10 @@ class AxiosFetcher extends base_fetcher_1.AbstractNetworkFetchableHelper {
|
|
|
17
19
|
this.worker = axios_1.default.create({ ...defaultConfigs });
|
|
18
20
|
}
|
|
19
21
|
send(opts, logger) {
|
|
20
|
-
const { url, method =
|
|
22
|
+
const { url, method = common_1.HTTP.Methods.GET, params = {}, body: data, headers, ...rest } = opts;
|
|
21
23
|
const props = {
|
|
22
24
|
url,
|
|
23
|
-
method,
|
|
25
|
+
method: method.toUpperCase(),
|
|
24
26
|
params,
|
|
25
27
|
data,
|
|
26
28
|
headers,
|
|
@@ -28,12 +30,12 @@ class AxiosFetcher extends base_fetcher_1.AbstractNetworkFetchableHelper {
|
|
|
28
30
|
...rest,
|
|
29
31
|
};
|
|
30
32
|
const protocol = this.getProtocol(url);
|
|
31
|
-
if (protocol ===
|
|
33
|
+
if (protocol === common_1.HTTP.Protocols.HTTPS) {
|
|
32
34
|
props.httpsAgent = new node_https_1.default.Agent({
|
|
33
35
|
rejectUnauthorized: opts.rejectUnauthorized ?? false,
|
|
34
36
|
});
|
|
35
37
|
}
|
|
36
|
-
logger?.for(this.send.name).info('URL: %s | Props: %
|
|
38
|
+
logger?.for(this.send.name).info('URL: %s | Props: %s', url, (0, redact_1.redactSecrets)(props));
|
|
37
39
|
return this.worker.request(props);
|
|
38
40
|
}
|
|
39
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axios-fetcher.js","sourceRoot":"","sources":["../../../../../src/modules/network/http-request/fetcher/axios-fetcher.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"axios-fetcher.js","sourceRoot":"","sources":["../../../../../src/modules/network/http-request/fetcher/axios-fetcher.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAgD;AAChD,qCAAwD;AACxD,kDAAkD;AAClD,4DAA+B;AAC/B,uDAA6C;AAC7C,gFAAoE;AACpE,iDAAiF;AAUjF,MAAa,YAAa,SAAQ,6CAIjC;IACC,YAAY,IAAwE;QAClF,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QAC7C,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;QAChC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,wDAAwD,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAExF,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AO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,cAAc,CAAC;QAE9D,MAAM,aAAa,GAAc;YAC/B,CAAC,cAAc,CAAC,EAAE,iCAAiC;YACnD,GAAG,OAAO;SACX,CAAC;QAEF,MAAM,cAAc,GAAuB;YACzC,eAAe,EAAE,IAAI;YACrB,cAAc,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,GAAG,GAAG;YAChD,OAAO,EAAE,OAAO,IAAI,EAAE,GAAG,IAAI;YAC7B,GAAG,IAAI;YACP,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,aAAa;SACvB,CAAC;QAEF,KAAK,CAAC;YACJ,IAAI;YACJ,OAAO;YACP,OAAO,EAAE,IAAI,YAAY,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;SACpD,CAAC,CAAC;IACL,CAAC;CACF;AAzBD,kDAyBC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { AnyObject, THttpMethod } from '../../../../common';
|
|
1
2
|
import { TFetcherResponse, TFetcherVariant, TFetcherWorker } from '../types';
|
|
2
3
|
export interface IRequestOptions {
|
|
3
4
|
url: string;
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
method?: THttpMethod;
|
|
6
|
+
params?: AnyObject;
|
|
6
7
|
timeout?: number;
|
|
7
8
|
[extra: symbol | string]: any;
|
|
8
9
|
}
|
|
@@ -13,6 +14,7 @@ export interface IFetchable<V extends TFetcherVariant, RQ extends IRequestOption
|
|
|
13
14
|
put(opts: RQ, logger?: any): Promise<RS>;
|
|
14
15
|
patch(opts: RQ, logger?: any): Promise<RS>;
|
|
15
16
|
delete(opts: RQ, logger?: any): Promise<RS>;
|
|
17
|
+
query(opts: RQ, logger?: any): Promise<RS>;
|
|
16
18
|
getWorker(): TFetcherWorker<V>;
|
|
17
19
|
}
|
|
18
20
|
export declare abstract class AbstractNetworkFetchableHelper<V extends TFetcherVariant, RQ extends IRequestOptions, RS extends TFetcherResponse<V>> implements IFetchable<V, RQ, RS> {
|
|
@@ -31,5 +33,6 @@ export declare abstract class AbstractNetworkFetchableHelper<V extends TFetcherV
|
|
|
31
33
|
put(opts: RQ, logger?: any): Promise<RS>;
|
|
32
34
|
patch(opts: RQ, logger?: any): Promise<RS>;
|
|
33
35
|
delete(opts: RQ, logger?: any): Promise<RS>;
|
|
36
|
+
query(opts: RQ, logger?: any): Promise<RS>;
|
|
34
37
|
}
|
|
35
38
|
//# sourceMappingURL=base-fetcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-fetcher.d.ts","sourceRoot":"","sources":["../../../../../src/modules/network/http-request/fetcher/base-fetcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"base-fetcher.d.ts","sourceRoot":"","sources":["../../../../../src/modules/network/http-request/fetcher/base-fetcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAQ,WAAW,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE7E,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;CAC/B;AAED,MAAM,WAAW,UAAU,CACzB,CAAC,SAAS,eAAe,EACzB,EAAE,SAAS,eAAe,EAC1B,EAAE,SAAS,gBAAgB,CAAC,CAAC,CAAC;IAE9B,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC;IAC1C,GAAG,CAAC,IA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AAC,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,GAAG;IAK1B,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,GAAG;IAK3B,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,GAAG;IAK1B,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,GAAG;IAK5B,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,GAAG;IAK7B,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,GAAG;CAI7B"}
|
|
@@ -1,38 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AbstractNetworkFetchableHelper = void 0;
|
|
4
|
-
const
|
|
5
|
-
const HTTPS = 'https';
|
|
4
|
+
const common_1 = require("../../../../common");
|
|
6
5
|
class AbstractNetworkFetchableHelper {
|
|
7
6
|
constructor(opts) {
|
|
8
7
|
this.name = opts.name;
|
|
9
8
|
this.variant = opts.variant;
|
|
10
9
|
}
|
|
11
10
|
getProtocol(url) {
|
|
12
|
-
return url.startsWith('http:') ? HTTP : HTTPS;
|
|
11
|
+
return url.startsWith('http:') ? common_1.HTTP.Protocols.HTTP : common_1.HTTP.Protocols.HTTPS;
|
|
13
12
|
}
|
|
14
13
|
getWorker() {
|
|
15
14
|
return this.worker;
|
|
16
15
|
}
|
|
17
16
|
get(opts, logger) {
|
|
18
17
|
const { ...rest } = opts;
|
|
19
|
-
return this.send({ ...rest, method:
|
|
18
|
+
return this.send({ ...rest, method: common_1.HTTP.Methods.GET }, logger);
|
|
20
19
|
}
|
|
21
20
|
post(opts, logger) {
|
|
22
21
|
const { ...rest } = opts;
|
|
23
|
-
return this.send({ ...rest, method:
|
|
22
|
+
return this.send({ ...rest, method: common_1.HTTP.Methods.POST }, logger);
|
|
24
23
|
}
|
|
25
24
|
put(opts, logger) {
|
|
26
25
|
const { ...rest } = opts;
|
|
27
|
-
return this.send({ ...rest, method:
|
|
26
|
+
return this.send({ ...rest, method: common_1.HTTP.Methods.PUT }, logger);
|
|
28
27
|
}
|
|
29
28
|
patch(opts, logger) {
|
|
30
29
|
const { ...rest } = opts;
|
|
31
|
-
return this.send({ ...rest, method:
|
|
30
|
+
return this.send({ ...rest, method: common_1.HTTP.Methods.PATCH }, logger);
|
|
32
31
|
}
|
|
33
32
|
delete(opts, logger) {
|
|
34
33
|
const { ...rest } = opts;
|
|
35
|
-
return this.send({ ...rest, method:
|
|
34
|
+
return this.send({ ...rest, method: common_1.HTTP.Methods.DELETE }, logger);
|
|
35
|
+
}
|
|
36
|
+
query(opts, logger) {
|
|
37
|
+
const { ...rest } = opts;
|
|
38
|
+
return this.send({ ...rest, method: common_1.HTTP.Methods.QUERY }, logger);
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
exports.AbstractNetworkFetchableHelper = AbstractNetworkFetchableHelper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-fetcher.js","sourceRoot":"","sources":["../../../../../src/modules/network/http-request/fetcher/base-fetcher.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"base-fetcher.js","sourceRoot":"","sources":["../../../../../src/modules/network/http-request/fetcher/base-fetcher.ts"],"names":[],"mappings":";;;AAAA,qCAAwD;AA2BxD,MAAsB,8BAA8B;IASlD,YAAY,IAAkC;QAC5C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAC9B,CAAC;IAID,WAAW,CAAC,GAAW;QACrB,OAAO,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,aAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,aAAI,CAAC,SAAS,CAAC,KAAK,CAAC;IAC9E,CAAC;I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IAED,KAAK,CAAC,IAAQ,EAAE,MAAY;QAC1B,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;QACzB,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,aAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,MAAM,CAAC,CAAC;IACpE,CAAC;CACF;AArDD,wEAqDC"}
|
|
@@ -16,4 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./base-fetcher"), exports);
|
|
18
18
|
__exportStar(require("./node-fetcher"), exports);
|
|
19
|
+
// axios-fetcher is NOT re-exported here on purpose: it value-imports `axios`, an OPTIONAL peer, so
|
|
20
|
+
// a barrel export would make `import '@venizia/ignis-helpers'` fail for every app that does not
|
|
21
|
+
// install axios. Reach it through the sub-path: `@venizia/ignis-helpers/axios`.
|
|
19
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/network/http-request/fetcher/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,iDAA+B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/network/http-request/fetcher/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,iDAA+B;AAE/B,mGAAmG;AACnG,gGAAgG;AAChG,gFAAgF"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { THttpMethod } from '../../../../common/constants/http';
|
|
2
|
+
import { AnyObject } from '../../../../common/types';
|
|
1
3
|
import { BaseNetworkRequest } from '../base-network-request.helper';
|
|
2
4
|
import { AbstractNetworkFetchableHelper, IRequestOptions } from './base-fetcher';
|
|
3
5
|
export interface INodeFetchRequestOptions extends RequestInit, IRequestOptions {
|
|
4
6
|
url: string;
|
|
5
|
-
|
|
7
|
+
method?: THttpMethod;
|
|
8
|
+
params?: AnyObject;
|
|
6
9
|
}
|
|
7
10
|
export declare class NodeFetcher extends AbstractNetworkFetchableHelper<'node-fetch', INodeFetchRequestOptions, Awaited<ReturnType<typeof fetch>>> {
|
|
8
11
|
private defaultConfigs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-fetcher.d.ts","sourceRoot":"","sources":["../../../../../src/modules/network/http-request/fetcher/node-fetcher.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"node-fetcher.d.ts","sourceRoot":"","sources":["../../../../../src/modules/network/http-request/fetcher/node-fetcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,8BAA8B,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjF,MAAM,WAAW,wBAAyB,SAAQ,WAAW,EAAE,eAAe;IAC5E,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,qBAAa,WAAY,SAAQ,8BAA8B,CAC7D,YAAY,EACZ,wBAAwB,EACxB,OAAO,CAAC,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC,CAClC;IACC,OAAO,CAAC,cAAc,CAAc;gBAExB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,WAAW,CAAC;QAAC,MAAM,CAAC,EAAE,GAAG,CAAA;KAAE;IAS9D,IAAI,CAAC,IAAI,EAAE,wBAAwB,EAAE,MAAM,CAAC,EAAE,GAAG;CA2DjE;AAED,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,WAAW,GAAG;QAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,qBAAa,uBAAwB,SAAQ,kBAAkB,CAAC,YAAY,CAAC;gBAC/D,IAAI,EAAE,+BAA+B;CAsBlD"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NodeFetchNetworkRequest = exports.NodeFetcher = void 0;
|
|
4
|
+
const redact_1 = require("../../../../common/redact");
|
|
5
|
+
const http_1 = require("../../../../common/constants/http");
|
|
4
6
|
const node_querystring_1 = require("node:querystring");
|
|
5
7
|
const base_network_request_helper_1 = require("../base-network-request.helper");
|
|
6
8
|
const base_fetcher_1 = require("./base-fetcher");
|
|
@@ -13,33 +15,42 @@ class NodeFetcher extends base_fetcher_1.AbstractNetworkFetchableHelper {
|
|
|
13
15
|
this.defaultConfigs = defaultConfigs;
|
|
14
16
|
}
|
|
15
17
|
async send(opts, logger) {
|
|
16
|
-
const { url, method =
|
|
18
|
+
const { url, method = http_1.HTTP.Methods.GET, params, body, headers, timeout, signal, ...rest } = opts;
|
|
17
19
|
let timeoutId;
|
|
18
|
-
let
|
|
20
|
+
let timeoutController;
|
|
21
|
+
let effectiveSignal = signal;
|
|
19
22
|
if (timeout) {
|
|
20
|
-
|
|
23
|
+
timeoutController = new AbortController();
|
|
21
24
|
timeoutId = setTimeout(() => {
|
|
22
|
-
|
|
25
|
+
timeoutController?.abort();
|
|
23
26
|
}, timeout);
|
|
27
|
+
// Composed, never substituted: a timeout must not silently swallow the caller's own signal,
|
|
28
|
+
// or the caller would believe it cancelled a request that is in fact still running. Either
|
|
29
|
+
// source - and a signal already aborted before the call - aborts the request.
|
|
30
|
+
effectiveSignal = signal
|
|
31
|
+
? AbortSignal.any([signal, timeoutController.signal])
|
|
32
|
+
: timeoutController.signal;
|
|
24
33
|
}
|
|
25
34
|
const requestConfigs = {
|
|
26
35
|
...this.defaultConfigs,
|
|
27
36
|
...rest,
|
|
28
|
-
method,
|
|
37
|
+
method: method.toUpperCase(),
|
|
29
38
|
body,
|
|
30
39
|
headers,
|
|
31
|
-
signal:
|
|
40
|
+
signal: effectiveSignal,
|
|
32
41
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
42
|
+
// `?` only when the url carries no query string of its own - a second `?` is not a separator,
|
|
43
|
+
// so the server would read the previous parameter's value as `1?extra=2`.
|
|
44
|
+
const serializedParams = params ? (0, node_querystring_1.stringify)(params) : '';
|
|
45
|
+
const requestUrl = serializedParams
|
|
46
|
+
? `${url}${url.includes('?') ? '&' : '?'}${serializedParams}`
|
|
47
|
+
: url;
|
|
38
48
|
logger
|
|
39
49
|
?.for(this.send.name)
|
|
40
|
-
.info('URL: %s | Props: %
|
|
50
|
+
.info('URL: %s | Props: %s | Timeout: %s', url, (0, redact_1.redactSecrets)(requestConfigs), timeout);
|
|
41
51
|
try {
|
|
42
|
-
|
|
52
|
+
const rs = await fetch(requestUrl, requestConfigs);
|
|
53
|
+
return rs;
|
|
43
54
|
}
|
|
44
55
|
finally {
|
|
45
56
|
if (timeoutId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-fetcher.js","sourceRoot":"","sources":["../../../../../src/modules/network/http-request/fetcher/node-fetcher.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"node-fetcher.js","sourceRoot":"","sources":["../../../../../src/modules/network/http-request/fetcher/node-fetcher.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,kDAA4D;AAE5D,uDAA6C;AAC7C,gFAAoE;AACpE,iDAAiF;AAQjF,MAAa,WAAY,SAAQ,6CAIhC;IAGC,YAAY,IAAiE;QAC3E,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;QACl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ACJ,OAAO;YACP,OAAO,EAAE,IAAI,WAAW,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;SACnD,CAAC,CAAC;IACL,CAAC;CACF;AAvBD,0DAuBC"}
|
|
@@ -46,6 +46,12 @@ export declare class BaseNetworkTcpClient<SocketClientOptions extends PlainConne
|
|
|
46
46
|
protected onError?: (error: any) => void;
|
|
47
47
|
constructor(opts: INetworkTcpClientProps<SocketClientOptions, SocketClientType>);
|
|
48
48
|
getClient(): SocketClientType | null | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* The options as they may appear in a log line. A TLS client's options ARE its private key
|
|
51
|
+
* (`key`/`cert`/`passphrase`), so logging them verbatim writes the key into every log file and
|
|
52
|
+
* aggregator downstream.
|
|
53
|
+
*/
|
|
54
|
+
protected getLoggableOptions(): unknown;
|
|
49
55
|
handleConnected(): void;
|
|
50
56
|
handleData(_opts: {
|
|
51
57
|
identifier: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-tcp-client.helper.d.ts","sourceRoot":"","sources":["../../../../src/modules/network/tcp-socket/base-tcp-client.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-tcp-client.helper.d.ts","sourceRoot":"","sources":["../../../../src/modules/network/tcp-socket/base-tcp-client.helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,EACL,oBAAoB,IAAI,sBAAsB,EAC9C,MAAM,IAAI,iBAAiB,EAC5B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,iBAAiB,IAAI,oBAAoB,EAAE,SAAS,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AAInG,MAAM,WAAW,sBAAsB,CACrC,mBAAmB,SAAS,sBAAsB,GAAG,oBAAoB,EACzE,gBAAgB,SAAS,iBAAiB,GAAG,eAAe;IAE5D,UAAU,EA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;IAEpC,SAAS,CAAC,cAAc,EAAE,CACxB,OAAO,EAAE,mBAAmB,EAC5B,kBAAkB,CAAC,EAAE,MAAM,IAAI,KAC5B,gBAAgB,CAAC;IAEtB,SAAS,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,gBAAgB,CAAA;KAAE,KAAK,IAAI,CAAC;IACpE,SAAS,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACnF,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,gBAAgB,CAAA;KAAE,KAAK,IAAI,CAAC;IAClE,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;gBAE7B,IAAI,EAAE,sBAAsB,CAAC,mBAAmB,EAAE,gBAAgB,CAAC;IAsB/E,SAAS;IAIT;;;;OAIG;IACH,SAAS,CAAC,kBAAkB,IAAI,OAAO;IAIvC,eAAe;IAWf,UAAU,CAAC,KAAK,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;IAElE,YAAY;IAUZ,WAAW,CAAC,KAAK,EAAE,GAAG;IA2CtB,OAAO,CAAC,IAAI,EAAE;QAAE,qBAAqB,EAAE,OAAO,CAAA;KAAE;IAyDhD,UAAU;IAkBV,cAAc;IAKd,WAAW;IAIX,IAAI,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;CAkBxC"}
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.BaseNetworkTcpClient = void 0;
|
|
7
|
+
const redact_1 = require("../../../common/redact");
|
|
7
8
|
const base_1 = require("../../../modules/base");
|
|
8
9
|
const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
|
|
9
10
|
const DEFAULT_MAX_RETRY = 5;
|
|
@@ -33,22 +34,30 @@ class BaseNetworkTcpClient extends base_1.BaseHelper {
|
|
|
33
34
|
getClient() {
|
|
34
35
|
return this.client;
|
|
35
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* The options as they may appear in a log line. A TLS client's options ARE its private key
|
|
39
|
+
* (`key`/`cert`/`passphrase`), so logging them verbatim writes the key into every log file and
|
|
40
|
+
* aggregator downstream.
|
|
41
|
+
*/
|
|
42
|
+
getLoggableOptions() {
|
|
43
|
+
return (0, redact_1.redactSecrets)(this.options);
|
|
44
|
+
}
|
|
36
45
|
handleConnected() {
|
|
37
46
|
this.logger
|
|
38
47
|
.for(this.handleConnected.name)
|
|
39
|
-
.info('[%s] Connected to TCP Server | Options: %j', this.identifier, this.
|
|
48
|
+
.info('[%s] Connected to TCP Server | Options: %j', this.identifier, this.getLoggableOptions());
|
|
40
49
|
this.retry.currentReconnect = 0;
|
|
41
50
|
}
|
|
42
51
|
handleData(_opts) { }
|
|
43
52
|
handleClosed() {
|
|
44
53
|
this.logger
|
|
45
54
|
.for(this.handleClosed.name)
|
|
46
|
-
.info('[%s] Closed connection TCP Server | Options: %j', this.identifier, this.
|
|
55
|
+
.info('[%s] Closed connection TCP Server | Options: %j', this.identifier, this.getLoggableOptions());
|
|
47
56
|
}
|
|
48
57
|
handleError(error) {
|
|
49
58
|
this.logger
|
|
50
59
|
.for(this.handleError.name)
|
|
51
|
-
.error('[%s] Connection error | Options: %j | Error: %s', this.identifier, this.
|
|
60
|
+
.error('[%s] Connection error | Options: %j | Error: %s', this.identifier, this.getLoggableOptions(), error);
|
|
52
61
|
if (!this.reconnect || this.retry.currentReconnect >= this.retry.maxReconnect) {
|
|
53
62
|
return;
|
|
54
63
|
}
|
|
@@ -64,7 +73,7 @@ class BaseNetworkTcpClient extends base_1.BaseHelper {
|
|
|
64
73
|
this.client = null;
|
|
65
74
|
this.logger
|
|
66
75
|
.for(this.handleClosed.name)
|
|
67
|
-
.info('[%s] Retrying to establish TCP Connection | Options: %j', this.identifier, this.
|
|
76
|
+
.info('[%s] Retrying to establish TCP Connection | Options: %j', this.identifier, this.getLoggableOptions());
|
|
68
77
|
this.connect({ resetReconnectCounter: false });
|
|
69
78
|
this.retry.currentReconnect++;
|
|
70
79
|
}, 5000);
|
|
@@ -84,7 +93,7 @@ class BaseNetworkTcpClient extends base_1.BaseHelper {
|
|
|
84
93
|
}
|
|
85
94
|
this.logger
|
|
86
95
|
.for(this.connect.name)
|
|
87
|
-
.info('[%s] New network tcp client | Options: %
|
|
96
|
+
.info('[%s] New network tcp client | Options: %j', this.identifier, this.getLoggableOptions());
|
|
88
97
|
if (opts?.resetReconnectCounter) {
|
|
89
98
|
this.retry.currentReconnect = 0;
|
|
90
99
|
}
|
|
@@ -92,26 +101,22 @@ class BaseNetworkTcpClient extends base_1.BaseHelper {
|
|
|
92
101
|
this.client?.destroy();
|
|
93
102
|
this.client = null;
|
|
94
103
|
}
|
|
95
|
-
this.client
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
this.onConnected?.({ client: this.client });
|
|
104
|
+
// The listeners close over THIS socket: `this.client` is nulled by disconnect() and swapped by a
|
|
105
|
+
// reconnect, so reading it back would drop the close hook - or hand it the wrong socket.
|
|
106
|
+
const client = this.createClientFn(this.options, () => {
|
|
107
|
+
this.onConnected?.({ client });
|
|
101
108
|
});
|
|
109
|
+
this.client = client;
|
|
102
110
|
if (this.encoding) {
|
|
103
|
-
|
|
111
|
+
client.setEncoding(this.encoding);
|
|
104
112
|
}
|
|
105
|
-
|
|
113
|
+
client.on('data', (message) => {
|
|
106
114
|
this.onData({ identifier: this.identifier, message });
|
|
107
115
|
});
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
this.onClosed?.({ client: this.client });
|
|
116
|
+
client.on('close', () => {
|
|
117
|
+
this.onClosed?.({ client });
|
|
113
118
|
});
|
|
114
|
-
|
|
119
|
+
client.on('error', error => {
|
|
115
120
|
this.onError?.(error);
|
|
116
121
|
});
|
|
117
122
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-tcp-client.helper.js","sourceRoot":"","sources":["../../../../src/modules/network/tcp-socket/base-tcp-client.helper.ts"],"names":[],"mappings":";;;;;;AAAA,yCAA4C;AAE5C,6DAAqC;AAOrC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAyB5B,MAAa,oBAGX,SAAQ,iBAAU;IAsBlB,YAAY,IAAmE;QAC7E,KAAK,CAAC;YACJ,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,UAAU,IAAI,oBAAoB,CAAC,IAAI;YACjE,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC,CAAC;QArBK,UAAK,GAAuD;YACpE,YAAY,EAAE,iBAAiB;YAC/B,gBAAgB,EAAE,CAAC;SACpB,CAAC;QAmBA,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE5B,IAAI,CAAC,KAAK,GAAG;YACX,YAAY,EAAE,IAAI,CAAC,QAAQ,IAAI,iBAAiB;YAChD,gBAAgB,EAAE,CAAC;SACpB,CAAC;QAEF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QAE1C,IAAI,CAAC,WAAW,GAAG,IAAI,EAAE,WAAW,IAAI,IAAI,CAAC,eAAe,CAAC;QAC7D,IAAI,CAAC,MAAM,GAAG,IAAI,EAAE,MAAM,IAAI,IAAI,CAAC,UAAU,CAAC;QAC9C,IAAI,CAAC,QAAQ,GAAG,IAAI,EAAE,QAAQ,IAAI,IAAI,CAAC,YAAY,CAAC;QACpD,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,OAAO,IAAI,IAAI,CAAC,WA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