@bgord/bun 1.14.7 → 1.15.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/dist/ab-variant-selector.service.d.ts.map +1 -1
- package/dist/ab-variant-selector.service.js +3 -2
- package/dist/ab-variant-selector.service.js.map +1 -1
- package/dist/ab-variant-weight.vo.d.ts +3 -3
- package/dist/ab-variant-weight.vo.d.ts.map +1 -1
- package/dist/ab-variant-weight.vo.js +4 -8
- package/dist/ab-variant-weight.vo.js.map +1 -1
- package/dist/basic-auth-password.vo.d.ts +3 -3
- package/dist/basic-auth-password.vo.d.ts.map +1 -1
- package/dist/basic-auth-password.vo.js +4 -8
- package/dist/basic-auth-password.vo.js.map +1 -1
- package/dist/basic-auth-username.vo.d.ts +3 -3
- package/dist/basic-auth-username.vo.d.ts.map +1 -1
- package/dist/basic-auth-username.vo.js +4 -8
- package/dist/basic-auth-username.vo.js.map +1 -1
- package/dist/binary.vo.d.ts +3 -5
- package/dist/binary.vo.d.ts.map +1 -1
- package/dist/binary.vo.js +6 -16
- package/dist/binary.vo.js.map +1 -1
- package/dist/client-ip.vo.d.ts +3 -3
- package/dist/client-ip.vo.d.ts.map +1 -1
- package/dist/client-ip.vo.js +4 -3
- package/dist/client-ip.vo.js.map +1 -1
- package/dist/client-user-agent.vo.d.ts +3 -3
- package/dist/client-user-agent.vo.d.ts.map +1 -1
- package/dist/client-user-agent.vo.js +4 -7
- package/dist/client-user-agent.vo.js.map +1 -1
- package/dist/client.vo.d.ts.map +1 -1
- package/dist/client.vo.js +10 -3
- package/dist/client.vo.js.map +1 -1
- package/dist/command-envelope.d.ts +4 -4
- package/dist/commit-sha-value.vo.d.ts +3 -3
- package/dist/commit-sha-value.vo.d.ts.map +1 -1
- package/dist/commit-sha-value.vo.js +4 -7
- package/dist/commit-sha-value.vo.js.map +1 -1
- package/dist/commit-sha.vo.d.ts.map +1 -1
- package/dist/commit-sha.vo.js +2 -1
- package/dist/commit-sha.vo.js.map +1 -1
- package/dist/correlation-id.vo.d.ts +3 -3
- package/dist/correlation-id.vo.d.ts.map +1 -1
- package/dist/correlation.middleware.d.ts.map +1 -1
- package/dist/correlation.middleware.js +3 -2
- package/dist/correlation.middleware.js.map +1 -1
- package/dist/encryption-key-value.vo.d.ts +3 -3
- package/dist/encryption-key-value.vo.d.ts.map +1 -1
- package/dist/encryption-key-value.vo.js +4 -7
- package/dist/encryption-key-value.vo.js.map +1 -1
- package/dist/encryption-key.vo.d.ts.map +1 -1
- package/dist/encryption-key.vo.js +2 -1
- package/dist/encryption-key.vo.js.map +1 -1
- package/dist/environment-loader-encrypted.adapter.d.ts +1 -1
- package/dist/environment-loader-encrypted.adapter.d.ts.map +1 -1
- package/dist/environment-loader-encrypted.adapter.js +8 -1
- package/dist/environment-loader-encrypted.adapter.js.map +1 -1
- package/dist/environment-loader-noop.adapter.d.ts +1 -1
- package/dist/environment-loader-noop.adapter.d.ts.map +1 -1
- package/dist/environment-loader-noop.adapter.js +8 -4
- package/dist/environment-loader-noop.adapter.js.map +1 -1
- package/dist/environment-loader-process-safe.adapter.d.ts +1 -1
- package/dist/environment-loader-process-safe.adapter.d.ts.map +1 -1
- package/dist/environment-loader-process-safe.adapter.js +12 -3
- package/dist/environment-loader-process-safe.adapter.js.map +1 -1
- package/dist/environment-loader-process.adapter.d.ts +1 -1
- package/dist/environment-loader-process.adapter.d.ts.map +1 -1
- package/dist/environment-loader-process.adapter.js +8 -1
- package/dist/environment-loader-process.adapter.js.map +1 -1
- package/dist/environment-loader.port.d.ts +5 -2
- package/dist/environment-loader.port.d.ts.map +1 -1
- package/dist/environment-loader.port.js +1 -1
- package/dist/environment-loader.port.js.map +1 -1
- package/dist/event-envelope.d.ts +8 -8
- package/dist/event-envelope.d.ts.map +1 -1
- package/dist/event-envelope.js +3 -3
- package/dist/event-envelope.js.map +1 -1
- package/dist/event-store-with-logger.adapter.d.ts.map +1 -1
- package/dist/event-store-with-logger.adapter.js +1 -0
- package/dist/event-store-with-logger.adapter.js.map +1 -1
- package/dist/event-stream.vo.d.ts +3 -3
- package/dist/event-stream.vo.d.ts.map +1 -1
- package/dist/event-stream.vo.js +2 -5
- package/dist/event-stream.vo.js.map +1 -1
- package/dist/event-validator-registry.adapter.d.ts +12 -0
- package/dist/event-validator-registry.adapter.d.ts.map +1 -0
- package/dist/event-validator-registry.adapter.js +32 -0
- package/dist/event-validator-registry.adapter.js.map +1 -0
- package/dist/event-validator-registry.port.d.ts +3 -0
- package/dist/event-validator-registry.port.d.ts.map +1 -1
- package/dist/event-validator-registry.port.js +1 -1
- package/dist/event-validator-registry.port.js.map +1 -1
- package/dist/file-draft-zip.service.d.ts.map +1 -1
- package/dist/file-draft-zip.service.js +2 -1
- package/dist/file-draft-zip.service.js.map +1 -1
- package/dist/hash-bucket.vo.d.ts.map +1 -1
- package/dist/hash-bucket.vo.js +2 -1
- package/dist/hash-bucket.vo.js.map +1 -1
- package/dist/hash-value.vo.d.ts +3 -3
- package/dist/hash-value.vo.d.ts.map +1 -1
- package/dist/hash-value.vo.js +4 -7
- package/dist/hash-value.vo.js.map +1 -1
- package/dist/hash.vo.d.ts.map +1 -1
- package/dist/hash.vo.js +2 -1
- package/dist/hash.vo.js.map +1 -1
- package/dist/hcaptcha-secret-key.vo.d.ts +3 -3
- package/dist/hcaptcha-secret-key.vo.d.ts.map +1 -1
- package/dist/hcaptcha-secret-key.vo.js +4 -7
- package/dist/hcaptcha-secret-key.vo.js.map +1 -1
- package/dist/hcaptcha-site-key.vo.d.ts +3 -3
- package/dist/hcaptcha-site-key.vo.d.ts.map +1 -1
- package/dist/hcaptcha-site-key.vo.js +4 -7
- package/dist/hcaptcha-site-key.vo.js.map +1 -1
- package/dist/healthcheck-hono.handler.d.ts +3 -3
- package/dist/healthcheck.handler.d.ts +3 -3
- package/dist/healthcheck.handler.d.ts.map +1 -1
- package/dist/healthcheck.handler.js +5 -4
- package/dist/healthcheck.handler.js.map +1 -1
- package/dist/http-logger.middleware.js +1 -1
- package/dist/http-logger.middleware.js.map +1 -1
- package/dist/i18n.service.d.ts +2 -1
- package/dist/i18n.service.d.ts.map +1 -1
- package/dist/i18n.service.js +2 -1
- package/dist/i18n.service.js.map +1 -1
- package/dist/image-info-noop.adapter.d.ts.map +1 -1
- package/dist/image-info-noop.adapter.js +3 -2
- package/dist/image-info-noop.adapter.js.map +1 -1
- package/dist/image-info-sharp.adapter.d.ts.map +1 -1
- package/dist/image-info-sharp.adapter.js +4 -3
- package/dist/image-info-sharp.adapter.js.map +1 -1
- package/dist/in-flight-requests-tracker.service.d.ts.map +1 -1
- package/dist/in-flight-requests-tracker.service.js +3 -2
- package/dist/in-flight-requests-tracker.service.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/logger.port.d.ts +1 -3
- package/dist/logger.port.d.ts.map +1 -1
- package/dist/logger.port.js +0 -2
- package/dist/logger.port.js.map +1 -1
- package/dist/mailer-content-html.vo.d.ts +3 -3
- package/dist/mailer-content-html.vo.d.ts.map +1 -1
- package/dist/mailer-content-html.vo.js +4 -8
- package/dist/mailer-content-html.vo.js.map +1 -1
- package/dist/mailer-subject.vo.d.ts +3 -3
- package/dist/mailer-subject.vo.d.ts.map +1 -1
- package/dist/mailer-subject.vo.js +4 -8
- package/dist/mailer-subject.vo.js.map +1 -1
- package/dist/modules/history/event-handlers/onHistoryPopulatedEvent.d.ts.map +1 -1
- package/dist/modules/history/event-handlers/onHistoryPopulatedEvent.js +2 -1
- package/dist/modules/history/event-handlers/onHistoryPopulatedEvent.js.map +1 -1
- package/dist/modules/history/events/HISTORY_CLEARED_EVENT.d.ts +14 -14
- package/dist/modules/history/events/HISTORY_CLEARED_EVENT.d.ts.map +1 -1
- package/dist/modules/history/events/HISTORY_CLEARED_EVENT.js +4 -4
- package/dist/modules/history/events/HISTORY_CLEARED_EVENT.js.map +1 -1
- package/dist/modules/history/events/HISTORY_POPULATED_EVENT.d.ts +17 -17
- package/dist/modules/history/events/HISTORY_POPULATED_EVENT.d.ts.map +1 -1
- package/dist/modules/history/events/HISTORY_POPULATED_EVENT.js +4 -4
- package/dist/modules/history/events/HISTORY_POPULATED_EVENT.js.map +1 -1
- package/dist/modules/history/value-objects/history-created-at.d.ts +3 -3
- package/dist/modules/history/value-objects/history-created-at.d.ts.map +1 -1
- package/dist/modules/history/value-objects/history-id.d.ts +1 -1
- package/dist/modules/history/value-objects/history-id.d.ts.map +1 -1
- package/dist/modules/history/value-objects/history-operation.d.ts +2 -2
- package/dist/modules/history/value-objects/history-operation.d.ts.map +1 -1
- package/dist/modules/history/value-objects/history-operation.js +2 -5
- package/dist/modules/history/value-objects/history-operation.js.map +1 -1
- package/dist/modules/history/value-objects/history-payload.d.ts +7 -3
- package/dist/modules/history/value-objects/history-payload.d.ts.map +1 -1
- package/dist/modules/history/value-objects/history-payload.js +8 -6
- package/dist/modules/history/value-objects/history-payload.js.map +1 -1
- package/dist/modules/history/value-objects/history-subject.d.ts +3 -3
- package/dist/modules/history/value-objects/history-subject.d.ts.map +1 -1
- package/dist/modules/history/value-objects/history-subject.js +2 -5
- package/dist/modules/history/value-objects/history-subject.js.map +1 -1
- package/dist/modules/history/value-objects/history.d.ts +21 -17
- package/dist/modules/history/value-objects/history.d.ts.map +1 -1
- package/dist/modules/history/value-objects/history.js +3 -3
- package/dist/modules/history/value-objects/history.js.map +1 -1
- package/dist/modules/preferences/command-handlers/handleSetUserLanguageCommand.d.ts.map +1 -1
- package/dist/modules/preferences/command-handlers/handleSetUserLanguageCommand.js +2 -1
- package/dist/modules/preferences/command-handlers/handleSetUserLanguageCommand.js.map +1 -1
- package/dist/modules/preferences/commands/SET_USER_LANGUAGE_COMMAND.d.ts +12 -12
- package/dist/modules/preferences/commands/SET_USER_LANGUAGE_COMMAND.d.ts.map +1 -1
- package/dist/modules/preferences/commands/SET_USER_LANGUAGE_COMMAND.js +4 -4
- package/dist/modules/preferences/commands/SET_USER_LANGUAGE_COMMAND.js.map +1 -1
- package/dist/modules/preferences/events/USER_LANGUAGE_SET_EVENT.d.ts +15 -15
- package/dist/modules/preferences/events/USER_LANGUAGE_SET_EVENT.d.ts.map +1 -1
- package/dist/modules/preferences/events/USER_LANGUAGE_SET_EVENT.js +4 -4
- package/dist/modules/preferences/events/USER_LANGUAGE_SET_EVENT.js.map +1 -1
- package/dist/modules/system/events/HOUR_HAS_PASSED_EVENT.d.ts +14 -14
- package/dist/modules/system/events/HOUR_HAS_PASSED_EVENT.d.ts.map +1 -1
- package/dist/modules/system/events/HOUR_HAS_PASSED_EVENT.js +4 -4
- package/dist/modules/system/events/HOUR_HAS_PASSED_EVENT.js.map +1 -1
- package/dist/modules/system/events/MINUTE_HAS_PASSED_EVENT.d.ts +14 -14
- package/dist/modules/system/events/MINUTE_HAS_PASSED_EVENT.d.ts.map +1 -1
- package/dist/modules/system/events/MINUTE_HAS_PASSED_EVENT.js +4 -4
- package/dist/modules/system/events/MINUTE_HAS_PASSED_EVENT.js.map +1 -1
- package/dist/modules/system/events/SECURITY_VIOLATION_DETECTED_EVENT.d.ts +21 -21
- package/dist/modules/system/events/SECURITY_VIOLATION_DETECTED_EVENT.d.ts.map +1 -1
- package/dist/modules/system/events/SECURITY_VIOLATION_DETECTED_EVENT.js +7 -7
- package/dist/modules/system/events/SECURITY_VIOLATION_DETECTED_EVENT.js.map +1 -1
- package/dist/modules/system/services/passage-of-time-hourly.service.d.ts.map +1 -1
- package/dist/modules/system/services/passage-of-time-hourly.service.js +2 -1
- package/dist/modules/system/services/passage-of-time-hourly.service.js.map +1 -1
- package/dist/modules/system/services/passage-of-time-minute.service.d.ts.map +1 -1
- package/dist/modules/system/services/passage-of-time-minute.service.js +2 -1
- package/dist/modules/system/services/passage-of-time-minute.service.js.map +1 -1
- package/dist/node-env.vo.d.ts +0 -5
- package/dist/node-env.vo.d.ts.map +1 -1
- package/dist/node-env.vo.js +0 -3
- package/dist/node-env.vo.js.map +1 -1
- package/dist/nonce-provider-crypto.adapter.d.ts.map +1 -1
- package/dist/nonce-provider-crypto.adapter.js +2 -1
- package/dist/nonce-provider-crypto.adapter.js.map +1 -1
- package/dist/nonce-provider-noop.adapter.d.ts.map +1 -1
- package/dist/nonce-provider-noop.adapter.js +2 -1
- package/dist/nonce-provider-noop.adapter.js.map +1 -1
- package/dist/nonce-value.vo.d.ts +3 -3
- package/dist/nonce-value.vo.d.ts.map +1 -1
- package/dist/nonce-value.vo.js +4 -7
- package/dist/nonce-value.vo.js.map +1 -1
- package/dist/port.vo.d.ts +3 -3
- package/dist/port.vo.d.ts.map +1 -1
- package/dist/port.vo.js +4 -9
- package/dist/port.vo.js.map +1 -1
- package/dist/prerequisite-verifier-outside-connectivity.adapter.d.ts.map +1 -1
- package/dist/prerequisite-verifier-outside-connectivity.adapter.js +2 -1
- package/dist/prerequisite-verifier-outside-connectivity.adapter.js.map +1 -1
- package/dist/recaptcha-secret-key.vo.d.ts +3 -3
- package/dist/recaptcha-secret-key.vo.d.ts.map +1 -1
- package/dist/recaptcha-secret-key.vo.js +4 -7
- package/dist/recaptcha-secret-key.vo.js.map +1 -1
- package/dist/recaptcha-site-key.vo.d.ts +3 -3
- package/dist/recaptcha-site-key.vo.d.ts.map +1 -1
- package/dist/recaptcha-site-key.vo.js +4 -7
- package/dist/recaptcha-site-key.vo.js.map +1 -1
- package/dist/redactor-error-cause-depth-limit.strategy.d.ts.map +1 -1
- package/dist/redactor-error-cause-depth-limit.strategy.js +3 -2
- package/dist/redactor-error-cause-depth-limit.strategy.js.map +1 -1
- package/dist/redactor-metadata-compact-array.strategy.d.ts.map +1 -1
- package/dist/redactor-metadata-compact-array.strategy.js +2 -1
- package/dist/redactor-metadata-compact-array.strategy.js.map +1 -1
- package/dist/redactor-metadata-compact-object.strategy.d.ts.map +1 -1
- package/dist/redactor-metadata-compact-object.strategy.js +2 -1
- package/dist/redactor-metadata-compact-object.strategy.js.map +1 -1
- package/dist/remote-file-storage-disk.adapter.d.ts.map +1 -1
- package/dist/remote-file-storage-disk.adapter.js +2 -1
- package/dist/remote-file-storage-disk.adapter.js.map +1 -1
- package/dist/retry-backoff-exponential.strategy.d.ts.map +1 -1
- package/dist/retry-backoff-exponential.strategy.js +2 -1
- package/dist/retry-backoff-exponential.strategy.js.map +1 -1
- package/dist/retry-backoff-fibonacci.strategy.d.ts.map +1 -1
- package/dist/retry-backoff-fibonacci.strategy.js +2 -1
- package/dist/retry-backoff-fibonacci.strategy.js.map +1 -1
- package/dist/retry-backoff-linear.strategy.d.ts.map +1 -1
- package/dist/retry-backoff-linear.strategy.js +2 -1
- package/dist/retry-backoff-linear.strategy.js.map +1 -1
- package/dist/retry.service.d.ts.map +1 -1
- package/dist/retry.service.js +2 -1
- package/dist/retry.service.js.map +1 -1
- package/dist/security-countermeasure-ban.strategy.d.ts.map +1 -1
- package/dist/security-countermeasure-ban.strategy.js +3 -2
- package/dist/security-countermeasure-ban.strategy.js.map +1 -1
- package/dist/security-countermeasure-mirage.strategy.d.ts.map +1 -1
- package/dist/security-countermeasure-mirage.strategy.js +2 -1
- package/dist/security-countermeasure-mirage.strategy.js.map +1 -1
- package/dist/security-countermeasure-name.vo.d.ts +3 -5
- package/dist/security-countermeasure-name.vo.d.ts.map +1 -1
- package/dist/security-countermeasure-name.vo.js +4 -11
- package/dist/security-countermeasure-name.vo.js.map +1 -1
- package/dist/security-countermeasure-noop.strategy.d.ts.map +1 -1
- package/dist/security-countermeasure-noop.strategy.js +2 -1
- package/dist/security-countermeasure-noop.strategy.js.map +1 -1
- package/dist/security-countermeasure-report.strategy.d.ts.map +1 -1
- package/dist/security-countermeasure-report.strategy.js +2 -1
- package/dist/security-countermeasure-report.strategy.js.map +1 -1
- package/dist/security-countermeasure-tarpit.strategy.d.ts.map +1 -1
- package/dist/security-countermeasure-tarpit.strategy.js +2 -1
- package/dist/security-countermeasure-tarpit.strategy.js.map +1 -1
- package/dist/security-rule-and.strategy.d.ts.map +1 -1
- package/dist/security-rule-and.strategy.js +2 -1
- package/dist/security-rule-and.strategy.js.map +1 -1
- package/dist/security-rule-bait-routes.strategy.d.ts.map +1 -1
- package/dist/security-rule-bait-routes.strategy.js +2 -1
- package/dist/security-rule-bait-routes.strategy.js.map +1 -1
- package/dist/security-rule-fail.strategy.d.ts.map +1 -1
- package/dist/security-rule-fail.strategy.js +2 -1
- package/dist/security-rule-fail.strategy.js.map +1 -1
- package/dist/security-rule-honey-pot-field.strategy.d.ts.map +1 -1
- package/dist/security-rule-honey-pot-field.strategy.js +2 -1
- package/dist/security-rule-honey-pot-field.strategy.js.map +1 -1
- package/dist/security-rule-name.vo.d.ts +3 -5
- package/dist/security-rule-name.vo.d.ts.map +1 -1
- package/dist/security-rule-name.vo.js +5 -12
- package/dist/security-rule-name.vo.js.map +1 -1
- package/dist/security-rule-or.strategy.d.ts.map +1 -1
- package/dist/security-rule-or.strategy.js +2 -1
- package/dist/security-rule-or.strategy.js.map +1 -1
- package/dist/security-rule-pass.strategy.d.ts.map +1 -1
- package/dist/security-rule-pass.strategy.js +2 -1
- package/dist/security-rule-pass.strategy.js.map +1 -1
- package/dist/security-rule-user-agent.strategy.d.ts.map +1 -1
- package/dist/security-rule-user-agent.strategy.js +2 -1
- package/dist/security-rule-user-agent.strategy.js.map +1 -1
- package/dist/security-rule-violation-threshold.strategy.d.ts.map +1 -1
- package/dist/security-rule-violation-threshold.strategy.js +3 -2
- package/dist/security-rule-violation-threshold.strategy.js.map +1 -1
- package/dist/shield-body-limit.strategy.d.ts.map +1 -1
- package/dist/shield-body-limit.strategy.js +3 -2
- package/dist/shield-body-limit.strategy.js.map +1 -1
- package/dist/shield-recaptcha.strategy.d.ts.map +1 -1
- package/dist/shield-recaptcha.strategy.js +2 -1
- package/dist/shield-recaptcha.strategy.js.map +1 -1
- package/dist/smtp-host.vo.d.ts +3 -3
- package/dist/smtp-host.vo.d.ts.map +1 -1
- package/dist/smtp-host.vo.js +4 -8
- package/dist/smtp-host.vo.js.map +1 -1
- package/dist/smtp-pass.vo.d.ts +3 -3
- package/dist/smtp-pass.vo.d.ts.map +1 -1
- package/dist/smtp-pass.vo.js +4 -8
- package/dist/smtp-pass.vo.js.map +1 -1
- package/dist/smtp-port.vo.d.ts +3 -3
- package/dist/smtp-port.vo.d.ts.map +1 -1
- package/dist/smtp-user.vo.d.ts +3 -3
- package/dist/smtp-user.vo.d.ts.map +1 -1
- package/dist/smtp-user.vo.js +4 -8
- package/dist/smtp-user.vo.js.map +1 -1
- package/dist/time-zone-offset.middleware.d.ts.map +1 -1
- package/dist/time-zone-offset.middleware.js +3 -2
- package/dist/time-zone-offset.middleware.js.map +1 -1
- package/dist/timekeeper-google.adapter.d.ts +2 -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/tsconfig.tsbuildinfo +1 -1
- package/dist/uuid.vo.d.ts +3 -3
- package/dist/uuid.vo.d.ts.map +1 -1
- package/dist/uuid.vo.js +2 -2
- package/dist/uuid.vo.js.map +1 -1
- package/dist/woodchopper-dispatcher-async.strategy.d.ts.map +1 -1
- package/dist/woodchopper-dispatcher-async.strategy.js +3 -2
- package/dist/woodchopper-dispatcher-async.strategy.js.map +1 -1
- package/dist/woodchopper.d.ts.map +1 -1
- package/dist/woodchopper.js +8 -7
- package/dist/woodchopper.js.map +1 -1
- package/package.json +8 -9
- package/readme.md +1 -2
- package/src/ab-variant-selector.service.ts +3 -2
- package/src/ab-variant-weight.vo.ts +10 -9
- package/src/basic-auth-password.vo.ts +9 -9
- package/src/basic-auth-username.vo.ts +9 -9
- package/src/binary.vo.ts +10 -17
- package/src/client-ip.vo.ts +8 -5
- package/src/client-user-agent.vo.ts +8 -8
- package/src/client.vo.ts +7 -3
- package/src/commit-sha-value.vo.ts +8 -8
- package/src/commit-sha.vo.ts +2 -1
- package/src/correlation-id.vo.ts +2 -2
- package/src/correlation.middleware.ts +3 -2
- package/src/encryption-key-value.vo.ts +8 -8
- package/src/encryption-key.vo.ts +2 -1
- package/src/environment-loader-encrypted.adapter.ts +10 -5
- package/src/environment-loader-noop.adapter.ts +10 -8
- package/src/environment-loader-process-safe.adapter.ts +14 -9
- package/src/environment-loader-process.adapter.ts +10 -5
- package/src/environment-loader.port.ts +5 -2
- package/src/event-envelope.ts +3 -3
- package/src/event-store-with-logger.adapter.ts +1 -0
- package/src/event-stream.vo.ts +7 -6
- package/src/event-validator-registry.adapter.ts +44 -0
- package/src/event-validator-registry.port.ts +2 -0
- package/src/file-draft-zip.service.ts +2 -1
- package/src/hash-bucket.vo.ts +2 -1
- package/src/hash-value.vo.ts +8 -8
- package/src/hash.vo.ts +2 -1
- package/src/hcaptcha-secret-key.vo.ts +8 -8
- package/src/hcaptcha-site-key.vo.ts +8 -8
- package/src/healthcheck.handler.ts +8 -7
- package/src/http-logger.middleware.ts +1 -1
- package/src/i18n.service.ts +2 -1
- package/src/image-info-noop.adapter.ts +3 -2
- package/src/image-info-sharp.adapter.ts +4 -3
- package/src/in-flight-requests-tracker.service.ts +3 -2
- package/src/index.ts +1 -2
- package/src/logger.port.ts +1 -3
- package/src/mailer-content-html.vo.ts +9 -9
- package/src/mailer-subject.vo.ts +9 -9
- package/src/modules/history/event-handlers/onHistoryPopulatedEvent.ts +2 -1
- package/src/modules/history/events/HISTORY_CLEARED_EVENT.ts +5 -5
- package/src/modules/history/events/HISTORY_POPULATED_EVENT.ts +5 -5
- package/src/modules/history/value-objects/history-created-at.ts +2 -2
- package/src/modules/history/value-objects/history-operation.ts +6 -5
- package/src/modules/history/value-objects/history-payload.ts +15 -9
- package/src/modules/history/value-objects/history-subject.ts +7 -6
- package/src/modules/history/value-objects/history.ts +5 -5
- package/src/modules/preferences/command-handlers/handleSetUserLanguageCommand.ts +2 -1
- package/src/modules/preferences/commands/SET_USER_LANGUAGE_COMMAND.ts +5 -5
- package/src/modules/preferences/events/USER_LANGUAGE_SET_EVENT.ts +5 -5
- package/src/modules/system/events/HOUR_HAS_PASSED_EVENT.ts +5 -5
- package/src/modules/system/events/MINUTE_HAS_PASSED_EVENT.ts +5 -5
- package/src/modules/system/events/SECURITY_VIOLATION_DETECTED_EVENT.ts +8 -8
- package/src/modules/system/services/passage-of-time-hourly.service.ts +2 -1
- package/src/modules/system/services/passage-of-time-minute.service.ts +2 -1
- package/src/node-env.vo.ts +0 -6
- package/src/nonce-provider-crypto.adapter.ts +2 -1
- package/src/nonce-provider-noop.adapter.ts +2 -1
- package/src/nonce-value.vo.ts +8 -8
- package/src/port.vo.ts +12 -10
- package/src/prerequisite-verifier-outside-connectivity.adapter.ts +2 -1
- package/src/recaptcha-secret-key.vo.ts +8 -8
- package/src/recaptcha-site-key.vo.ts +8 -8
- package/src/redactor-error-cause-depth-limit.strategy.ts +3 -2
- package/src/redactor-metadata-compact-array.strategy.ts +2 -1
- package/src/redactor-metadata-compact-object.strategy.ts +2 -1
- package/src/remote-file-storage-disk.adapter.ts +2 -1
- package/src/retry-backoff-exponential.strategy.ts +2 -1
- package/src/retry-backoff-fibonacci.strategy.ts +2 -1
- package/src/retry-backoff-linear.strategy.ts +2 -1
- package/src/retry.service.ts +2 -1
- package/src/security-countermeasure-ban.strategy.ts +3 -2
- package/src/security-countermeasure-mirage.strategy.ts +2 -1
- package/src/security-countermeasure-name.vo.ts +8 -12
- package/src/security-countermeasure-noop.strategy.ts +2 -1
- package/src/security-countermeasure-report.strategy.ts +2 -1
- package/src/security-countermeasure-tarpit.strategy.ts +2 -1
- package/src/security-rule-and.strategy.ts +2 -1
- package/src/security-rule-bait-routes.strategy.ts +2 -1
- package/src/security-rule-fail.strategy.ts +2 -1
- package/src/security-rule-honey-pot-field.strategy.ts +2 -1
- package/src/security-rule-name.vo.ts +9 -13
- package/src/security-rule-or.strategy.ts +2 -1
- package/src/security-rule-pass.strategy.ts +2 -1
- package/src/security-rule-user-agent.strategy.ts +2 -1
- package/src/security-rule-violation-threshold.strategy.ts +3 -2
- package/src/shield-body-limit.strategy.ts +3 -2
- package/src/shield-recaptcha.strategy.ts +3 -1
- package/src/smtp-host.vo.ts +9 -9
- package/src/smtp-pass.vo.ts +9 -9
- package/src/smtp-port.vo.ts +2 -2
- package/src/smtp-user.vo.ts +9 -9
- package/src/time-zone-offset.middleware.ts +3 -2
- package/src/timekeeper-google.adapter.ts +2 -1
- package/src/uuid.vo.ts +3 -3
- package/src/woodchopper-dispatcher-async.strategy.ts +3 -2
- package/src/woodchopper.ts +8 -7
- package/dist/environment-schema.port.d.ts +0 -4
- package/dist/environment-schema.port.d.ts.map +0 -1
- package/dist/environment-schema.port.js +0 -2
- package/dist/environment-schema.port.js.map +0 -1
- package/dist/event-validator-registry-zod.adapter.d.ts +0 -24
- package/dist/event-validator-registry-zod.adapter.d.ts.map +0 -1
- package/dist/event-validator-registry-zod.adapter.js +0 -25
- package/dist/event-validator-registry-zod.adapter.js.map +0 -1
- package/src/environment-schema.port.ts +0 -3
- package/src/event-validator-registry-zod.adapter.ts +0 -47
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
EnvironmentLoaderConfig,
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import {
|
|
2
|
+
type EnvironmentLoaderConfig,
|
|
3
|
+
EnvironmentLoaderError,
|
|
4
|
+
type EnvironmentLoaderPort,
|
|
5
|
+
type EnvironmentResultType,
|
|
5
6
|
} from "./environment-loader.port";
|
|
6
7
|
|
|
7
8
|
export class EnvironmentLoaderProcessAdapter<T extends object> implements EnvironmentLoaderPort<T> {
|
|
@@ -11,6 +12,10 @@ export class EnvironmentLoaderProcessAdapter<T extends object> implements Enviro
|
|
|
11
12
|
) {}
|
|
12
13
|
|
|
13
14
|
async load(): Promise<Readonly<EnvironmentResultType<T>>> {
|
|
14
|
-
|
|
15
|
+
const result = this.config.EnvironmentSchema["~standard"].validate(this.env);
|
|
16
|
+
if (result instanceof Promise) throw new Error(EnvironmentLoaderError.NoAsyncSchema);
|
|
17
|
+
// Stryker disable next-line OptionalChaining
|
|
18
|
+
if (result.issues) throw new Error(result.issues[0]?.message);
|
|
19
|
+
return Object.freeze({ ...result.value, type: this.config.type });
|
|
15
20
|
}
|
|
16
21
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { StandardSchemaV1 } from "@standard-schema/spec";
|
|
1
2
|
import type { NodeEnvironmentEnum } from "../src/node-env.vo";
|
|
2
|
-
|
|
3
|
+
|
|
4
|
+
export const EnvironmentLoaderError = { NoAsyncSchema: "environment.loader.no.async.schema" };
|
|
3
5
|
|
|
4
6
|
export type EnvironmentLoaderConfig<T extends object> = {
|
|
5
7
|
type: NodeEnvironmentEnum;
|
|
6
|
-
EnvironmentSchema:
|
|
8
|
+
EnvironmentSchema: StandardSchemaV1<unknown, T>;
|
|
7
9
|
};
|
|
10
|
+
|
|
8
11
|
export type EnvironmentResultType<T extends object> = T & { type: NodeEnvironmentEnum };
|
|
9
12
|
|
|
10
13
|
export interface EnvironmentLoaderPort<T extends object> {
|
package/src/event-envelope.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
-
import * as
|
|
2
|
+
import * as v from "valibot";
|
|
3
3
|
import type { ClockPort } from "./clock.port";
|
|
4
4
|
import { CorrelationStorage } from "./correlation-storage.service";
|
|
5
5
|
import { EventStream, type EventStreamType } from "./event-stream.vo";
|
|
@@ -13,8 +13,8 @@ export const EventEnvelopeSchema = {
|
|
|
13
13
|
correlationId: UUID,
|
|
14
14
|
createdAt: tools.TimestampValue,
|
|
15
15
|
stream: EventStream,
|
|
16
|
-
version:
|
|
17
|
-
revision: tools.RevisionValue
|
|
16
|
+
version: v.literal(1),
|
|
17
|
+
revision: v.optional(tools.RevisionValue),
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export const createEventEnvelope = (stream: EventStreamType, deps: Dependencies) =>
|
|
@@ -40,6 +40,7 @@ export class EventStoreWithLoggerAdapter<Event extends GenericEvent> implements
|
|
|
40
40
|
component: "infra",
|
|
41
41
|
operation: "event_store_save",
|
|
42
42
|
correlationId: CorrelationStorage.get(),
|
|
43
|
+
// Stryker disable next-line OptionalChaining
|
|
43
44
|
metadata: { stream: events[0]?.stream, names: events.map((event) => event.name), count: events.length },
|
|
44
45
|
});
|
|
45
46
|
|
package/src/event-stream.vo.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as v from "valibot";
|
|
2
2
|
|
|
3
3
|
export const EventStreamError = {
|
|
4
4
|
Type: "event.store.type",
|
|
@@ -6,9 +6,10 @@ export const EventStreamError = {
|
|
|
6
6
|
TooLong: "event.stream.too.long",
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
export const EventStream =
|
|
10
|
-
.string(EventStreamError.Type)
|
|
11
|
-
.
|
|
12
|
-
.
|
|
9
|
+
export const EventStream = v.pipe(
|
|
10
|
+
v.string(EventStreamError.Type),
|
|
11
|
+
v.minLength(1, EventStreamError.Empty),
|
|
12
|
+
v.maxLength(256, EventStreamError.TooLong),
|
|
13
|
+
);
|
|
13
14
|
|
|
14
|
-
export type EventStreamType =
|
|
15
|
+
export type EventStreamType = v.InferOutput<typeof EventStream>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { StandardSchemaV1 } from "@standard-schema/spec";
|
|
2
|
+
import type { GenericEvent } from "./event.types";
|
|
3
|
+
import {
|
|
4
|
+
EventValidatorRegistryError,
|
|
5
|
+
type EventValidatorRegistryPort,
|
|
6
|
+
} from "./event-validator-registry.port";
|
|
7
|
+
|
|
8
|
+
export type GenericEventSchemaRegistry<Event> = Readonly<
|
|
9
|
+
Record<GenericEvent["name"], StandardSchemaV1<unknown, Event>>
|
|
10
|
+
>;
|
|
11
|
+
|
|
12
|
+
const EventValidatorRegistryAdapterError = {
|
|
13
|
+
MissingName: "event.validator.registry.adapter.error.missing.name",
|
|
14
|
+
UnknownEvent: "event.validator.registry.adapter.error.unknown.event",
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export class EventValidatorRegistryAdapter<Event> implements EventValidatorRegistryPort<Event> {
|
|
18
|
+
private readonly map: Map<GenericEvent["name"], StandardSchemaV1<unknown, Event>>;
|
|
19
|
+
readonly names: ReadonlyArray<GenericEvent["name"]>;
|
|
20
|
+
|
|
21
|
+
constructor(registry: GenericEventSchemaRegistry<Event>) {
|
|
22
|
+
this.map = new Map(Object.entries(registry));
|
|
23
|
+
this.names = Object.keys(registry);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
accepts(name: GenericEvent["name"]): boolean {
|
|
27
|
+
return this.map.has(name);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
validate(raw: unknown): Event {
|
|
31
|
+
const name = (raw as { name?: GenericEvent["name"] }).name;
|
|
32
|
+
if (!name) throw new Error(EventValidatorRegistryAdapterError.MissingName);
|
|
33
|
+
|
|
34
|
+
const schema = this.map.get(name);
|
|
35
|
+
if (!schema) throw new Error(EventValidatorRegistryAdapterError.UnknownEvent);
|
|
36
|
+
|
|
37
|
+
const result = schema["~standard"].validate(raw);
|
|
38
|
+
|
|
39
|
+
if (result instanceof Promise) throw new Error(EventValidatorRegistryError.NoAsyncSchema);
|
|
40
|
+
// Stryker disable next-line OptionalChaining
|
|
41
|
+
if (result.issues) throw new Error(result.issues[0]?.message);
|
|
42
|
+
return result.value;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { GenericEvent } from "./event.types";
|
|
2
2
|
|
|
3
|
+
export const EventValidatorRegistryError = { NoAsyncSchema: "event.validator.registry.no.async.schema" };
|
|
4
|
+
|
|
3
5
|
export interface EventValidatorRegistryPort<Event> {
|
|
4
6
|
readonly names: ReadonlyArray<GenericEvent["name"]>;
|
|
5
7
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Readable } from "node:stream";
|
|
2
2
|
import * as tools from "@bgord/tools";
|
|
3
|
+
import * as v from "valibot";
|
|
3
4
|
import { DynamicImport } from "./dynamic-import.service";
|
|
4
5
|
import { FileDraft } from "./file-draft.service";
|
|
5
6
|
|
|
@@ -20,7 +21,7 @@ export class FileDraftZip extends FileDraft {
|
|
|
20
21
|
private readonly parts: ReadonlyArray<FileDraft>,
|
|
21
22
|
private readonly yazl: YazlLibrary,
|
|
22
23
|
) {
|
|
23
|
-
super(basename, tools.Extension
|
|
24
|
+
super(basename, v.parse(tools.Extension, "zip"), tools.Mimes.zip.mime);
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
static async build(basename: tools.BasenameType, parts: ReadonlyArray<FileDraft>): Promise<FileDraftZip> {
|
package/src/hash-bucket.vo.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
+
import * as v from "valibot";
|
|
2
3
|
import type { Hash } from "./hash.vo";
|
|
3
4
|
|
|
4
5
|
export class HashBucket {
|
|
@@ -10,7 +11,7 @@ export class HashBucket {
|
|
|
10
11
|
|
|
11
12
|
const bucket = integer % 100;
|
|
12
13
|
|
|
13
|
-
return new HashBucket(tools.IntegerNonNegative
|
|
14
|
+
return new HashBucket(v.parse(tools.IntegerNonNegative, bucket));
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
isLessThan(threshold: tools.IntegerNonNegativeType): boolean {
|
package/src/hash-value.vo.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as v from "valibot";
|
|
2
2
|
|
|
3
3
|
export const HashValueError = { Type: "hash.value.type", InvalidHex: "hash.value.invalid.hex" } as const;
|
|
4
4
|
|
|
5
5
|
// 64 hex chars allowed
|
|
6
6
|
const CHARS_WHITELIST = /^[a-fA-F0-9]{64}$/;
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
.
|
|
13
|
-
|
|
8
|
+
export const HashValue = v.pipe(
|
|
9
|
+
v.string(HashValueError.Type),
|
|
10
|
+
v.regex(CHARS_WHITELIST, HashValueError.InvalidHex),
|
|
11
|
+
// Stryker disable next-line StringLiteral
|
|
12
|
+
v.brand("HashValue"),
|
|
13
|
+
);
|
|
14
14
|
|
|
15
|
-
export type HashValueType =
|
|
15
|
+
export type HashValueType = v.InferOutput<typeof HashValue>;
|
package/src/hash.vo.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
1
2
|
import { HashValue, type HashValueType } from "./hash-value.vo";
|
|
2
3
|
|
|
3
4
|
export class Hash {
|
|
@@ -12,7 +13,7 @@ export class Hash {
|
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
static fromString(candidate: string): Hash {
|
|
15
|
-
return new Hash(
|
|
16
|
+
return new Hash(v.parse(HashValue, candidate));
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
get(): HashValueType {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as v from "valibot";
|
|
2
2
|
|
|
3
3
|
export const HCaptchaSecretKeyError = {
|
|
4
4
|
Type: "hcaptcha.secret.key.type",
|
|
5
5
|
Length: "hcaptcha.secret.key.length",
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
.
|
|
13
|
-
|
|
8
|
+
export const HCaptchaSecretKey = v.pipe(
|
|
9
|
+
v.string(HCaptchaSecretKeyError.Type),
|
|
10
|
+
v.length(35, HCaptchaSecretKeyError.Length),
|
|
11
|
+
// Stryker disable next-line StringLiteral
|
|
12
|
+
v.brand("HCaptchaSecretKey"),
|
|
13
|
+
);
|
|
14
14
|
|
|
15
|
-
export type HCaptchaSecretKeyType =
|
|
15
|
+
export type HCaptchaSecretKeyType = v.InferOutput<typeof HCaptchaSecretKey>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as v from "valibot";
|
|
2
2
|
|
|
3
3
|
export const HCaptchaSiteKeyError = { Type: "hcaptcha.site.key.type", Length: "hcaptcha.site.key.length" };
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
.
|
|
10
|
-
|
|
5
|
+
export const HCaptchaSiteKey = v.pipe(
|
|
6
|
+
v.string(HCaptchaSiteKeyError.Type),
|
|
7
|
+
v.length(36, HCaptchaSiteKeyError.Length),
|
|
8
|
+
// Stryker disable next-line StringLiteral
|
|
9
|
+
v.brand("HCaptchaSiteKey"),
|
|
10
|
+
);
|
|
11
11
|
|
|
12
|
-
export type HCaptchaSiteKeyType =
|
|
12
|
+
export type HCaptchaSiteKeyType = v.InferOutput<typeof HCaptchaSiteKey>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import os from "node:os";
|
|
2
2
|
import * as tools from "@bgord/tools";
|
|
3
|
+
import * as v from "valibot";
|
|
3
4
|
import type { BuildInfoRepositoryStrategy } from "./build-info-repository.strategy";
|
|
4
5
|
import type { ClockPort } from "./clock.port";
|
|
5
6
|
import type { CommitShaValueType } from "./commit-sha-value.vo";
|
|
@@ -48,7 +49,7 @@ export type HealthcheckResult = {
|
|
|
48
49
|
hostname: ReturnType<typeof os.hostname>;
|
|
49
50
|
cpus: tools.IntegerNonNegativeType;
|
|
50
51
|
startup: tools.TimestampValueType;
|
|
51
|
-
uptime: Omit<UptimeResultType, "duration"> & {
|
|
52
|
+
uptime: Omit<UptimeResultType, "duration"> & { ms: tools.DurationMsType };
|
|
52
53
|
memory: {
|
|
53
54
|
total: { bytes: tools.Size["bytes"]; formatted: ReturnType<tools.Size["format"]> };
|
|
54
55
|
heap: {
|
|
@@ -65,10 +66,10 @@ export type HealthcheckResult = {
|
|
|
65
66
|
details: ReadonlyArray<{
|
|
66
67
|
label: PrerequisiteLabelType;
|
|
67
68
|
outcome: PrerequisiteVerificationResult;
|
|
68
|
-
|
|
69
|
+
ms: tools.DurationMsType;
|
|
69
70
|
}>;
|
|
70
71
|
logger?: LoggerStatsSnapshot;
|
|
71
|
-
|
|
72
|
+
ms: tools.Duration["ms"];
|
|
72
73
|
timestamp: tools.TimestampValueType;
|
|
73
74
|
};
|
|
74
75
|
|
|
@@ -94,7 +95,7 @@ export class HealthcheckHandler {
|
|
|
94
95
|
return {
|
|
95
96
|
label: prerequisite.label,
|
|
96
97
|
outcome: this.config.redactor ? this.config.redactor.redact(outcome) : outcome,
|
|
97
|
-
|
|
98
|
+
ms: stopwatch.stop().ms,
|
|
98
99
|
};
|
|
99
100
|
}),
|
|
100
101
|
);
|
|
@@ -120,9 +121,9 @@ export class HealthcheckHandler {
|
|
|
120
121
|
server: {
|
|
121
122
|
pid: process.pid,
|
|
122
123
|
hostname: os.hostname(),
|
|
123
|
-
cpus: tools.IntegerNonNegative
|
|
124
|
+
cpus: v.parse(tools.IntegerNonNegative, os.cpus().length),
|
|
124
125
|
startup: this.deps.Clock.now().subtract(uptime.duration).ms,
|
|
125
|
-
uptime: {
|
|
126
|
+
uptime: { ms: uptime.duration.ms, formatted: uptime.formatted },
|
|
126
127
|
memory: {
|
|
127
128
|
total: { bytes: memory.total.toBytes(), formatted: memory.total.format(tools.Size.unit.MB) },
|
|
128
129
|
heap: {
|
|
@@ -143,7 +144,7 @@ export class HealthcheckHandler {
|
|
|
143
144
|
inFlight: InFlightRequestsTracker.get(),
|
|
144
145
|
},
|
|
145
146
|
logger: this.deps.LoggerStatsProvider?.getStats(),
|
|
146
|
-
|
|
147
|
+
ms: stopwatch.stop().ms,
|
|
147
148
|
timestamp: this.deps.Clock.now().ms,
|
|
148
149
|
};
|
|
149
150
|
}
|
|
@@ -90,7 +90,7 @@ export class HttpLoggerMiddleware {
|
|
|
90
90
|
method: context.request.method,
|
|
91
91
|
url: context.request.url(),
|
|
92
92
|
status: input.status,
|
|
93
|
-
|
|
93
|
+
ms: duration.ms,
|
|
94
94
|
client,
|
|
95
95
|
cacheHit: input.cacheHit,
|
|
96
96
|
metadata: { response: input.responseBody },
|
package/src/i18n.service.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
+
import * as v from "valibot";
|
|
2
3
|
import type { FileReaderJsonPort } from "../src/file-reader-json.port";
|
|
3
4
|
import type { LoggerPort } from "../src/logger.port";
|
|
4
5
|
|
|
@@ -12,7 +13,7 @@ export type TranslationVariableType = Record<TranslationPlaceholderType, Transla
|
|
|
12
13
|
type Dependencies = { FileReaderJson: FileReaderJsonPort; Logger: LoggerPort };
|
|
13
14
|
|
|
14
15
|
export class I18n {
|
|
15
|
-
static DEFAULT_TRANSLATIONS_PATH = tools.DirectoryPathRelativeSchema
|
|
16
|
+
static DEFAULT_TRANSLATIONS_PATH = v.parse(tools.DirectoryPathRelativeSchema, "infra/translations");
|
|
16
17
|
|
|
17
18
|
constructor(
|
|
18
19
|
private readonly deps: Dependencies,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
+
import * as v from "valibot";
|
|
2
3
|
import type { ImageInfoPort, ImageInfoType } from "./image-info.port";
|
|
3
4
|
|
|
4
5
|
export class ImageInfoNoopAdapter implements ImageInfoPort {
|
|
@@ -6,8 +7,8 @@ export class ImageInfoNoopAdapter implements ImageInfoPort {
|
|
|
6
7
|
|
|
7
8
|
async inspect(_input: tools.FilePathRelative | tools.FilePathAbsolute): Promise<ImageInfoType> {
|
|
8
9
|
return {
|
|
9
|
-
width: tools.ImageWidth
|
|
10
|
-
height: tools.ImageHeight
|
|
10
|
+
width: v.parse(tools.ImageWidth, 400),
|
|
11
|
+
height: v.parse(tools.ImageHeight, 400),
|
|
11
12
|
mime: this.mime,
|
|
12
13
|
size: tools.Size.fromBytes(0),
|
|
13
14
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
2
|
import type sharp from "sharp";
|
|
3
|
+
import * as v from "valibot";
|
|
3
4
|
import { DynamicImport } from "./dynamic-import.service";
|
|
4
5
|
import type { FileInspectionPort } from "./file-inspection.port";
|
|
5
6
|
import type { ImageInfoPort, ImageInfoType } from "./image-info.port";
|
|
@@ -36,9 +37,9 @@ export class ImageInfoSharpAdapter implements ImageInfoPort {
|
|
|
36
37
|
|
|
37
38
|
const metadata = await pipeline.metadata();
|
|
38
39
|
|
|
39
|
-
const width = tools.ImageWidth
|
|
40
|
-
const height = tools.ImageHeight
|
|
41
|
-
const extension = tools.Extension
|
|
40
|
+
const width = v.parse(tools.ImageWidth, metadata.width);
|
|
41
|
+
const height = v.parse(tools.ImageHeight, metadata.height);
|
|
42
|
+
const extension = v.parse(tools.Extension, metadata.format);
|
|
42
43
|
const mime = this.deps.MimeRegistry.fromExtension(extension);
|
|
43
44
|
|
|
44
45
|
if (!mime) throw new Error(tools.MimeRegistryError.MimeNotFound);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
+
import * as v from "valibot";
|
|
2
3
|
|
|
3
4
|
export class InFlightRequestsTracker {
|
|
4
|
-
private static count: tools.IntegerType = tools.Integer
|
|
5
|
+
private static count: tools.IntegerType = v.parse(tools.Integer, 0);
|
|
5
6
|
|
|
6
7
|
static increment(): void {
|
|
7
8
|
InFlightRequestsTracker.count++;
|
|
@@ -17,6 +18,6 @@ export class InFlightRequestsTracker {
|
|
|
17
18
|
|
|
18
19
|
/** @internal */
|
|
19
20
|
static _resetForTest(): void {
|
|
20
|
-
InFlightRequestsTracker.count = tools.Integer
|
|
21
|
+
InFlightRequestsTracker.count = v.parse(tools.Integer, 0);
|
|
21
22
|
}
|
|
22
23
|
}
|
package/src/index.ts
CHANGED
|
@@ -78,7 +78,6 @@ export * from "./environment-loader-encrypted.adapter";
|
|
|
78
78
|
export * from "./environment-loader-noop.adapter";
|
|
79
79
|
export * from "./environment-loader-process.adapter";
|
|
80
80
|
export * from "./environment-loader-process-safe.adapter";
|
|
81
|
-
export * from "./environment-schema.port";
|
|
82
81
|
export * from "./error-normalizer.service";
|
|
83
82
|
export * from "./etag-extractor.middleware";
|
|
84
83
|
export * from "./etag-extractor-hono.middleware";
|
|
@@ -103,8 +102,8 @@ export * from "./event-store-dispatching.adapter";
|
|
|
103
102
|
export * from "./event-store-noop.adapter";
|
|
104
103
|
export * from "./event-store-with-logger.adapter";
|
|
105
104
|
export * from "./event-stream.vo";
|
|
105
|
+
export * from "./event-validator-registry.adapter";
|
|
106
106
|
export * from "./event-validator-registry.port";
|
|
107
|
-
export * from "./event-validator-registry-zod.adapter";
|
|
108
107
|
export * from "./file-cleaner.adapter";
|
|
109
108
|
export * from "./file-cleaner.port";
|
|
110
109
|
export * from "./file-cleaner-forgiving.adapter";
|
package/src/logger.port.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type * as tools from "@bgord/tools";
|
|
2
|
-
import * as z from "zod/v4";
|
|
3
2
|
import type { CorrelationIdType } from "./correlation-id.vo";
|
|
4
3
|
import type { NormalizedError } from "./error-normalizer.service";
|
|
5
4
|
import type { NodeEnvironmentEnum } from "./node-env.vo";
|
|
@@ -15,7 +14,6 @@ export enum LogLevelEnum {
|
|
|
15
14
|
debug = "debug",
|
|
16
15
|
silly = "silly",
|
|
17
16
|
}
|
|
18
|
-
export const LogLevel = z.enum(LogLevelEnum);
|
|
19
17
|
|
|
20
18
|
export type LogCoreType = {
|
|
21
19
|
timestamp: string;
|
|
@@ -36,7 +34,7 @@ export type LogHttpType = LogCoreType & {
|
|
|
36
34
|
method: string;
|
|
37
35
|
url: string;
|
|
38
36
|
status?: number;
|
|
39
|
-
|
|
37
|
+
ms?: tools.DurationMsType;
|
|
40
38
|
client: HttpClientInfo;
|
|
41
39
|
cacheHit?: boolean;
|
|
42
40
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as v from "valibot";
|
|
2
2
|
|
|
3
3
|
export const MailerContentHtmlError = { Invalid: "mailer.content.html.invalid" };
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
.
|
|
9
|
-
|
|
10
|
-
.
|
|
11
|
-
|
|
12
|
-
export type MailerContentHtmlType = z.infer<typeof MailerContentHtml>;
|
|
5
|
+
export const MailerContentHtml = v.pipe(
|
|
6
|
+
v.string(MailerContentHtmlError.Invalid),
|
|
7
|
+
v.minLength(1, MailerContentHtmlError.Invalid),
|
|
8
|
+
v.maxLength(10_000, MailerContentHtmlError.Invalid),
|
|
9
|
+
// Stryker disable next-line StringLiteral
|
|
10
|
+
v.brand("MailerContentHtml"),
|
|
11
|
+
);
|
|
13
12
|
|
|
13
|
+
export type MailerContentHtmlType = v.InferOutput<typeof MailerContentHtml>;
|
|
14
14
|
export type EmailAttachmentType = { filename: string; path: string };
|
package/src/mailer-subject.vo.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as v from "valibot";
|
|
2
2
|
|
|
3
3
|
export const MailerSubjectError = { Invalid: "mailer.subject.invalid" };
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
.
|
|
9
|
-
|
|
10
|
-
.
|
|
11
|
-
|
|
5
|
+
export const MailerSubject = v.pipe(
|
|
6
|
+
v.string(MailerSubjectError.Invalid),
|
|
7
|
+
v.minLength(1, MailerSubjectError.Invalid),
|
|
8
|
+
v.maxLength(128, MailerSubjectError.Invalid),
|
|
9
|
+
// Stryker disable next-line StringLiteral
|
|
10
|
+
v.brand("MailerSubject"),
|
|
11
|
+
);
|
|
12
12
|
|
|
13
|
-
export type MailerSubjectType =
|
|
13
|
+
export type MailerSubjectType = v.InferOutput<typeof MailerSubject>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
1
2
|
import type * as Events from "../events";
|
|
2
3
|
import type * as Ports from "../ports";
|
|
3
4
|
import * as VO from "../value-objects";
|
|
4
5
|
|
|
5
6
|
export const onHistoryPopulatedEvent =
|
|
6
7
|
(projection: Ports.HistoryProjectionPort) => async (event: Events.HistoryPopulatedEventType) => {
|
|
7
|
-
const data = VO.HistoryParsed
|
|
8
|
+
const data = v.parse(VO.HistoryParsed, { ...event.payload, createdAt: event.createdAt });
|
|
8
9
|
|
|
9
10
|
await projection.append(data);
|
|
10
11
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as v from "valibot";
|
|
2
2
|
import { EventEnvelopeSchema } from "../../../event-envelope";
|
|
3
3
|
import * as VO from "../value-objects";
|
|
4
4
|
|
|
5
5
|
export const HISTORY_CLEARED_EVENT = "HISTORY_CLEARED_EVENT";
|
|
6
6
|
|
|
7
|
-
export const HistoryClearedEvent =
|
|
7
|
+
export const HistoryClearedEvent = v.object({
|
|
8
8
|
...EventEnvelopeSchema,
|
|
9
|
-
name:
|
|
10
|
-
payload:
|
|
9
|
+
name: v.literal(HISTORY_CLEARED_EVENT),
|
|
10
|
+
payload: v.object({ subject: VO.HistorySubject }),
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
-
export type HistoryClearedEventType =
|
|
13
|
+
export type HistoryClearedEventType = v.InferOutput<typeof HistoryClearedEvent>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as v from "valibot";
|
|
2
2
|
import { EventEnvelopeSchema } from "../../../event-envelope";
|
|
3
3
|
import * as VO from "../value-objects";
|
|
4
4
|
|
|
5
5
|
export const HISTORY_POPULATED_EVENT = "HISTORY_POPULATED_EVENT";
|
|
6
6
|
|
|
7
|
-
export const HistoryPopulatedEvent =
|
|
7
|
+
export const HistoryPopulatedEvent = v.object({
|
|
8
8
|
...EventEnvelopeSchema,
|
|
9
|
-
name:
|
|
10
|
-
payload:
|
|
9
|
+
name: v.literal(HISTORY_POPULATED_EVENT),
|
|
10
|
+
payload: v.object({
|
|
11
11
|
id: VO.HistoryId,
|
|
12
12
|
operation: VO.HistoryOperation,
|
|
13
13
|
subject: VO.HistorySubject,
|
|
14
14
|
payload: VO.HistoryPayload,
|
|
15
15
|
}),
|
|
16
16
|
});
|
|
17
|
-
export type HistoryPopulatedEventType =
|
|
17
|
+
export type HistoryPopulatedEventType = v.InferOutput<typeof HistoryPopulatedEvent>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
-
import type * as
|
|
2
|
+
import type * as v from "valibot";
|
|
3
3
|
|
|
4
4
|
export const HistoryCreatedAt = tools.TimestampValue;
|
|
5
5
|
|
|
6
|
-
export type HistoryCreatedAtType =
|
|
6
|
+
export type HistoryCreatedAtType = v.InferOutput<typeof HistoryCreatedAt>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as v from "valibot";
|
|
2
2
|
|
|
3
3
|
export const HistoryOperationError = {
|
|
4
4
|
Type: "history.operation.type",
|
|
@@ -6,7 +6,8 @@ export const HistoryOperationError = {
|
|
|
6
6
|
TooLong: "history.operation.too.long",
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
export const HistoryOperation =
|
|
10
|
-
.string(HistoryOperationError.Type)
|
|
11
|
-
.
|
|
12
|
-
.
|
|
9
|
+
export const HistoryOperation = v.pipe(
|
|
10
|
+
v.string(HistoryOperationError.Type),
|
|
11
|
+
v.minLength(1, HistoryOperationError.Empty),
|
|
12
|
+
v.maxLength(128, HistoryOperationError.TooLong),
|
|
13
|
+
);
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as v from "valibot";
|
|
2
2
|
|
|
3
|
-
export const HistoryPayload =
|
|
3
|
+
export const HistoryPayload = v.record(v.string(), v.unknown());
|
|
4
4
|
|
|
5
5
|
export const HistoryPayloadParsedError = {
|
|
6
6
|
NotSerializable: "history.payload.parsed.not.serializable",
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
// Stryker disable BlockStatement
|
|
10
|
+
export const HistoryPayloadParsed = v.pipe(
|
|
11
|
+
HistoryPayload,
|
|
12
|
+
v.check((value) => {
|
|
13
|
+
try {
|
|
14
|
+
JSON.stringify(value);
|
|
15
|
+
return true;
|
|
16
|
+
} catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}, HistoryPayloadParsedError.NotSerializable),
|
|
20
|
+
v.transform((value) => JSON.stringify(value)),
|
|
21
|
+
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as v from "valibot";
|
|
2
2
|
|
|
3
3
|
export const HistorySubjectError = {
|
|
4
4
|
Type: "history.subject.type",
|
|
@@ -6,9 +6,10 @@ export const HistorySubjectError = {
|
|
|
6
6
|
TooLong: "history.subject.too.long",
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
export const HistorySubject =
|
|
10
|
-
.string(HistorySubjectError.Type)
|
|
11
|
-
.
|
|
12
|
-
.
|
|
9
|
+
export const HistorySubject = v.pipe(
|
|
10
|
+
v.string(HistorySubjectError.Type),
|
|
11
|
+
v.minLength(1, HistorySubjectError.Empty),
|
|
12
|
+
v.maxLength(128, HistorySubjectError.TooLong),
|
|
13
|
+
);
|
|
13
14
|
|
|
14
|
-
export type HistorySubjectType =
|
|
15
|
+
export type HistorySubjectType = v.InferOutput<typeof HistorySubject>;
|