@bgord/bun 1.16.5 → 1.17.1
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/alert-channel-with-logger.adapter.d.ts.map +1 -1
- package/dist/alert-channel-with-logger.adapter.js +9 -1
- package/dist/alert-channel-with-logger.adapter.js.map +1 -1
- package/dist/antivirus-with-logger.adapter.d.ts.map +1 -1
- package/dist/antivirus-with-logger.adapter.js +4 -0
- package/dist/antivirus-with-logger.adapter.js.map +1 -1
- package/dist/cache-file.service.js +2 -2
- package/dist/cache-file.service.js.map +1 -1
- package/dist/certificate-inspector-tls.adapter.js +2 -1
- package/dist/certificate-inspector-tls.adapter.js.map +1 -1
- package/dist/clock-system.adapter.js +1 -1
- package/dist/clock-system.adapter.js.map +1 -1
- package/dist/cron-task-handler-with-logger.strategy.js +2 -2
- package/dist/cron-task-handler-with-logger.strategy.js.map +1 -1
- package/dist/handler-with-logger.strategy.d.ts.map +1 -1
- package/dist/handler-with-logger.strategy.js +2 -0
- package/dist/handler-with-logger.strategy.js.map +1 -1
- package/dist/healthcheck-hono.handler.d.ts +1 -1
- package/dist/healthcheck.handler.js +1 -1
- package/dist/healthcheck.handler.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/job-queue-noop.adapter.d.ts +21 -0
- package/dist/job-queue-noop.adapter.d.ts.map +1 -0
- package/dist/job-queue-noop.adapter.js +22 -0
- package/dist/job-queue-noop.adapter.js.map +1 -0
- package/dist/mailer-with-logger.adapter.d.ts.map +1 -1
- package/dist/mailer-with-logger.adapter.js +15 -2
- package/dist/mailer-with-logger.adapter.js.map +1 -1
- package/dist/pdf-generator-with-logger.adapter.d.ts.map +1 -1
- package/dist/pdf-generator-with-logger.adapter.js +9 -1
- package/dist/pdf-generator-with-logger.adapter.js.map +1 -1
- package/dist/remote-file-storage-with-logger.adapter.d.ts.map +1 -1
- package/dist/remote-file-storage-with-logger.adapter.js +18 -1
- package/dist/remote-file-storage-with-logger.adapter.js.map +1 -1
- package/dist/semaphore.service.js.map +1 -1
- package/dist/sms-with-logger.adapter.d.ts.map +1 -1
- package/dist/sms-with-logger.adapter.js +9 -1
- package/dist/sms-with-logger.adapter.js.map +1 -1
- package/dist/timekeeper-google.adapter.d.ts.map +1 -1
- package/dist/timekeeper-google.adapter.js +2 -1
- package/dist/timekeeper-google.adapter.js.map +1 -1
- package/dist/uptime.service.d.ts +2 -2
- package/dist/uptime.service.d.ts.map +1 -1
- package/dist/uptime.service.js +2 -2
- package/dist/uptime.service.js.map +1 -1
- package/dist/woodchopper.js +1 -1
- package/dist/woodchopper.js.map +1 -1
- package/package.json +12 -12
- package/readme.md +1 -0
- package/src/alert-channel-with-logger.adapter.ts +9 -1
- package/src/antivirus-with-logger.adapter.ts +4 -0
- package/src/cache-file.service.ts +2 -2
- package/src/certificate-inspector-tls.adapter.ts +2 -2
- package/src/clock-system.adapter.ts +1 -1
- package/src/cron-task-handler-with-logger.strategy.ts +2 -2
- package/src/handler-with-logger.strategy.ts +2 -0
- package/src/healthcheck.handler.ts +1 -1
- package/src/index.ts +1 -0
- package/src/job-queue-noop.adapter.ts +37 -0
- package/src/mailer-with-logger.adapter.ts +15 -2
- package/src/pdf-generator-with-logger.adapter.ts +9 -1
- package/src/remote-file-storage-with-logger.adapter.ts +18 -1
- package/src/semaphore.service.ts +1 -1
- package/src/sms-with-logger.adapter.ts +9 -1
- package/src/timekeeper-google.adapter.ts +2 -1
- package/src/uptime.service.ts +3 -6
- package/src/woodchopper.ts +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CorrelationStorage } from "./correlation-storage.service";
|
|
1
2
|
import { Stopwatch } from "./stopwatch.service";
|
|
2
3
|
export class RemoteFileStorageWithLoggerAdapter {
|
|
3
4
|
deps;
|
|
@@ -10,12 +11,14 @@ export class RemoteFileStorageWithLoggerAdapter {
|
|
|
10
11
|
try {
|
|
11
12
|
this.deps.Logger.info({
|
|
12
13
|
message: "Remote file storage put attempt",
|
|
14
|
+
correlationId: CorrelationStorage.get(),
|
|
13
15
|
metadata: { key: input.key },
|
|
14
16
|
...this.base,
|
|
15
17
|
});
|
|
16
18
|
const result = await this.deps.inner.putFromPath(input);
|
|
17
19
|
this.deps.Logger.info({
|
|
18
20
|
message: "Remote file storage put success",
|
|
21
|
+
correlationId: CorrelationStorage.get(),
|
|
19
22
|
metadata: { key: input.key, size: result.size, duration: duration.stop() },
|
|
20
23
|
...this.base,
|
|
21
24
|
});
|
|
@@ -24,6 +27,7 @@ export class RemoteFileStorageWithLoggerAdapter {
|
|
|
24
27
|
catch (error) {
|
|
25
28
|
this.deps.Logger.error({
|
|
26
29
|
message: "Remote file storage put error",
|
|
30
|
+
correlationId: CorrelationStorage.get(),
|
|
27
31
|
error,
|
|
28
32
|
metadata: { key: input.key, duration: duration.stop() },
|
|
29
33
|
...this.base,
|
|
@@ -34,10 +38,16 @@ export class RemoteFileStorageWithLoggerAdapter {
|
|
|
34
38
|
async head(key) {
|
|
35
39
|
const duration = new Stopwatch(this.deps);
|
|
36
40
|
try {
|
|
37
|
-
this.deps.Logger.info({
|
|
41
|
+
this.deps.Logger.info({
|
|
42
|
+
message: "Remote file storage head attempt",
|
|
43
|
+
correlationId: CorrelationStorage.get(),
|
|
44
|
+
metadata: { key },
|
|
45
|
+
...this.base,
|
|
46
|
+
});
|
|
38
47
|
const result = await this.deps.inner.head(key);
|
|
39
48
|
this.deps.Logger.info({
|
|
40
49
|
message: "Remote file storage head success",
|
|
50
|
+
correlationId: CorrelationStorage.get(),
|
|
41
51
|
metadata: { key, exists: result.exists, duration: duration.stop() },
|
|
42
52
|
...this.base,
|
|
43
53
|
});
|
|
@@ -46,6 +56,7 @@ export class RemoteFileStorageWithLoggerAdapter {
|
|
|
46
56
|
catch (error) {
|
|
47
57
|
this.deps.Logger.error({
|
|
48
58
|
message: "Remote file storage head error",
|
|
59
|
+
correlationId: CorrelationStorage.get(),
|
|
49
60
|
error,
|
|
50
61
|
metadata: { key, duration: duration.stop() },
|
|
51
62
|
...this.base,
|
|
@@ -58,12 +69,14 @@ export class RemoteFileStorageWithLoggerAdapter {
|
|
|
58
69
|
try {
|
|
59
70
|
this.deps.Logger.info({
|
|
60
71
|
message: "Remote file storage get stream attempt",
|
|
72
|
+
correlationId: CorrelationStorage.get(),
|
|
61
73
|
metadata: { key },
|
|
62
74
|
...this.base,
|
|
63
75
|
});
|
|
64
76
|
const result = await this.deps.inner.getStream(key);
|
|
65
77
|
this.deps.Logger.info({
|
|
66
78
|
message: "Remote file storage get stream success",
|
|
79
|
+
correlationId: CorrelationStorage.get(),
|
|
67
80
|
metadata: { key, duration: duration.stop() },
|
|
68
81
|
...this.base,
|
|
69
82
|
});
|
|
@@ -72,6 +85,7 @@ export class RemoteFileStorageWithLoggerAdapter {
|
|
|
72
85
|
catch (error) {
|
|
73
86
|
this.deps.Logger.error({
|
|
74
87
|
message: "Remote file storage get stream error",
|
|
88
|
+
correlationId: CorrelationStorage.get(),
|
|
75
89
|
error,
|
|
76
90
|
metadata: { key, duration: duration.stop() },
|
|
77
91
|
...this.base,
|
|
@@ -84,12 +98,14 @@ export class RemoteFileStorageWithLoggerAdapter {
|
|
|
84
98
|
try {
|
|
85
99
|
this.deps.Logger.info({
|
|
86
100
|
message: "Remote file storage delete attempt",
|
|
101
|
+
correlationId: CorrelationStorage.get(),
|
|
87
102
|
metadata: { key },
|
|
88
103
|
...this.base,
|
|
89
104
|
});
|
|
90
105
|
await this.deps.inner.delete(key);
|
|
91
106
|
this.deps.Logger.info({
|
|
92
107
|
message: "Remote file storage delete success",
|
|
108
|
+
correlationId: CorrelationStorage.get(),
|
|
93
109
|
metadata: { key, duration: duration.stop() },
|
|
94
110
|
...this.base,
|
|
95
111
|
});
|
|
@@ -97,6 +113,7 @@ export class RemoteFileStorageWithLoggerAdapter {
|
|
|
97
113
|
catch (error) {
|
|
98
114
|
this.deps.Logger.error({
|
|
99
115
|
message: "Remote file storage delete error",
|
|
116
|
+
correlationId: CorrelationStorage.get(),
|
|
100
117
|
error,
|
|
101
118
|
metadata: { key, duration: duration.stop() },
|
|
102
119
|
...this.base,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-file-storage-with-logger.adapter.js","sourceRoot":"","sources":["../src/remote-file-storage-with-logger.adapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote-file-storage-with-logger.adapter.js","sourceRoot":"","sources":["../src/remote-file-storage-with-logger.adapter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAQnE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIhD,MAAM,OAAO,kCAAkC;IAGhB;IAFZ,IAAI,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC;IAEjF,YAA6B,IAAkB;QAAlB,SAAI,GAAJ,IAAI,CAAc;IAAG,CAAC;IAEnD,KAAK,CAAC,WAAW,CAAC,KAA6B;QAC7C,MAAM,QAAQ,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE1C,IAAI,CAAC;YACH,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gBACpB,OAAO,EAAE,iCAAiC;gBAC1C,aAAa,EAAE,kBAAkB,CAAC,GAAG,EAAE;gBACvC,QAAQ,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE;gBAC5B,GAAG,IAAI,CAAC,IAAI;aACb,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YAExD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gBACpB,OAAO,EAAE,iCAAiC;gBAC1C,aAAa,EAAE,kBAAkB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EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,EAAE,EAAE;gBAC5C,GAAG,IAAI,CAAC,IAAI;aACb,CAAC,CAAC;YAEH,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semaphore.service.js","sourceRoot":"","sources":["../src/semaphore.service.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,SAAS;IACH,KAAK,CAAuB;IAE7C,YAAY,MAAuB;QACjC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,GAAG,CAAI,MAAwB;QACnC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"semaphore.service.js","sourceRoot":"","sources":["../src/semaphore.service.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,SAAS;IACH,KAAK,CAAuB;IAE7C,YAAY,MAAuB;QACjC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,GAAG,CAAI,MAAwB;QACnC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QAChC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,aAAa,EAAQ,CAAC;QAE3D,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEzB,MAAM,IAAI,CAAC;QAEX,IAAI,CAAC;YACH,OAAO,MAAM,MAAM,EAAE,CAAC;QACxB,CAAC;gBAAS,CAAC;YACT,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sms-with-logger.adapter.d.ts","sourceRoot":"","sources":["../src/sms-with-logger.adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"sms-with-logger.adapter.d.ts","sourceRoot":"","sources":["../src/sms-with-logger.adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG1C,MAAM,MAAM,gCAAgC,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAAC;AAExG,qBAAa,oBAAqB,YAAW,OAAO;IAGtC,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA4C;gBAEpC,IAAI,EAAE,gCAAgC;IAE7D,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAgC9C,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;CAGjC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CorrelationStorage } from "./correlation-storage.service";
|
|
1
2
|
import { Stopwatch } from "./stopwatch.service";
|
|
2
3
|
export class SmsWithLoggerAdapter {
|
|
3
4
|
deps;
|
|
@@ -8,10 +9,16 @@ export class SmsWithLoggerAdapter {
|
|
|
8
9
|
async send(message) {
|
|
9
10
|
const duration = new Stopwatch(this.deps);
|
|
10
11
|
try {
|
|
11
|
-
this.deps.Logger.info({
|
|
12
|
+
this.deps.Logger.info({
|
|
13
|
+
message: "SMS attempt",
|
|
14
|
+
correlationId: CorrelationStorage.get(),
|
|
15
|
+
metadata: message.toJSON(),
|
|
16
|
+
...this.base,
|
|
17
|
+
});
|
|
12
18
|
await this.deps.inner.send(message);
|
|
13
19
|
this.deps.Logger.info({
|
|
14
20
|
message: "SMS success",
|
|
21
|
+
correlationId: CorrelationStorage.get(),
|
|
15
22
|
metadata: { message: message.toJSON(), duration: duration.stop() },
|
|
16
23
|
...this.base,
|
|
17
24
|
});
|
|
@@ -19,6 +26,7 @@ export class SmsWithLoggerAdapter {
|
|
|
19
26
|
catch (error) {
|
|
20
27
|
this.deps.Logger.error({
|
|
21
28
|
message: "SMS error",
|
|
29
|
+
correlationId: CorrelationStorage.get(),
|
|
22
30
|
error,
|
|
23
31
|
metadata: { message: message.toJSON(), duration: duration.stop() },
|
|
24
32
|
...this.base,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sms-with-logger.adapter.js","sourceRoot":"","sources":["../src/sms-with-logger.adapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sms-with-logger.adapter.js","sourceRoot":"","sources":["../src/sms-with-logger.adapter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAGnE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIhD,MAAM,OAAO,oBAAoB;IAGF;IAFZ,IAAI,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IAEjE,YAA6B,IAAsC;QAAtC,SAAI,GAAJ,IAAI,CAAkC;IAAG,C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|
|
1
|
-
{"version":3,"file":"timekeeper-google.adapter.d.ts","sourceRoot":"","sources":["../src/timekeeper-google.adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,qBAAa,uBAAwB,YAAW,cAAc;IAC5D,MAAM,CAAC,GAAG,sCAAyE;IAE7E,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"timekeeper-google.adapter.d.ts","sourceRoot":"","sources":["../src/timekeeper-google.adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,qBAAa,uBAAwB,YAAW,cAAc;IAC5D,MAAM,CAAC,GAAG,sCAAyE;IAE7E,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;CAY7C"}
|
|
@@ -8,7 +8,8 @@ export class TimekeeperGoogleAdapter {
|
|
|
8
8
|
const date = response.headers.get("Date");
|
|
9
9
|
if (!date)
|
|
10
10
|
return null;
|
|
11
|
-
|
|
11
|
+
// biome-ignore lint: lint/style/noRestrictedGlobals
|
|
12
|
+
return tools.Timestamp.fromNumber(new Date(date).getTime());
|
|
12
13
|
}
|
|
13
14
|
catch {
|
|
14
15
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timekeeper-google.adapter.js","sourceRoot":"","sources":["../src/timekeeper-google.adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAG7B,MAAM,OAAO,uBAAuB;IAClC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,eAAe,EAAE,qCAAqC,CAAC,CAAC;IAEnF,KAAK,CAAC,GAAG;QACP,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;YAC1D,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAE1C,IAAI,CAAC,IAAI;gBAAE,OAAO,IAAI,CAAC;YACvB,OAAO,KAAK,CAAC,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"timekeeper-google.adapter.js","sourceRoot":"","sources":["../src/timekeeper-google.adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAG7B,MAAM,OAAO,uBAAuB;IAClC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,eAAe,EAAE,qCAAqC,CAAC,CAAC;IAEnF,KAAK,CAAC,GAAG;QACP,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;YAC1D,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAE1C,IAAI,CAAC,IAAI;gBAAE,OAAO,IAAI,CAAC;YACvB,oDAAoD;YACpD,OAAO,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9D,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC"}
|
package/dist/uptime.service.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import * as tools from "@bgord/tools";
|
|
|
2
2
|
import type { ClockPort } from "./clock.port";
|
|
3
3
|
export type UptimeResultType = {
|
|
4
4
|
duration: tools.Duration;
|
|
5
|
-
formatted:
|
|
5
|
+
formatted: string;
|
|
6
6
|
};
|
|
7
7
|
export declare class Uptime {
|
|
8
8
|
private static readonly rounding;
|
|
9
|
-
static get(
|
|
9
|
+
static get(_clock: ClockPort): UptimeResultType;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=uptime.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uptime.service.d.ts","sourceRoot":"","sources":["../src/uptime.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,gBAAgB,GAAG;
|
|
1
|
+
{"version":3,"file":"uptime.service.d.ts","sourceRoot":"","sources":["../src/uptime.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,gBAAgB,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/E,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAyC;IAEzE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,GAAG,gBAAgB;CAKhD"}
|
package/dist/uptime.service.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
2
|
export class Uptime {
|
|
3
3
|
static rounding = new tools.RoundingToNearestStrategy();
|
|
4
|
-
static get(
|
|
4
|
+
static get(_clock) {
|
|
5
5
|
const duration = tools.Duration.Seconds(Uptime.rounding.round(process.uptime()));
|
|
6
|
-
return { duration, formatted:
|
|
6
|
+
return { duration, formatted: "TODO" };
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=uptime.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uptime.service.js","sourceRoot":"","sources":["../src/uptime.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"uptime.service.js","sourceRoot":"","sources":["../src/uptime.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAKtC,MAAM,OAAO,MAAM;IACT,MAAM,CAAU,QAAQ,GAAG,IAAI,KAAK,CAAC,yBAAyB,EAAE,CAAC;IAEzE,MAAM,CAAC,GAAG,CAAC,MAAiB;QAC1B,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAEjF,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IACzC,CAAC"}
|
package/dist/woodchopper.js
CHANGED
|
@@ -43,7 +43,7 @@ export class Woodchopper {
|
|
|
43
43
|
let withInjectedFields;
|
|
44
44
|
try {
|
|
45
45
|
withInjectedFields = {
|
|
46
|
-
timestamp:
|
|
46
|
+
timestamp: this.deps.Clock.now().toInstant().toString(),
|
|
47
47
|
level,
|
|
48
48
|
app: this.config.app,
|
|
49
49
|
environment: this.config.environment,
|
package/dist/woodchopper.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"woodchopper.js","sourceRoot":"","sources":["../src/woodchopper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,EAML,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,WAAW,GAGZ,MAAM,8BAA8B,CAAC;AAKt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,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC5E,KAAK,GAAwB,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAE5E,KAAK;QACH,IAAI,IAAI,CAAC,KAAK,KAAK,WAAW,CAAC,MAAM;YAAE,OAAO;QAE9C,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;IAED,QAAQ;QACN,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;IACvD,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bgord/bun",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Bartosz Gordon",
|
|
@@ -28,16 +28,16 @@
|
|
|
28
28
|
"@stryker-mutator/core": "9.6.0",
|
|
29
29
|
"@stryker-mutator/typescript-checker": "9.6.0",
|
|
30
30
|
"@types/bun": "1.3.11",
|
|
31
|
-
"@types/nodemailer": "
|
|
32
|
-
"@types/yazl": "3.3.
|
|
33
|
-
"better-auth": "1.
|
|
34
|
-
"cspell": "
|
|
31
|
+
"@types/nodemailer": "8.0.0",
|
|
32
|
+
"@types/yazl": "3.3.1",
|
|
33
|
+
"better-auth": "1.6.0",
|
|
34
|
+
"cspell": "10.0.0",
|
|
35
35
|
"csv": "6.5.1",
|
|
36
36
|
"croner": "10.0.1",
|
|
37
|
-
"knip": "6.
|
|
38
|
-
"lefthook": "2.1.
|
|
37
|
+
"knip": "6.3.1",
|
|
38
|
+
"lefthook": "2.1.5",
|
|
39
39
|
"lockfile-lint": "5.0.0",
|
|
40
|
-
"nodemailer": "8.0.
|
|
40
|
+
"nodemailer": "8.0.5",
|
|
41
41
|
"only-allow": "1.2.2",
|
|
42
42
|
"resend": "6.10.0",
|
|
43
43
|
"sharp": "0.34.5",
|
|
@@ -46,16 +46,16 @@
|
|
|
46
46
|
"yazl": "3.3.1"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@bgord/tools": "1.
|
|
49
|
+
"@bgord/tools": "1.5.0",
|
|
50
50
|
"emittery": "2.0.0",
|
|
51
|
-
"hono": "4.12.
|
|
51
|
+
"hono": "4.12.12",
|
|
52
52
|
"node-cache": "5.1.2"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"better-auth": "1.
|
|
55
|
+
"better-auth": "1.6.0",
|
|
56
56
|
"csv": "6.5.1",
|
|
57
57
|
"croner": "10.0.1",
|
|
58
|
-
"nodemailer": "8.0.
|
|
58
|
+
"nodemailer": "8.0.5",
|
|
59
59
|
"resend": "6.10.0",
|
|
60
60
|
"sharp": "0.34.5",
|
|
61
61
|
"yazl": "3.3.1"
|
package/readme.md
CHANGED
|
@@ -282,6 +282,7 @@ src/
|
|
|
282
282
|
├── job-failer-noop.adapter.ts
|
|
283
283
|
├── job-failer-sqlite.adapter.ts
|
|
284
284
|
├── job-failer.port.ts
|
|
285
|
+
├── job-queue-noop.adapter.ts
|
|
285
286
|
├── job-queue-sqlite-store.service.ts
|
|
286
287
|
├── job-queue-stats-provider-noop.adapter.ts
|
|
287
288
|
├── job-queue-stats-provider-sqlite.adapter.ts
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AlertChannelPort } from "./alert-channel.port";
|
|
2
2
|
import type { AlertMessage } from "./alert-message.vo";
|
|
3
3
|
import type { ClockPort } from "./clock.port";
|
|
4
|
+
import { CorrelationStorage } from "./correlation-storage.service";
|
|
4
5
|
import type { LoggerPort } from "./logger.port";
|
|
5
6
|
import { Stopwatch } from "./stopwatch.service";
|
|
6
7
|
|
|
@@ -19,18 +20,25 @@ export class AlertChannelWithLoggerAdapter implements AlertChannelPort {
|
|
|
19
20
|
const duration = new Stopwatch(this.deps);
|
|
20
21
|
|
|
21
22
|
try {
|
|
22
|
-
this.deps.Logger.info({
|
|
23
|
+
this.deps.Logger.info({
|
|
24
|
+
message: "Alert channel attempt",
|
|
25
|
+
correlationId: CorrelationStorage.get(),
|
|
26
|
+
metadata: alert.toJSON(),
|
|
27
|
+
...this.base,
|
|
28
|
+
});
|
|
23
29
|
|
|
24
30
|
await this.deps.inner.send(alert);
|
|
25
31
|
|
|
26
32
|
this.deps.Logger.info({
|
|
27
33
|
message: "Alert channel success",
|
|
34
|
+
correlationId: CorrelationStorage.get(),
|
|
28
35
|
metadata: { alert: alert.toJSON(), duration: duration.stop() },
|
|
29
36
|
...this.base,
|
|
30
37
|
});
|
|
31
38
|
} catch (error) {
|
|
32
39
|
this.deps.Logger.error({
|
|
33
40
|
message: "Alert channel error",
|
|
41
|
+
correlationId: CorrelationStorage.get(),
|
|
34
42
|
error,
|
|
35
43
|
metadata: { alert: alert.toJSON(), duration: duration.stop() },
|
|
36
44
|
...this.base,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AntivirusPort, AntivirusScanResult } from "./antivirus.port";
|
|
2
2
|
import type { ClockPort } from "./clock.port";
|
|
3
|
+
import { CorrelationStorage } from "./correlation-storage.service";
|
|
3
4
|
import type { LoggerPort } from "./logger.port";
|
|
4
5
|
import { Stopwatch } from "./stopwatch.service";
|
|
5
6
|
|
|
@@ -20,6 +21,7 @@ export class AntivirusWithLoggerAdapter implements AntivirusPort {
|
|
|
20
21
|
try {
|
|
21
22
|
this.deps.Logger.info({
|
|
22
23
|
message: "Antivirus scan attempt",
|
|
24
|
+
correlationId: CorrelationStorage.get(),
|
|
23
25
|
metadata: { size: bytes.byteLength },
|
|
24
26
|
...this.base,
|
|
25
27
|
});
|
|
@@ -28,6 +30,7 @@ export class AntivirusWithLoggerAdapter implements AntivirusPort {
|
|
|
28
30
|
|
|
29
31
|
this.deps.Logger.info({
|
|
30
32
|
message: "Antivirus scan success",
|
|
33
|
+
correlationId: CorrelationStorage.get(),
|
|
31
34
|
metadata: { clean: result.clean, duration: duration.stop() },
|
|
32
35
|
...this.base,
|
|
33
36
|
});
|
|
@@ -36,6 +39,7 @@ export class AntivirusWithLoggerAdapter implements AntivirusPort {
|
|
|
36
39
|
} catch (error) {
|
|
37
40
|
this.deps.Logger.error({
|
|
38
41
|
message: "Antivirus scan error",
|
|
42
|
+
correlationId: CorrelationStorage.get(),
|
|
39
43
|
error,
|
|
40
44
|
metadata: duration.stop(),
|
|
41
45
|
...this.base,
|
|
@@ -15,7 +15,7 @@ export const CacheFileMustRevalidate: CacheFileHandler = {
|
|
|
15
15
|
headers: new Headers({
|
|
16
16
|
ETag: options.etag.get(),
|
|
17
17
|
"Cache-Control": "private, max-age=0, must-revalidate",
|
|
18
|
-
"Last-Modified":
|
|
18
|
+
"Last-Modified": options.lastModified.toInstant().toString(),
|
|
19
19
|
Vary: "Authorization, Cookie",
|
|
20
20
|
...overrides,
|
|
21
21
|
}),
|
|
@@ -28,7 +28,7 @@ export const CacheFileMustRevalidate: CacheFileHandler = {
|
|
|
28
28
|
"Cache-Control": "private, max-age=0, must-revalidate",
|
|
29
29
|
ETag: options.etag.get(),
|
|
30
30
|
"Content-Length": options.size.toBytes().toString(),
|
|
31
|
-
"Last-Modified":
|
|
31
|
+
"Last-Modified": options.lastModified.toInstant().toString(),
|
|
32
32
|
"Accept-Ranges": "bytes",
|
|
33
33
|
Vary: "Authorization, Cookie",
|
|
34
34
|
...overrides,
|
|
@@ -23,8 +23,8 @@ export class CertificateInspectorTLSAdapter implements CertificateInspectorPort
|
|
|
23
23
|
cleanup(socket);
|
|
24
24
|
return resolve({ success: false });
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
const remaining = tools.Timestamp.
|
|
26
|
+
// biome-ignore lint: lint/style/noRestrictedGlobals
|
|
27
|
+
const remaining = tools.Timestamp.fromNumber(new Date(certificate.valid_to).getTime()).difference(
|
|
28
28
|
this.deps.Clock.now(),
|
|
29
29
|
);
|
|
30
30
|
|
|
@@ -28,7 +28,7 @@ export class CronTaskHandlerWithLoggerStrategy implements CronTaskHandlerStrateg
|
|
|
28
28
|
this.deps.Logger.info({
|
|
29
29
|
message: `${task.label} success`,
|
|
30
30
|
correlationId,
|
|
31
|
-
metadata: duration.stop(),
|
|
31
|
+
metadata: { duration: duration.stop() },
|
|
32
32
|
...this.base,
|
|
33
33
|
});
|
|
34
34
|
} catch (error) {
|
|
@@ -36,7 +36,7 @@ export class CronTaskHandlerWithLoggerStrategy implements CronTaskHandlerStrateg
|
|
|
36
36
|
message: `${task.label} error`,
|
|
37
37
|
correlationId,
|
|
38
38
|
error,
|
|
39
|
-
metadata: duration.stop(),
|
|
39
|
+
metadata: { duration: duration.stop() },
|
|
40
40
|
...this.base,
|
|
41
41
|
});
|
|
42
42
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ClockPort } from "./clock.port";
|
|
2
|
+
import { CorrelationStorage } from "./correlation-storage.service";
|
|
2
3
|
import type { Handleable, HandlerStrategy } from "./handler.strategy";
|
|
3
4
|
import type { LoggerPort } from "./logger.port";
|
|
4
5
|
import { Stopwatch } from "./stopwatch.service";
|
|
@@ -17,6 +18,7 @@ export class HandlerWithLoggerStrategy implements HandlerStrategy {
|
|
|
17
18
|
} catch (error) {
|
|
18
19
|
this.deps.Logger.error({
|
|
19
20
|
message: `Unknown ${handleable.name} handler error`,
|
|
21
|
+
correlationId: CorrelationStorage.get(),
|
|
20
22
|
component: "infra",
|
|
21
23
|
operation: "handler",
|
|
22
24
|
metadata: { name: handleable.name, duration: duration.stop() },
|
|
@@ -141,7 +141,7 @@ export class HealthcheckHandler {
|
|
|
141
141
|
deployment: {
|
|
142
142
|
version: build.version,
|
|
143
143
|
timestamp: build.timestamp,
|
|
144
|
-
date:
|
|
144
|
+
date: tools.Timestamp.fromValue(build.timestamp).toInstant().toString(),
|
|
145
145
|
sha: build.sha,
|
|
146
146
|
size: tools.Size.fromBytes(build.size).format(tools.Size.unit.MB),
|
|
147
147
|
environment: this.config.Env,
|
package/src/index.ts
CHANGED
|
@@ -258,6 +258,7 @@ export * from "./job-failer-noop.adapter";
|
|
|
258
258
|
export * from "./job-failer-sqlite.adapter";
|
|
259
259
|
export * from "./job-queue.adapter";
|
|
260
260
|
export * from "./job-queue.port";
|
|
261
|
+
export * from "./job-queue-noop.adapter";
|
|
261
262
|
export * from "./job-queue-sqlite-store.service";
|
|
262
263
|
export * from "./job-queue-stats-provider.port";
|
|
263
264
|
export * from "./job-queue-stats-provider-noop.adapter";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type * as tools from "@bgord/tools";
|
|
2
|
+
import type { GenericJob } from "./job.types";
|
|
3
|
+
import type { JobQueuePort } from "./job-queue.port";
|
|
4
|
+
import type { JobHandler, JobRegistryPort } from "./job-registry.port";
|
|
5
|
+
import type { JobRetryPolicyStrategy } from "./job-retry-policy.strategy";
|
|
6
|
+
|
|
7
|
+
type Config<Job extends GenericJob> = { registry: JobRegistryPort<Job> };
|
|
8
|
+
|
|
9
|
+
export class JobQueueAdapterNoop<Job extends GenericJob> implements JobQueuePort<Job> {
|
|
10
|
+
constructor(private readonly config: Config<Job>) {}
|
|
11
|
+
|
|
12
|
+
async enqueue<EnqueuedJob extends Job>(job: EnqueuedJob): Promise<EnqueuedJob> {
|
|
13
|
+
return job;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async claim(_limit: tools.IntegerPositiveType): Promise<ReadonlyArray<Job>> {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async complete(_id: GenericJob["id"]): Promise<void> {}
|
|
21
|
+
|
|
22
|
+
async fail(_id: GenericJob["id"]): Promise<void> {}
|
|
23
|
+
|
|
24
|
+
async requeue(
|
|
25
|
+
_id: GenericJob["id"],
|
|
26
|
+
_revision: GenericJob["revision"],
|
|
27
|
+
_delay: tools.Duration,
|
|
28
|
+
): Promise<void> {}
|
|
29
|
+
|
|
30
|
+
getRetryPolicy(name: GenericJob["name"]): JobRetryPolicyStrategy {
|
|
31
|
+
return this.config.registry.getRetryPolicy(name);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
getHandler(name: GenericJob["name"]): JobHandler<Job> {
|
|
35
|
+
return this.config.registry.getHandler(name);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ClockPort } from "./clock.port";
|
|
2
|
+
import { CorrelationStorage } from "./correlation-storage.service";
|
|
2
3
|
import type { LoggerPort } from "./logger.port";
|
|
3
4
|
import type { MailerPort } from "./mailer.port";
|
|
4
5
|
import type { MailerTemplate } from "./mailer-template.vo";
|
|
@@ -15,17 +16,29 @@ export class MailerWithLoggerAdapter implements MailerPort {
|
|
|
15
16
|
const duration = new Stopwatch(this.deps);
|
|
16
17
|
|
|
17
18
|
try {
|
|
18
|
-
this.deps.Logger.info({
|
|
19
|
+
this.deps.Logger.info({
|
|
20
|
+
message: "Mailer attempt",
|
|
21
|
+
correlationId: CorrelationStorage.get(),
|
|
22
|
+
metadata: template.toJSON(),
|
|
23
|
+
...this.base,
|
|
24
|
+
});
|
|
19
25
|
|
|
20
26
|
await this.deps.inner.send(template);
|
|
21
27
|
|
|
22
28
|
this.deps.Logger.info({
|
|
23
29
|
message: "Mailer success",
|
|
30
|
+
correlationId: CorrelationStorage.get(),
|
|
24
31
|
metadata: { template: template.toJSON(), duration: duration.stop() },
|
|
25
32
|
...this.base,
|
|
26
33
|
});
|
|
27
34
|
} catch (error) {
|
|
28
|
-
this.deps.Logger.error({
|
|
35
|
+
this.deps.Logger.error({
|
|
36
|
+
message: "Mailer error",
|
|
37
|
+
correlationId: CorrelationStorage.get(),
|
|
38
|
+
error,
|
|
39
|
+
metadata: duration.stop(),
|
|
40
|
+
...this.base,
|
|
41
|
+
});
|
|
29
42
|
|
|
30
43
|
throw error;
|
|
31
44
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
2
|
import type { ClockPort } from "./clock.port";
|
|
3
|
+
import { CorrelationStorage } from "./correlation-storage.service";
|
|
3
4
|
import type { LoggerPort } from "./logger.port";
|
|
4
5
|
import type { PdfGeneratorPort, PdfGeneratorTemplateType } from "./pdf-generator.port";
|
|
5
6
|
import { Stopwatch } from "./stopwatch.service";
|
|
@@ -15,13 +16,19 @@ export class PdfGeneratorWithLoggerAdapter implements PdfGeneratorPort {
|
|
|
15
16
|
const duration = new Stopwatch(this.deps);
|
|
16
17
|
|
|
17
18
|
try {
|
|
18
|
-
this.deps.Logger.info({
|
|
19
|
+
this.deps.Logger.info({
|
|
20
|
+
message: "PDF generator attempt",
|
|
21
|
+
correlationId: CorrelationStorage.get(),
|
|
22
|
+
metadata: { template, data },
|
|
23
|
+
...this.base,
|
|
24
|
+
});
|
|
19
25
|
|
|
20
26
|
const pdf = await this.deps.inner.request(template, data);
|
|
21
27
|
const size = tools.Size.fromBytes(pdf.byteLength);
|
|
22
28
|
|
|
23
29
|
this.deps.Logger.info({
|
|
24
30
|
message: "PDF generator success",
|
|
31
|
+
correlationId: CorrelationStorage.get(),
|
|
25
32
|
metadata: { size, duration: duration.stop() },
|
|
26
33
|
...this.base,
|
|
27
34
|
});
|
|
@@ -30,6 +37,7 @@ export class PdfGeneratorWithLoggerAdapter implements PdfGeneratorPort {
|
|
|
30
37
|
} catch (error) {
|
|
31
38
|
this.deps.Logger.error({
|
|
32
39
|
message: "PDF generator error",
|
|
40
|
+
correlationId: CorrelationStorage.get(),
|
|
33
41
|
error,
|
|
34
42
|
metadata: duration.stop(),
|
|
35
43
|
...this.base,
|