@bgord/bun 1.15.2 → 1.15.4
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/dist/cache-repository-redis.adapter.d.ts +13 -0
- package/dist/cache-repository-redis.adapter.d.ts.map +1 -0
- package/dist/cache-repository-redis.adapter.js +27 -0
- package/dist/cache-repository-redis.adapter.js.map +1 -0
- package/dist/event-loop-lag.service.d.ts +1 -1
- package/dist/event-loop-lag.service.js +2 -2
- package/dist/healthcheck-hono.handler.d.ts +3 -2
- package/dist/healthcheck-hono.handler.d.ts.map +1 -1
- package/dist/healthcheck-hono.handler.js +1 -2
- package/dist/healthcheck-hono.handler.js.map +1 -1
- package/dist/healthcheck.handler.d.ts +12 -1
- package/dist/healthcheck.handler.d.ts.map +1 -1
- package/dist/healthcheck.handler.js +20 -2
- package/dist/healthcheck.handler.js.map +1 -1
- package/dist/i18n.service.d.ts +2 -2
- package/dist/i18n.service.d.ts.map +1 -1
- package/dist/image-grayscale-noop.adapter.d.ts +6 -0
- package/dist/image-grayscale-noop.adapter.d.ts.map +1 -0
- package/dist/image-grayscale-noop.adapter.js +6 -0
- package/dist/image-grayscale-noop.adapter.js.map +1 -0
- package/dist/image-grayscale-sharp.adapter.d.ts +19 -0
- package/dist/image-grayscale-sharp.adapter.d.ts.map +1 -0
- package/dist/image-grayscale-sharp.adapter.js +28 -0
- package/dist/image-grayscale-sharp.adapter.js.map +1 -0
- package/dist/image-grayscale.port.d.ts +15 -0
- package/dist/image-grayscale.port.d.ts.map +1 -0
- package/dist/image-grayscale.port.js +2 -0
- package/dist/image-grayscale.port.js.map +1 -0
- package/dist/index.d.ts +21 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -3
- package/dist/index.js.map +1 -1
- package/dist/liveness-hono.handler.d.ts +8 -0
- package/dist/liveness-hono.handler.d.ts.map +1 -0
- package/dist/liveness-hono.handler.js +10 -0
- package/dist/liveness-hono.handler.js.map +1 -0
- package/dist/liveness.handler.d.ts +6 -0
- package/dist/liveness.handler.d.ts.map +1 -0
- package/dist/liveness.handler.js +6 -0
- package/dist/liveness.handler.js.map +1 -0
- package/dist/mailer-with-logger.adapter.d.ts +2 -3
- package/dist/mailer-with-logger.adapter.d.ts.map +1 -1
- package/dist/mailer-with-logger.adapter.js.map +1 -1
- package/dist/mailer-with-retry.adapter.d.ts +19 -0
- package/dist/mailer-with-retry.adapter.d.ts.map +1 -0
- package/dist/mailer-with-retry.adapter.js +16 -0
- package/dist/mailer-with-retry.adapter.js.map +1 -0
- package/dist/mailer-with-timeout.adapter.d.ts +19 -0
- package/dist/mailer-with-timeout.adapter.d.ts.map +1 -0
- package/dist/mailer-with-timeout.adapter.js +15 -0
- package/dist/mailer-with-timeout.adapter.js.map +1 -0
- package/dist/mailer.builder.d.ts +14 -0
- package/dist/mailer.builder.d.ts.map +1 -0
- package/dist/mailer.builder.js +28 -0
- package/dist/mailer.builder.js.map +1 -0
- package/dist/randomness-crypto.strategy.d.ts +5 -0
- package/dist/randomness-crypto.strategy.d.ts.map +1 -0
- package/dist/randomness-crypto.strategy.js +8 -0
- package/dist/randomness-crypto.strategy.js.map +1 -0
- package/dist/randomness-math.strategy.d.ts +5 -0
- package/dist/randomness-math.strategy.d.ts.map +1 -0
- package/dist/randomness-math.strategy.js +6 -0
- package/dist/randomness-math.strategy.js.map +1 -0
- package/dist/randomness-noop.strategy.d.ts +7 -0
- package/dist/randomness-noop.strategy.d.ts.map +1 -0
- package/dist/randomness-noop.strategy.js +10 -0
- package/dist/randomness-noop.strategy.js.map +1 -0
- package/dist/randomness.strategy.d.ts +4 -0
- package/dist/randomness.strategy.d.ts.map +1 -0
- package/dist/randomness.strategy.js +2 -0
- package/dist/randomness.strategy.js.map +1 -0
- package/dist/readiness-hono.handler.d.ts +26 -0
- package/dist/readiness-hono.handler.d.ts.map +1 -0
- package/dist/readiness-hono.handler.js +17 -0
- package/dist/readiness-hono.handler.js.map +1 -0
- package/dist/readiness.handler.d.ts +19 -0
- package/dist/readiness.handler.d.ts.map +1 -0
- package/dist/readiness.handler.js +19 -0
- package/dist/readiness.handler.js.map +1 -0
- package/dist/retry-backoff-jitter.strategy.d.ts +10 -0
- package/dist/retry-backoff-jitter.strategy.d.ts.map +1 -0
- package/dist/retry-backoff-jitter.strategy.js +14 -0
- package/dist/retry-backoff-jitter.strategy.js.map +1 -0
- package/dist/shield-ip-blacklist-hono.strategy.d.ts +11 -0
- package/dist/shield-ip-blacklist-hono.strategy.d.ts.map +1 -0
- package/dist/shield-ip-blacklist-hono.strategy.js +21 -0
- package/dist/shield-ip-blacklist-hono.strategy.js.map +1 -0
- package/dist/shield-ip-blacklist.strategy.d.ts +14 -0
- package/dist/shield-ip-blacklist.strategy.d.ts.map +1 -0
- package/dist/shield-ip-blacklist.strategy.js +16 -0
- package/dist/shield-ip-blacklist.strategy.js.map +1 -0
- package/dist/shield-ip-whitelist-hono.strategy.d.ts +11 -0
- package/dist/shield-ip-whitelist-hono.strategy.d.ts.map +1 -0
- package/dist/shield-ip-whitelist-hono.strategy.js +21 -0
- package/dist/shield-ip-whitelist-hono.strategy.js.map +1 -0
- package/dist/shield-ip-whitelist.strategy.d.ts +14 -0
- package/dist/shield-ip-whitelist.strategy.d.ts.map +1 -0
- package/dist/shield-ip-whitelist.strategy.js +16 -0
- package/dist/shield-ip-whitelist.strategy.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/woodchopper-dispatcher-async.strategy.d.ts.map +1 -1
- package/dist/woodchopper-dispatcher-async.strategy.js +1 -1
- package/dist/woodchopper-dispatcher-async.strategy.js.map +1 -1
- package/dist/woodchopper-dispatcher-sampling.strategy.d.ts +2 -2
- package/dist/woodchopper-dispatcher-sampling.strategy.d.ts.map +1 -1
- package/dist/woodchopper-dispatcher-sampling.strategy.js.map +1 -1
- package/dist/woodchopper-sampling-composite.strategy.d.ts +3 -3
- package/dist/woodchopper-sampling-composite.strategy.d.ts.map +1 -1
- package/dist/woodchopper-sampling-composite.strategy.js.map +1 -1
- package/dist/woodchopper-sampling-correlation-id.strategy.d.ts +2 -2
- package/dist/woodchopper-sampling-correlation-id.strategy.d.ts.map +1 -1
- package/dist/woodchopper-sampling-every-nth.strategy.d.ts +2 -2
- package/dist/woodchopper-sampling-every-nth.strategy.d.ts.map +1 -1
- package/dist/woodchopper-sampling-pass-component.strategy.d.ts +2 -2
- package/dist/woodchopper-sampling-pass-component.strategy.d.ts.map +1 -1
- package/dist/woodchopper-sampling-pass-level.strategy.d.ts +2 -2
- package/dist/woodchopper-sampling-pass-level.strategy.d.ts.map +1 -1
- package/dist/woodchopper-sampling.strategy.d.ts +1 -1
- package/dist/woodchopper-sampling.strategy.d.ts.map +1 -1
- package/package.json +9 -9
- package/readme.md +20 -3
- package/src/cache-repository-redis.adapter.ts +31 -0
- package/src/event-loop-lag.service.ts +2 -2
- package/src/healthcheck-hono.handler.ts +1 -2
- package/src/healthcheck.handler.ts +28 -3
- package/src/i18n.service.ts +2 -2
- package/src/image-grayscale-noop.adapter.ts +8 -0
- package/src/image-grayscale-sharp.adapter.ts +45 -0
- package/src/image-grayscale.port.ts +16 -0
- package/src/index.ts +21 -3
- package/src/liveness-hono.handler.ts +13 -0
- package/src/liveness.handler.ts +5 -0
- package/src/mailer-with-logger.adapter.ts +2 -2
- package/src/mailer-with-retry.adapter.ts +22 -0
- package/src/mailer-with-timeout.adapter.ts +22 -0
- package/src/mailer.builder.ts +45 -0
- package/src/randomness-crypto.strategy.ts +9 -0
- package/src/randomness-math.strategy.ts +7 -0
- package/src/randomness-noop.strategy.ts +9 -0
- package/src/randomness.strategy.ts +3 -0
- package/src/readiness-hono.handler.ts +22 -0
- package/src/readiness.handler.ts +33 -0
- package/src/retry-backoff-jitter.strategy.ts +15 -0
- package/src/shield-ip-blacklist-hono.strategy.ts +30 -0
- package/src/shield-ip-blacklist.strategy.ts +18 -0
- package/src/shield-ip-whitelist-hono.strategy.ts +30 -0
- package/src/shield-ip-whitelist.strategy.ts +18 -0
- package/src/woodchopper-dispatcher-async.strategy.ts +1 -1
- package/src/woodchopper-dispatcher-sampling.strategy.ts +2 -2
- package/src/woodchopper-sampling-composite.strategy.ts +3 -3
- package/src/woodchopper-sampling-correlation-id.strategy.ts +2 -2
- package/src/woodchopper-sampling-every-nth.strategy.ts +2 -2
- package/src/woodchopper-sampling-pass-component.strategy.ts +2 -2
- package/src/woodchopper-sampling-pass-level.strategy.ts +2 -2
- package/src/woodchopper-sampling.strategy.ts +1 -1
- package/dist/ping-hono.handler.d.ts +0 -6
- package/dist/ping-hono.handler.d.ts.map +0 -1
- package/dist/ping-hono.handler.js +0 -13
- package/dist/ping-hono.handler.js.map +0 -1
- package/dist/ping.handler.d.ts +0 -4
- package/dist/ping.handler.d.ts.map +0 -1
- package/dist/ping.handler.js +0 -6
- package/dist/ping.handler.js.map +0 -1
- package/dist/retry-backoff-fibonacci.strategy.d.ts +0 -9
- package/dist/retry-backoff-fibonacci.strategy.d.ts.map +0 -1
- package/dist/retry-backoff-fibonacci.strategy.js +0 -19
- package/dist/retry-backoff-fibonacci.strategy.js.map +0 -1
- package/src/ping-hono.handler.ts +0 -17
- package/src/ping.handler.ts +0 -5
- package/src/retry-backoff-fibonacci.strategy.ts +0 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"woodchopper-dispatcher-async.strategy.d.ts","sourceRoot":"","sources":["../src/woodchopper-dispatcher-async.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAO3E,eAAO,MAAM,+BAA+B;uCACP,KAAK,CAAC,mBAAmB;CAE7D,CAAC;AAEF,qBAAa,0BAA2B,YAAW,qBAAqB;IASpE,OAAO,CAA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CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CACvC,CAAC;YAEF,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QACrC,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QAEvB,wCAAwC;QACxC,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAEO,KAAK,CAAC,GAAG;QACf,OAAO,IAAI,CAAC,KAAK,KAAK,+BAA+B,CAAC,OAAO,EAAE,CAAC;YAC9D,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC7B,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;gBAE1B,SAAS;YACX,CAAC;YAED,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAElC,IAAI,CAAC;gBACH,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAoB,CAAC,CAAC;YACxC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,sBAAsB;gBACtB,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;gBACtB,sBAAsB;YACxB,CAAC;QACH,CAAC;IACH,CAAC;IAEO,YAAY;QAClB,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;QACd,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;IACxB,CAAC;IAEO,KAAK,CAAC,YAAY;QACxB,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YAClC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { LoggerEntry } from "./logger.port";
|
|
2
2
|
import type { WoodchopperDispatcher } from "./woodchopper-dispatcher.strategy";
|
|
3
|
-
import type {
|
|
3
|
+
import type { WoodchopperSamplingStrategy } from "./woodchopper-sampling.strategy";
|
|
4
4
|
export declare class WoodchopperDispatcherSampling implements WoodchopperDispatcher {
|
|
5
5
|
private readonly inner;
|
|
6
6
|
private readonly strategy;
|
|
7
7
|
onError?: (error: unknown) => void;
|
|
8
|
-
constructor(inner: WoodchopperDispatcher, strategy:
|
|
8
|
+
constructor(inner: WoodchopperDispatcher, strategy: WoodchopperSamplingStrategy);
|
|
9
9
|
dispatch(entry: LoggerEntry): boolean;
|
|
10
10
|
close(): void;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"woodchopper-dispatcher-sampling.strategy.d.ts","sourceRoot":"","sources":["../src/woodchopper-dispatcher-sampling.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"woodchopper-dispatcher-sampling.strategy.d.ts","sourceRoot":"","sources":["../src/woodchopper-dispatcher-sampling.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAEnF,qBAAa,6BAA8B,YAAW,qBAAqB;IAIvE,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAJ3B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;gBAGhB,KAAK,EAAE,qBAAqB,EAC5B,QAAQ,EAAE,2BAA2B;IAKxD,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO;IAIrC,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"woodchopper-dispatcher-sampling.strategy.js","sourceRoot":"","sources":["../src/woodchopper-dispatcher-sampling.strategy.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,6BAA6B;IAIrB;IACA;IAJnB,OAAO,CAA4B;IAEnC,YACmB,KAA4B,EAC5B,
|
|
1
|
+
{"version":3,"file":"woodchopper-dispatcher-sampling.strategy.js","sourceRoot":"","sources":["../src/woodchopper-dispatcher-sampling.strategy.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,6BAA6B;IAIrB;IACA;IAJnB,OAAO,CAA4B;IAEnC,YACmB,KAA4B,EAC5B,QAAqC;QADrC,UAAK,GAAL,KAAK,CAAuB;QAC5B,aAAQ,GAAR,QAAQ,CAA6B;QAEtD,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC;IAED,QAAQ,CAAC,KAAkB;QACzB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC1E,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { LoggerEntry } from "./logger.port";
|
|
2
|
-
import type {
|
|
3
|
-
export declare class WoodchopperSamplingComposite implements
|
|
2
|
+
import type { WoodchopperSamplingStrategy } from "./woodchopper-sampling.strategy";
|
|
3
|
+
export declare class WoodchopperSamplingComposite implements WoodchopperSamplingStrategy {
|
|
4
4
|
private readonly strategies;
|
|
5
|
-
constructor(strategies: ReadonlyArray<
|
|
5
|
+
constructor(strategies: ReadonlyArray<WoodchopperSamplingStrategy>);
|
|
6
6
|
decide(entry: LoggerEntry): boolean;
|
|
7
7
|
}
|
|
8
8
|
//# sourceMappingURL=woodchopper-sampling-composite.strategy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"woodchopper-sampling-composite.strategy.d.ts","sourceRoot":"","sources":["../src/woodchopper-sampling-composite.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"woodchopper-sampling-composite.strategy.d.ts","sourceRoot":"","sources":["../src/woodchopper-sampling-composite.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAEnF,qBAAa,4BAA6B,YAAW,2BAA2B;IAClE,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAV,UAAU,EAAE,aAAa,CAAC,2BAA2B,CAAC;IAEnF,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO;CAOpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"woodchopper-sampling-composite.strategy.js","sourceRoot":"","sources":["../src/woodchopper-sampling-composite.strategy.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,4BAA4B;IACV;IAA7B,YAA6B,
|
|
1
|
+
{"version":3,"file":"woodchopper-sampling-composite.strategy.js","sourceRoot":"","sources":["../src/woodchopper-sampling-composite.strategy.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,4BAA4B;IACV;IAA7B,YAA6B,UAAsD;QAAtD,eAAU,GAAV,UAAU,CAA4C;IAAG,CAAC;IAEvF,MAAM,CAAC,KAAkB;QACvB,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACvC,IAAI,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC;gBAAE,OAAO,IAAI,CAAC;QAC1C,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type * as tools from "@bgord/tools";
|
|
2
2
|
import type { LoggerEntry } from "./logger.port";
|
|
3
|
-
import type {
|
|
3
|
+
import type { WoodchopperSamplingStrategy } from "./woodchopper-sampling.strategy";
|
|
4
4
|
type Config = {
|
|
5
5
|
everyNth: tools.IntegerPositiveType;
|
|
6
6
|
};
|
|
7
|
-
export declare class WoodchoperSamplingCorrelationId implements
|
|
7
|
+
export declare class WoodchoperSamplingCorrelationId implements WoodchopperSamplingStrategy {
|
|
8
8
|
private readonly config;
|
|
9
9
|
constructor(config: Config);
|
|
10
10
|
decide(entry: LoggerEntry): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"woodchopper-sampling-correlation-id.strategy.d.ts","sourceRoot":"","sources":["../src/woodchopper-sampling-correlation-id.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"woodchopper-sampling-correlation-id.strategy.d.ts","sourceRoot":"","sources":["../src/woodchopper-sampling-correlation-id.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAEnF,KAAK,MAAM,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAC,mBAAmB,CAAA;CAAE,CAAC;AAEtD,qBAAa,+BAAgC,YAAW,2BAA2B;IACrE,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAE3C,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO;CAMpC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type * as tools from "@bgord/tools";
|
|
2
2
|
import type { LoggerEntry } from "./logger.port";
|
|
3
|
-
import type {
|
|
3
|
+
import type { WoodchopperSamplingStrategy } from "./woodchopper-sampling.strategy";
|
|
4
4
|
type Config = {
|
|
5
5
|
n: tools.IntegerPositiveType;
|
|
6
6
|
};
|
|
7
|
-
export declare class WoodchopperSamplingEveryNth implements
|
|
7
|
+
export declare class WoodchopperSamplingEveryNth implements WoodchopperSamplingStrategy {
|
|
8
8
|
private readonly config;
|
|
9
9
|
constructor(config: Config);
|
|
10
10
|
private counter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"woodchopper-sampling-every-nth.strategy.d.ts","sourceRoot":"","sources":["../src/woodchopper-sampling-every-nth.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"woodchopper-sampling-every-nth.strategy.d.ts","sourceRoot":"","sources":["../src/woodchopper-sampling-every-nth.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAEnF,KAAK,MAAM,GAAG;IAAE,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAA;CAAE,CAAC;AAE/C,qBAAa,2BAA4B,YAAW,2BAA2B;IACjE,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAE3C,OAAO,CAAC,OAAO,CAAK;IAEpB,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO;CAQrC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LoggerEntry } from "./logger.port";
|
|
2
|
-
import type {
|
|
3
|
-
export declare class WoodchopperSamplingPassComponent implements
|
|
2
|
+
import type { WoodchopperSamplingStrategy } from "./woodchopper-sampling.strategy";
|
|
3
|
+
export declare class WoodchopperSamplingPassComponent implements WoodchopperSamplingStrategy {
|
|
4
4
|
private readonly components;
|
|
5
5
|
constructor(components: ReadonlyArray<LoggerEntry["component"]>);
|
|
6
6
|
decide(entry: LoggerEntry): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"woodchopper-sampling-pass-component.strategy.d.ts","sourceRoot":"","sources":["../src/woodchopper-sampling-pass-component.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"woodchopper-sampling-pass-component.strategy.d.ts","sourceRoot":"","sources":["../src/woodchopper-sampling-pass-component.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAEnF,qBAAa,gCAAiC,YAAW,2BAA2B;IACtE,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAV,UAAU,EAAE,aAAa,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAEhF,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO;CAGpC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LoggerEntry, LogLevelEnum } from "./logger.port";
|
|
2
|
-
import type {
|
|
3
|
-
export declare class WoodchopperSamplingPassLevel implements
|
|
2
|
+
import type { WoodchopperSamplingStrategy } from "./woodchopper-sampling.strategy";
|
|
3
|
+
export declare class WoodchopperSamplingPassLevel implements WoodchopperSamplingStrategy {
|
|
4
4
|
private readonly levels;
|
|
5
5
|
constructor(levels: ReadonlyArray<LogLevelEnum>);
|
|
6
6
|
decide(entry: LoggerEntry): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"woodchopper-sampling-pass-level.strategy.d.ts","sourceRoot":"","sources":["../src/woodchopper-sampling-pass-level.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"woodchopper-sampling-pass-level.strategy.d.ts","sourceRoot":"","sources":["../src/woodchopper-sampling-pass-level.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAEnF,qBAAa,4BAA6B,YAAW,2BAA2B;IAClE,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa,CAAC,YAAY,CAAC;IAEhE,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO;CAGpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"woodchopper-sampling.strategy.d.ts","sourceRoot":"","sources":["../src/woodchopper-sampling.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"woodchopper-sampling.strategy.d.ts","sourceRoot":"","sources":["../src/woodchopper-sampling.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,WAAW,2BAA2B;IAC1C,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC;CACrC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bgord/bun",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Bartosz Gordon",
|
|
@@ -20,21 +20,21 @@
|
|
|
20
20
|
"preinstall": "bunx only-allow bun"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@biomejs/biome": "2.4.
|
|
23
|
+
"@biomejs/biome": "2.4.8",
|
|
24
24
|
"@commitlint/cli": "20.5.0",
|
|
25
25
|
"@commitlint/config-conventional": "20.5.0",
|
|
26
26
|
"@standard-schema/spec": "1.1.0",
|
|
27
27
|
"@stryker-mutator/core": "9.6.0",
|
|
28
|
-
"@types/bun": "1.3.
|
|
28
|
+
"@types/bun": "1.3.11",
|
|
29
29
|
"@types/nodemailer": "7.0.11",
|
|
30
30
|
"@types/yazl": "3.3.0",
|
|
31
31
|
"better-auth": "1.5.5",
|
|
32
32
|
"cspell": "9.7.0",
|
|
33
|
-
"csv": "6.5.
|
|
34
|
-
"knip": "
|
|
33
|
+
"csv": "6.5.1",
|
|
34
|
+
"knip": "6.0.0",
|
|
35
35
|
"lefthook": "2.1.4",
|
|
36
36
|
"lockfile-lint": "5.0.0",
|
|
37
|
-
"nodemailer": "8.0.
|
|
37
|
+
"nodemailer": "8.0.3",
|
|
38
38
|
"only-allow": "1.2.2",
|
|
39
39
|
"resend": "6.9.4",
|
|
40
40
|
"sharp": "0.34.5",
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
"yazl": "3.3.1"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@bgord/tools": "1.4.
|
|
46
|
+
"@bgord/tools": "1.4.3",
|
|
47
47
|
"emittery": "2.0.0",
|
|
48
48
|
"hono": "4.12.8",
|
|
49
49
|
"node-cache": "5.1.2"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"better-auth": "1.5.5",
|
|
53
|
-
"csv": "6.5.
|
|
54
|
-
"nodemailer": "8.0.
|
|
53
|
+
"csv": "6.5.1",
|
|
54
|
+
"nodemailer": "8.0.3",
|
|
55
55
|
"resend": "6.9.4",
|
|
56
56
|
"sharp": "0.34.5",
|
|
57
57
|
"yazl": "3.3.1"
|
package/readme.md
CHANGED
|
@@ -57,6 +57,7 @@ src/
|
|
|
57
57
|
├── cache-file.service.ts
|
|
58
58
|
├── cache-repository-node-cache.adapter.ts
|
|
59
59
|
├── cache-repository-noop.adapter.ts
|
|
60
|
+
├── cache-repository-redis.adapter.ts
|
|
60
61
|
├── cache-repository.port.ts
|
|
61
62
|
├── cache-resolver-simple.strategy.ts
|
|
62
63
|
├── cache-resolver.strategy.ts
|
|
@@ -209,6 +210,9 @@ src/
|
|
|
209
210
|
├── image-formatter-noop.adapter.ts
|
|
210
211
|
├── image-formatter-sharp.adapter.ts
|
|
211
212
|
├── image-formatter.port.ts
|
|
213
|
+
├── image-grayscale-noop.adapter.ts
|
|
214
|
+
├── image-grayscale-sharp.adapter.ts
|
|
215
|
+
├── image-grayscale.port.ts
|
|
212
216
|
├── image-info-noop.adapter.ts
|
|
213
217
|
├── image-info-sharp.adapter.ts
|
|
214
218
|
├── image-info.port.ts
|
|
@@ -237,6 +241,8 @@ src/
|
|
|
237
241
|
├── language-detector.middleware.ts
|
|
238
242
|
├── language-detector.strategy.ts
|
|
239
243
|
├── languages.vo.ts
|
|
244
|
+
├── liveness-hono.handler.ts
|
|
245
|
+
├── liveness.handler.ts
|
|
240
246
|
├── logger-collecting.adapter.ts
|
|
241
247
|
├── logger-noop.adapter.ts
|
|
242
248
|
├── logger-stats-provider-noop.adapter.ts
|
|
@@ -249,6 +255,9 @@ src/
|
|
|
249
255
|
├── mailer-subject.vo.ts
|
|
250
256
|
├── mailer-template.vo.ts
|
|
251
257
|
├── mailer-with-logger.adapter.ts
|
|
258
|
+
├── mailer-with-retry.adapter.ts
|
|
259
|
+
├── mailer-with-timeout.adapter.ts
|
|
260
|
+
├── mailer.builder.ts
|
|
252
261
|
├── mailer.port.ts
|
|
253
262
|
├── markdown-generator-noop.adapter.ts
|
|
254
263
|
├── markdown-generator.adapter.ts
|
|
@@ -316,8 +325,6 @@ src/
|
|
|
316
325
|
├── pdf-generator-noop.adapter.ts
|
|
317
326
|
├── pdf-generator-with-logger.adapter.ts
|
|
318
327
|
├── pdf-generator.port.ts
|
|
319
|
-
├── ping-hono.handler.ts
|
|
320
|
-
├── ping.handler.ts
|
|
321
328
|
├── port.vo.ts
|
|
322
329
|
├── prerequisite-runner-startup.service.ts
|
|
323
330
|
├── prerequisite-verifier-binary.adapter.ts
|
|
@@ -350,6 +357,12 @@ src/
|
|
|
350
357
|
├── prerequisite-verifier.decorator.ts
|
|
351
358
|
├── prerequisite-verifier.port.ts
|
|
352
359
|
├── prerequisite.vo.ts
|
|
360
|
+
├── randomness-crypto.strategy.ts
|
|
361
|
+
├── randomness-math.strategy.ts
|
|
362
|
+
├── randomness-noop.strategy.ts
|
|
363
|
+
├── randomness.strategy.ts
|
|
364
|
+
├── readiness-hono.handler.ts
|
|
365
|
+
├── readiness.handler.ts
|
|
353
366
|
├── recaptcha-secret-key.vo.ts
|
|
354
367
|
├── recaptcha-site-key.vo.ts
|
|
355
368
|
├── redactor-composite.strategy.ts
|
|
@@ -366,7 +379,7 @@ src/
|
|
|
366
379
|
├── request-context-hono.adapter.ts
|
|
367
380
|
├── request-context.port.ts
|
|
368
381
|
├── retry-backoff-exponential.strategy.ts
|
|
369
|
-
├── retry-backoff-
|
|
382
|
+
├── retry-backoff-jitter.strategy.ts
|
|
370
383
|
├── retry-backoff-linear.strategy.ts
|
|
371
384
|
├── retry-backoff-noop.strategy.ts
|
|
372
385
|
├── retry-backoff.strategy.ts
|
|
@@ -410,6 +423,10 @@ src/
|
|
|
410
423
|
├── shield-hcaptcha-hono-local.strategy.ts
|
|
411
424
|
├── shield-hcaptcha-hono.strategy.ts
|
|
412
425
|
├── shield-hcaptcha.strategy.ts
|
|
426
|
+
├── shield-ip-blacklist-hono.strategy.ts
|
|
427
|
+
├── shield-ip-blacklist.strategy.ts
|
|
428
|
+
├── shield-ip-whitelist-hono.strategy.ts
|
|
429
|
+
├── shield-ip-whitelist.strategy.ts
|
|
413
430
|
├── shield-maintenance-hono.strategy.ts
|
|
414
431
|
├── shield-maintenance.strategy.ts
|
|
415
432
|
├── shield-rate-limit-hono.strategy.ts
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { RedisClient } from "bun";
|
|
2
|
+
import type { CacheRepositoryPort, CacheRepositoryTtlType } from "./cache-repository.port";
|
|
3
|
+
import type { Hash } from "./hash.vo";
|
|
4
|
+
|
|
5
|
+
export class CacheRepositoryRedisAdapter implements CacheRepositoryPort {
|
|
6
|
+
constructor(
|
|
7
|
+
private readonly client: RedisClient,
|
|
8
|
+
private readonly config: CacheRepositoryTtlType,
|
|
9
|
+
) {}
|
|
10
|
+
|
|
11
|
+
async get<T>(subject: Hash): Promise<T | null> {
|
|
12
|
+
const value = await this.client.get(subject.get());
|
|
13
|
+
if (value === null) return null;
|
|
14
|
+
return JSON.parse(value) as T;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async set<T>(subject: Hash, value: T): Promise<void> {
|
|
18
|
+
await this.client.set(subject.get(), JSON.stringify(value));
|
|
19
|
+
if (this.config.type === "finite") {
|
|
20
|
+
await this.client.expire(subject.get(), this.config.ttl.seconds);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async delete(subject: Hash): Promise<void> {
|
|
25
|
+
await this.client.del(subject.get());
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async flush(): Promise<void> {
|
|
29
|
+
await this.client.send("FLUSHALL", []);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -3,7 +3,7 @@ import * as tools from "@bgord/tools";
|
|
|
3
3
|
|
|
4
4
|
export type EventLoopLagSnapshotType = { p50: tools.Duration; p95: tools.Duration; p99: tools.Duration };
|
|
5
5
|
|
|
6
|
-
export const
|
|
6
|
+
export const EventLoopLagError = { NotStarted: "event.loop.lag.not.started" };
|
|
7
7
|
|
|
8
8
|
export class EventLoopLag {
|
|
9
9
|
private static histogram: ReturnType<typeof perf_hooks.monitorEventLoopDelay> | null = null;
|
|
@@ -16,7 +16,7 @@ export class EventLoopLag {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
static snapshot(): EventLoopLagSnapshotType {
|
|
19
|
-
if (!EventLoopLag.histogram) throw new Error(
|
|
19
|
+
if (!EventLoopLag.histogram) throw new Error(EventLoopLagError.NotStarted);
|
|
20
20
|
|
|
21
21
|
return {
|
|
22
22
|
p50: tools.Duration.Ns(EventLoopLag.histogram.percentile(50)),
|
|
@@ -23,9 +23,8 @@ export class HealthcheckHonoHandler implements HandlerHonoPort {
|
|
|
23
23
|
handle() {
|
|
24
24
|
return factory.createHandlers(async (c) => {
|
|
25
25
|
const healthcheck = await this.handler.check();
|
|
26
|
-
const code = healthcheck.ok ? 200 : 424;
|
|
27
26
|
|
|
28
|
-
return c.json(healthcheck, code);
|
|
27
|
+
return c.json(healthcheck, healthcheck.code);
|
|
29
28
|
});
|
|
30
29
|
}
|
|
31
30
|
}
|
|
@@ -19,6 +19,12 @@ import type { RedactorStrategy } from "./redactor.strategy";
|
|
|
19
19
|
import { Stopwatch } from "./stopwatch.service";
|
|
20
20
|
import { Uptime, type UptimeResultType } from "./uptime.service";
|
|
21
21
|
|
|
22
|
+
export enum HealthcheckStatusEnum {
|
|
23
|
+
healthy = "healthy",
|
|
24
|
+
degraded = "degraded",
|
|
25
|
+
unhealthy = "unhealthy",
|
|
26
|
+
}
|
|
27
|
+
|
|
22
28
|
type Dependencies = {
|
|
23
29
|
Clock: ClockPort;
|
|
24
30
|
BuildInfoRepository: BuildInfoRepositoryStrategy;
|
|
@@ -33,8 +39,15 @@ export type HealthcheckConfig = {
|
|
|
33
39
|
|
|
34
40
|
const self = new Prerequisite("self", new PrerequisiteVerifierSelfAdapter());
|
|
35
41
|
|
|
42
|
+
export const HealthcheckStatusCode = {
|
|
43
|
+
[HealthcheckStatusEnum.healthy]: 200,
|
|
44
|
+
[HealthcheckStatusEnum.degraded]: 207,
|
|
45
|
+
[HealthcheckStatusEnum.unhealthy]: 424,
|
|
46
|
+
} as const;
|
|
47
|
+
|
|
36
48
|
export type HealthcheckResult = {
|
|
37
|
-
|
|
49
|
+
status: HealthcheckStatusEnum;
|
|
50
|
+
code: (typeof HealthcheckStatusCode)[keyof typeof HealthcheckStatusCode];
|
|
38
51
|
deployment: {
|
|
39
52
|
version: string;
|
|
40
53
|
timestamp: tools.TimestampValueType;
|
|
@@ -99,7 +112,18 @@ export class HealthcheckHandler {
|
|
|
99
112
|
}),
|
|
100
113
|
);
|
|
101
114
|
|
|
102
|
-
const
|
|
115
|
+
const hasFailure = details.some(
|
|
116
|
+
(result) => result.outcome.outcome === PrerequisiteVerificationOutcome.failure,
|
|
117
|
+
);
|
|
118
|
+
const hasUndetermined = details.some(
|
|
119
|
+
(result) => result.outcome.outcome === PrerequisiteVerificationOutcome.undetermined,
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
const status = hasFailure
|
|
123
|
+
? HealthcheckStatusEnum.unhealthy
|
|
124
|
+
: hasUndetermined
|
|
125
|
+
? HealthcheckStatusEnum.degraded
|
|
126
|
+
: HealthcheckStatusEnum.healthy;
|
|
103
127
|
|
|
104
128
|
const build = await this.deps.BuildInfoRepository.extract();
|
|
105
129
|
const uptime = Uptime.get(this.deps.Clock);
|
|
@@ -107,7 +131,8 @@ export class HealthcheckHandler {
|
|
|
107
131
|
const memory = MemoryConsumption.snapshot();
|
|
108
132
|
|
|
109
133
|
return {
|
|
110
|
-
|
|
134
|
+
status,
|
|
135
|
+
code: HealthcheckStatusCode[status],
|
|
111
136
|
details,
|
|
112
137
|
deployment: {
|
|
113
138
|
version: build.version.toString(),
|
package/src/i18n.service.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
2
|
import * as v from "valibot";
|
|
3
|
-
import type { FileReaderJsonPort } from "
|
|
4
|
-
import type { LoggerPort } from "
|
|
3
|
+
import type { FileReaderJsonPort } from "./file-reader-json.port";
|
|
4
|
+
import type { LoggerPort } from "./logger.port";
|
|
5
5
|
|
|
6
6
|
export type TranslationsKeyType = string;
|
|
7
7
|
export type TranslationsValueType = string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as tools from "@bgord/tools";
|
|
2
|
+
import type { ImageGrayscalePort, ImageGrayscaleStrategy } from "./image-grayscale.port";
|
|
3
|
+
|
|
4
|
+
export class ImageGrayscaleNoopAdapter implements ImageGrayscalePort {
|
|
5
|
+
async grayscale(recipe: ImageGrayscaleStrategy): Promise<tools.FilePathRelative | tools.FilePathAbsolute> {
|
|
6
|
+
return recipe.strategy === "output_path" ? recipe.output : recipe.input;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type * as tools from "@bgord/tools";
|
|
2
|
+
import type sharp from "sharp";
|
|
3
|
+
import { DynamicImport } from "./dynamic-import.service";
|
|
4
|
+
import type { FileRenamerPort } from "./file-renamer.port";
|
|
5
|
+
import type { ImageGrayscalePort, ImageGrayscaleStrategy } from "./image-grayscale.port";
|
|
6
|
+
|
|
7
|
+
export const ImageGrayscaleSharpAdapterError = {
|
|
8
|
+
MissingDependency: "image.grayscale.sharp.adapter.error.missing.dependency",
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type Dependencies = { FileRenamer: FileRenamerPort };
|
|
12
|
+
type Sharp = typeof sharp;
|
|
13
|
+
|
|
14
|
+
export class ImageGrayscaleSharpAdapter implements ImageGrayscalePort {
|
|
15
|
+
private static readonly importer = DynamicImport.for<{ default: Sharp }>(
|
|
16
|
+
"sharp",
|
|
17
|
+
ImageGrayscaleSharpAdapterError.MissingDependency,
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
private constructor(
|
|
21
|
+
private readonly sharp: Sharp,
|
|
22
|
+
private readonly deps: Dependencies,
|
|
23
|
+
) {}
|
|
24
|
+
|
|
25
|
+
static async build(deps: Dependencies): Promise<ImageGrayscaleSharpAdapter> {
|
|
26
|
+
const library = await ImageGrayscaleSharpAdapter.importer.resolve();
|
|
27
|
+
|
|
28
|
+
return new ImageGrayscaleSharpAdapter(library.default, deps);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async grayscale(recipe: ImageGrayscaleStrategy): Promise<tools.FilePathRelative | tools.FilePathAbsolute> {
|
|
32
|
+
const final = recipe.strategy === "output_path" ? recipe.output : recipe.input;
|
|
33
|
+
|
|
34
|
+
const filename = final.getFilename();
|
|
35
|
+
const temporary = final.withFilename(filename.withSuffix("-grayscale"));
|
|
36
|
+
|
|
37
|
+
const pipeline = this.sharp(recipe.input.get());
|
|
38
|
+
using _sharp_ = { [Symbol.dispose]: () => pipeline.destroy() };
|
|
39
|
+
|
|
40
|
+
await pipeline.rotate().grayscale().toFile(temporary.get());
|
|
41
|
+
await this.deps.FileRenamer.rename(temporary, final);
|
|
42
|
+
|
|
43
|
+
return final;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as tools from "@bgord/tools";
|
|
2
|
+
|
|
3
|
+
export type ImageGrayscaleOutputPathStrategy = {
|
|
4
|
+
strategy: "output_path";
|
|
5
|
+
input: tools.FilePathRelative | tools.FilePathAbsolute;
|
|
6
|
+
output: tools.FilePathRelative | tools.FilePathAbsolute;
|
|
7
|
+
};
|
|
8
|
+
export type ImageGrayscaleInPlaceStrategy = {
|
|
9
|
+
strategy: "in_place";
|
|
10
|
+
input: tools.FilePathRelative | tools.FilePathAbsolute;
|
|
11
|
+
};
|
|
12
|
+
export type ImageGrayscaleStrategy = ImageGrayscaleInPlaceStrategy | ImageGrayscaleOutputPathStrategy;
|
|
13
|
+
|
|
14
|
+
export interface ImageGrayscalePort {
|
|
15
|
+
grayscale(recipe: ImageGrayscaleStrategy): Promise<tools.FilePathRelative | tools.FilePathAbsolute>;
|
|
16
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -32,6 +32,7 @@ export * from "./cache-file.service";
|
|
|
32
32
|
export * from "./cache-repository.port";
|
|
33
33
|
export * from "./cache-repository-node-cache.adapter";
|
|
34
34
|
export * from "./cache-repository-noop.adapter";
|
|
35
|
+
export * from "./cache-repository-redis.adapter";
|
|
35
36
|
export * from "./cache-resolver.strategy";
|
|
36
37
|
export * from "./cache-resolver-simple.strategy";
|
|
37
38
|
export * from "./cache-response.middleware";
|
|
@@ -182,6 +183,9 @@ export * from "./image-exif-clear-sharp.adapter";
|
|
|
182
183
|
export * from "./image-formatter.port";
|
|
183
184
|
export * from "./image-formatter-noop.adapter";
|
|
184
185
|
export * from "./image-formatter-sharp.adapter";
|
|
186
|
+
export * from "./image-grayscale.port";
|
|
187
|
+
export * from "./image-grayscale-noop.adapter";
|
|
188
|
+
export * from "./image-grayscale-sharp.adapter";
|
|
185
189
|
export * from "./image-info.port";
|
|
186
190
|
export * from "./image-info-noop.adapter";
|
|
187
191
|
export * from "./image-info-sharp.adapter";
|
|
@@ -208,11 +212,15 @@ export * from "./language-detector-header.strategy";
|
|
|
208
212
|
export * from "./language-detector-hono.middleware";
|
|
209
213
|
export * from "./language-detector-query.strategy";
|
|
210
214
|
export * from "./languages.vo";
|
|
215
|
+
export * from "./liveness.handler";
|
|
216
|
+
export * from "./liveness-hono.handler";
|
|
211
217
|
export * from "./logger.port";
|
|
212
218
|
export * from "./logger-collecting.adapter";
|
|
213
219
|
export * from "./logger-noop.adapter";
|
|
214
220
|
export * from "./logger-stats-provider.port";
|
|
215
221
|
export * from "./logger-stats-provider-noop.adapter";
|
|
222
|
+
export * from "./mailer.builder";
|
|
223
|
+
export * from "./mailer.builder";
|
|
216
224
|
export * from "./mailer.port";
|
|
217
225
|
export * from "./mailer-content-html.vo";
|
|
218
226
|
export * from "./mailer-noop.adapter";
|
|
@@ -221,6 +229,8 @@ export * from "./mailer-smtp.adapter";
|
|
|
221
229
|
export * from "./mailer-subject.vo";
|
|
222
230
|
export * from "./mailer-template.vo";
|
|
223
231
|
export * from "./mailer-with-logger.adapter";
|
|
232
|
+
export * from "./mailer-with-retry.adapter";
|
|
233
|
+
export * from "./mailer-with-timeout.adapter";
|
|
224
234
|
export * from "./markdown-generator.adapter";
|
|
225
235
|
export * from "./markdown-generator.port";
|
|
226
236
|
export * from "./markdown-generator-noop.adapter";
|
|
@@ -249,8 +259,6 @@ export * from "./nonce-value.vo";
|
|
|
249
259
|
export * from "./pdf-generator.port";
|
|
250
260
|
export * from "./pdf-generator-noop.adapter";
|
|
251
261
|
export * from "./pdf-generator-with-logger.adapter";
|
|
252
|
-
export * from "./ping.handler";
|
|
253
|
-
export * from "./ping-hono.handler";
|
|
254
262
|
export * from "./port.vo";
|
|
255
263
|
export * from "./prerequisite.vo";
|
|
256
264
|
export * from "./prerequisite-runner-startup.service";
|
|
@@ -278,6 +286,12 @@ export * from "./prerequisite-verifier-sqlite.adapter";
|
|
|
278
286
|
export * from "./prerequisite-verifier-ssl-certificate-expiry.adapter";
|
|
279
287
|
export * from "./prerequisite-verifier-timezone-utc.adapter";
|
|
280
288
|
export * from "./prerequisite-verifier-translations.adapter";
|
|
289
|
+
export * from "./randomness.strategy";
|
|
290
|
+
export * from "./randomness-crypto.strategy";
|
|
291
|
+
export * from "./randomness-math.strategy";
|
|
292
|
+
export * from "./randomness-noop.strategy";
|
|
293
|
+
export * from "./readiness.handler";
|
|
294
|
+
export * from "./readiness-hono.handler";
|
|
281
295
|
export * from "./recaptcha-secret-key.vo";
|
|
282
296
|
export * from "./recaptcha-site-key.vo";
|
|
283
297
|
export * from "./redactor.strategy";
|
|
@@ -296,7 +310,7 @@ export * from "./request-context-hono.adapter";
|
|
|
296
310
|
export * from "./retry.service";
|
|
297
311
|
export * from "./retry-backoff.strategy";
|
|
298
312
|
export * from "./retry-backoff-exponential.strategy";
|
|
299
|
-
export * from "./retry-backoff-
|
|
313
|
+
export * from "./retry-backoff-jitter.strategy";
|
|
300
314
|
export * from "./retry-backoff-linear.strategy";
|
|
301
315
|
export * from "./retry-backoff-noop.strategy";
|
|
302
316
|
export * from "./sealer.port";
|
|
@@ -338,6 +352,10 @@ export * from "./shield-csrf-hono.strategy";
|
|
|
338
352
|
export * from "./shield-hcaptcha.strategy";
|
|
339
353
|
export * from "./shield-hcaptcha-hono.strategy";
|
|
340
354
|
export * from "./shield-hcaptcha-hono-local.strategy";
|
|
355
|
+
export * from "./shield-ip-blacklist.strategy";
|
|
356
|
+
export * from "./shield-ip-blacklist-hono.strategy";
|
|
357
|
+
export * from "./shield-ip-whitelist.strategy";
|
|
358
|
+
export * from "./shield-ip-whitelist-hono.strategy";
|
|
341
359
|
export * from "./shield-maintenance.strategy";
|
|
342
360
|
export * from "./shield-maintenance-hono.strategy";
|
|
343
361
|
export * from "./shield-rate-limit.strategy";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createFactory } from "hono/factory";
|
|
2
|
+
import type { HandlerHonoPort } from "./handler-hono.port";
|
|
3
|
+
import { LivenessHandler } from "./liveness.handler";
|
|
4
|
+
|
|
5
|
+
const factory = createFactory();
|
|
6
|
+
|
|
7
|
+
export class LivenessHonoHandler implements HandlerHonoPort {
|
|
8
|
+
private readonly handler = new LivenessHandler();
|
|
9
|
+
|
|
10
|
+
handle() {
|
|
11
|
+
return factory.createHandlers(async (c) => c.json(this.handler.execute(), 200));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -4,12 +4,12 @@ import type { MailerPort } from "./mailer.port";
|
|
|
4
4
|
import type { MailerTemplate } from "./mailer-template.vo";
|
|
5
5
|
import { Stopwatch } from "./stopwatch.service";
|
|
6
6
|
|
|
7
|
-
type
|
|
7
|
+
export type MailerWithLoggerAdapterDependencies = { inner: MailerPort; Logger: LoggerPort; Clock: ClockPort };
|
|
8
8
|
|
|
9
9
|
export class MailerWithLoggerAdapter implements MailerPort {
|
|
10
10
|
private readonly base = { component: "infra", operation: "mailer" };
|
|
11
11
|
|
|
12
|
-
constructor(private readonly deps:
|
|
12
|
+
constructor(private readonly deps: MailerWithLoggerAdapterDependencies) {}
|
|
13
13
|
|
|
14
14
|
async send(template: MailerTemplate): Promise<void> {
|
|
15
15
|
const duration = new Stopwatch(this.deps);
|