@bgord/bun 1.14.7 → 1.15.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/ab-variant-selector.service.js +2 -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.js +1 -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 +4 -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 +2 -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.js +2 -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 +1 -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 +1 -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 +1 -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 +2 -2
- package/dist/woodchopper-dispatcher-async.strategy.js.map +1 -1
- package/dist/woodchopper.js +7 -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 +2 -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 +1 -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 +7 -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 +2 -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 +2 -2
- package/src/redactor-metadata-compact-array.strategy.ts +1 -1
- package/src/redactor-metadata-compact-object.strategy.ts +1 -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 +1 -2
- 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 +2 -2
- package/src/woodchopper.ts +7 -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,14 +1,14 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
-
import * as
|
|
2
|
+
import * as v from "valibot";
|
|
3
3
|
import { CommandEnvelopeSchema } from "../../../command-envelope";
|
|
4
4
|
import { UUID } from "../../../uuid.vo";
|
|
5
5
|
|
|
6
6
|
export const SET_USER_LANGUAGE_COMMAND = "SET_USER_LANGUAGE_COMMAND";
|
|
7
7
|
|
|
8
|
-
export const SetUserLanguageCommand =
|
|
8
|
+
export const SetUserLanguageCommand = v.object({
|
|
9
9
|
...CommandEnvelopeSchema,
|
|
10
|
-
name:
|
|
11
|
-
payload:
|
|
10
|
+
name: v.literal(SET_USER_LANGUAGE_COMMAND),
|
|
11
|
+
payload: v.object({ language: tools.Language, userId: UUID }),
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
-
export type SetUserLanguageCommandType =
|
|
14
|
+
export type SetUserLanguageCommandType = v.InferOutput<typeof SetUserLanguageCommand>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
-
import * as
|
|
2
|
+
import * as v from "valibot";
|
|
3
3
|
import { EventEnvelopeSchema } from "../../../event-envelope";
|
|
4
4
|
import { UUID } from "../../../uuid.vo";
|
|
5
5
|
|
|
6
6
|
export const USER_LANGUAGE_SET_EVENT = "USER_LANGUAGE_SET_EVENT";
|
|
7
7
|
|
|
8
|
-
export const UserLanguageSetEvent =
|
|
8
|
+
export const UserLanguageSetEvent = v.object({
|
|
9
9
|
...EventEnvelopeSchema,
|
|
10
|
-
name:
|
|
11
|
-
payload:
|
|
10
|
+
name: v.literal(USER_LANGUAGE_SET_EVENT),
|
|
11
|
+
payload: v.object({ userId: UUID, language: tools.Language }),
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
-
export type UserLanguageSetEventType =
|
|
14
|
+
export type UserLanguageSetEventType = v.InferOutput<typeof UserLanguageSetEvent>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
-
import * as
|
|
2
|
+
import * as v from "valibot";
|
|
3
3
|
import { EventEnvelopeSchema } from "../../../event-envelope";
|
|
4
4
|
|
|
5
5
|
export const HOUR_HAS_PASSED_EVENT = "HOUR_HAS_PASSED_EVENT";
|
|
6
6
|
|
|
7
|
-
export const HourHasPassedEvent =
|
|
7
|
+
export const HourHasPassedEvent = v.object({
|
|
8
8
|
...EventEnvelopeSchema,
|
|
9
|
-
name:
|
|
10
|
-
payload:
|
|
9
|
+
name: v.literal(HOUR_HAS_PASSED_EVENT),
|
|
10
|
+
payload: v.object({ timestamp: tools.TimestampValue }),
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
-
export type HourHasPassedEventType =
|
|
13
|
+
export type HourHasPassedEventType = v.InferOutput<typeof HourHasPassedEvent>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
-
import * as
|
|
2
|
+
import * as v from "valibot";
|
|
3
3
|
import { EventEnvelopeSchema } from "../../../event-envelope";
|
|
4
4
|
|
|
5
5
|
export const MINUTE_HAS_PASSED_EVENT = "MINUTE_HAS_PASSED_EVENT";
|
|
6
6
|
|
|
7
|
-
export const MinuteHasPassedEvent =
|
|
7
|
+
export const MinuteHasPassedEvent = v.object({
|
|
8
8
|
...EventEnvelopeSchema,
|
|
9
|
-
name:
|
|
10
|
-
payload:
|
|
9
|
+
name: v.literal(MINUTE_HAS_PASSED_EVENT),
|
|
10
|
+
payload: v.object({ timestamp: tools.TimestampValue }),
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
-
export type MinuteHasPassedEventType =
|
|
13
|
+
export type MinuteHasPassedEventType = v.InferOutput<typeof MinuteHasPassedEvent>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as v from "valibot";
|
|
2
2
|
import { ClientIp } from "../../../client-ip.vo";
|
|
3
3
|
import { ClientUserAgent } from "../../../client-user-agent.vo";
|
|
4
4
|
import { EventEnvelopeSchema } from "../../../event-envelope";
|
|
@@ -8,16 +8,16 @@ import { UUID } from "../../../uuid.vo";
|
|
|
8
8
|
|
|
9
9
|
export const SECURITY_VIOLATION_DETECTED_EVENT = "SECURITY_VIOLATION_DETECTED_EVENT";
|
|
10
10
|
|
|
11
|
-
export const SecurityViolationDetectedEvent =
|
|
11
|
+
export const SecurityViolationDetectedEvent = v.object({
|
|
12
12
|
...EventEnvelopeSchema,
|
|
13
|
-
name:
|
|
14
|
-
payload:
|
|
13
|
+
name: v.literal(SECURITY_VIOLATION_DETECTED_EVENT),
|
|
14
|
+
payload: v.object({
|
|
15
15
|
rule: SecurityRuleName,
|
|
16
|
-
client:
|
|
17
|
-
userId:
|
|
16
|
+
client: v.object({ ip: v.optional(ClientIp), ua: v.optional(ClientUserAgent) }),
|
|
17
|
+
userId: v.optional(UUID),
|
|
18
18
|
countermeasure: SecurityCountermeasureName,
|
|
19
|
-
action:
|
|
19
|
+
action: v.string(),
|
|
20
20
|
}),
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
export type SecurityViolationDetectedEventType =
|
|
23
|
+
export type SecurityViolationDetectedEventType = v.InferOutput<typeof SecurityViolationDetectedEvent>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
1
2
|
import type { ClockPort } from "../../../clock.port";
|
|
2
3
|
import { createEventEnvelope } from "../../../event-envelope";
|
|
3
4
|
import type { EventStorePort } from "../../../event-store.port";
|
|
@@ -24,7 +25,7 @@ export class PassageOfTimeHourly implements UnitOfWork {
|
|
|
24
25
|
label = "PassageOfTime";
|
|
25
26
|
|
|
26
27
|
async process() {
|
|
27
|
-
const event =
|
|
28
|
+
const event = v.parse(HourHasPassedEvent, {
|
|
28
29
|
...createEventEnvelope("passage_of_time", this.deps),
|
|
29
30
|
name: HOUR_HAS_PASSED_EVENT,
|
|
30
31
|
payload: { timestamp: this.deps.Clock.now().ms },
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
1
2
|
import type { ClockPort } from "../../../clock.port";
|
|
2
3
|
import { createEventEnvelope } from "../../../event-envelope";
|
|
3
4
|
import type { EventStorePort } from "../../../event-store.port";
|
|
@@ -24,7 +25,7 @@ export class PassageOfTimeMinute implements UnitOfWork {
|
|
|
24
25
|
label = "PassageOfTime";
|
|
25
26
|
|
|
26
27
|
async process() {
|
|
27
|
-
const event =
|
|
28
|
+
const event = v.parse(MinuteHasPassedEvent, {
|
|
28
29
|
...createEventEnvelope("passage_of_time", this.deps),
|
|
29
30
|
name: MINUTE_HAS_PASSED_EVENT,
|
|
30
31
|
payload: { timestamp: this.deps.Clock.now().ms },
|
package/src/node-env.vo.ts
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import * as z from "zod/v4";
|
|
2
|
-
|
|
3
1
|
export enum NodeEnvironmentEnum {
|
|
4
2
|
local = "local",
|
|
5
3
|
test = "test",
|
|
6
4
|
staging = "staging",
|
|
7
5
|
production = "production",
|
|
8
6
|
}
|
|
9
|
-
|
|
10
|
-
export const NodeEnvironmentError = { Invalid: "node.environment.invalid" } as const;
|
|
11
|
-
|
|
12
|
-
export const NodeEnvironment = z.enum(NodeEnvironmentEnum, NodeEnvironmentError.Invalid);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
1
2
|
import type { NonceProviderPort } from "./nonce-provider.port";
|
|
2
3
|
import { NonceValue, type NonceValueType } from "./nonce-value.vo";
|
|
3
4
|
|
|
@@ -6,6 +7,6 @@ export class NonceProviderCryptoAdapter implements NonceProviderPort {
|
|
|
6
7
|
const buffer = new Uint8Array(8);
|
|
7
8
|
crypto.getRandomValues(buffer);
|
|
8
9
|
|
|
9
|
-
return
|
|
10
|
+
return v.parse(NonceValue, buffer.toHex());
|
|
10
11
|
}
|
|
11
12
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
1
2
|
import type { NonceProviderPort } from "./nonce-provider.port";
|
|
2
3
|
import { NonceValue, type NonceValueType } from "./nonce-value.vo";
|
|
3
4
|
|
|
4
5
|
export class NonceProviderNoopAdapter implements NonceProviderPort {
|
|
5
6
|
generate(): NonceValueType {
|
|
6
|
-
return
|
|
7
|
+
return v.parse(NonceValue, "0000000000000000");
|
|
7
8
|
}
|
|
8
9
|
}
|
package/src/nonce-value.vo.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as v from "valibot";
|
|
2
2
|
|
|
3
3
|
export const NonceValueError = {
|
|
4
4
|
Type: "nonce.value.type",
|
|
@@ -8,11 +8,11 @@ export const NonceValueError = {
|
|
|
8
8
|
// 16 hex chars allowed
|
|
9
9
|
const CHARS_WHITELIST = /^[a-fA-F0-9]{16}$/;
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
.
|
|
16
|
-
|
|
11
|
+
export const NonceValue = v.pipe(
|
|
12
|
+
v.string(NonceValueError.Type),
|
|
13
|
+
v.regex(CHARS_WHITELIST, NonceValueError.InvalidHex),
|
|
14
|
+
// Stryker disable next-line StringLiteral
|
|
15
|
+
v.brand("NonceValue"),
|
|
16
|
+
);
|
|
17
17
|
|
|
18
|
-
export type NonceValueType =
|
|
18
|
+
export type NonceValueType = v.InferOutput<typeof NonceValue>;
|
package/src/port.vo.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as v from "valibot";
|
|
2
2
|
|
|
3
3
|
export const PortError = { Type: "port.type", Invalid: "port.invalid" } as const;
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
.number(PortError.Type)
|
|
9
|
-
.
|
|
10
|
-
.
|
|
11
|
-
.
|
|
12
|
-
|
|
5
|
+
export const Port = v.pipe(
|
|
6
|
+
v.unknown(),
|
|
7
|
+
v.transform(Number),
|
|
8
|
+
v.number(PortError.Type),
|
|
9
|
+
v.integer(PortError.Type),
|
|
10
|
+
v.minValue(0, PortError.Invalid),
|
|
11
|
+
v.maxValue(99999, PortError.Invalid),
|
|
12
|
+
// Stryker disable next-line StringLiteral
|
|
13
|
+
v.brand("Port"),
|
|
14
|
+
);
|
|
13
15
|
|
|
14
|
-
export type PortType =
|
|
16
|
+
export type PortType = v.InferOutput<typeof Port>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
+
import * as v from "valibot";
|
|
2
3
|
import {
|
|
3
4
|
PrerequisiteVerification,
|
|
4
5
|
type PrerequisiteVerificationResult,
|
|
@@ -6,7 +7,7 @@ import {
|
|
|
6
7
|
} from "./prerequisite-verifier.port";
|
|
7
8
|
|
|
8
9
|
export class PrerequisiteVerifierOutsideConnectivityAdapter implements PrerequisiteVerifierPort {
|
|
9
|
-
private static readonly URL = tools.UrlWithoutSlash
|
|
10
|
+
private static readonly URL = v.parse(tools.UrlWithoutSlash, "https://google.com");
|
|
10
11
|
|
|
11
12
|
async verify(): Promise<PrerequisiteVerificationResult> {
|
|
12
13
|
try {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as v from "valibot";
|
|
2
2
|
|
|
3
3
|
export const RecaptchaSecretKeyError = {
|
|
4
4
|
Type: "recaptcha.secret.key.type",
|
|
5
5
|
Length: "recaptcha.secret.key.length",
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
.
|
|
13
|
-
|
|
8
|
+
export const RecaptchaSecretKey = v.pipe(
|
|
9
|
+
v.string(RecaptchaSecretKeyError.Type),
|
|
10
|
+
v.length(40, RecaptchaSecretKeyError.Length),
|
|
11
|
+
// Stryker disable next-line StringLiteral
|
|
12
|
+
v.brand("RecaptchaSecretKey"),
|
|
13
|
+
);
|
|
14
14
|
|
|
15
|
-
export type RecaptchaSecretKeyType =
|
|
15
|
+
export type RecaptchaSecretKeyType = v.InferOutput<typeof RecaptchaSecretKey>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as v from "valibot";
|
|
2
2
|
|
|
3
3
|
export const RecaptchaSiteKeyError = { Type: "recaptcha.site.key.type", Length: "recaptcha.site.key.length" };
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
.
|
|
10
|
-
|
|
5
|
+
export const RecaptchaSiteKey = v.pipe(
|
|
6
|
+
v.string(RecaptchaSiteKeyError.Type),
|
|
7
|
+
v.length(40, RecaptchaSiteKeyError.Length),
|
|
8
|
+
// Stryker disable next-line StringLiteral
|
|
9
|
+
v.brand("RecaptchaSiteKey"),
|
|
10
|
+
);
|
|
11
11
|
|
|
12
|
-
export type RecaptchaSiteKeyType =
|
|
12
|
+
export type RecaptchaSiteKeyType = v.InferOutput<typeof RecaptchaSiteKey>;
|
|
@@ -12,11 +12,11 @@ export class RedactorErrorCauseDepthLimit implements RedactorStrategy {
|
|
|
12
12
|
// Stryker restore all
|
|
13
13
|
if (!ErrorNormalizer.isNormalizedError(input.error)) return input;
|
|
14
14
|
|
|
15
|
-
return { ...input, error: this.limit(input.error, tools.
|
|
15
|
+
return { ...input, error: this.limit(input.error, tools.Int.nonNegative(0)) };
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
private limit(error: NormalizedError, depth: tools.IntegerNonNegativeType): NormalizedError {
|
|
19
19
|
if (!error.cause || depth >= this.max) return { ...error, cause: undefined };
|
|
20
|
-
return { ...error, cause: this.limit(error.cause, tools.
|
|
20
|
+
return { ...error, cause: this.limit(error.cause, tools.Int.nonNegative(depth + 1)) };
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -6,7 +6,7 @@ import type { RedactorStrategy } from "./redactor.strategy";
|
|
|
6
6
|
type RedactorMetadataCompactArrayOptions = { maxItems?: tools.IntegerPositiveType };
|
|
7
7
|
|
|
8
8
|
export class RedactorMetadataCompactArray implements RedactorStrategy {
|
|
9
|
-
private static readonly DEFAULT_MAX_ITEMS = tools.
|
|
9
|
+
private static readonly DEFAULT_MAX_ITEMS = tools.Int.positive(20);
|
|
10
10
|
|
|
11
11
|
private readonly maxItems: tools.IntegerPositiveType;
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ import type { RedactorStrategy } from "./redactor.strategy";
|
|
|
6
6
|
type RedactorMetadataCompactObjectOptions = { maxKeys?: tools.IntegerPositiveType };
|
|
7
7
|
|
|
8
8
|
export class RedactorMetadataCompactObject implements RedactorStrategy {
|
|
9
|
-
private static readonly DEFAULT_MAX_KEYS = tools.
|
|
9
|
+
private static readonly DEFAULT_MAX_KEYS = tools.Int.positive(20);
|
|
10
10
|
|
|
11
11
|
private readonly maxKeys: tools.IntegerPositiveType;
|
|
12
12
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
+
import * as v from "valibot";
|
|
2
3
|
import type { DirectoryEnsurerPort } from "./directory-ensurer.port";
|
|
3
4
|
import type { FileCleanerPort } from "./file-cleaner.port";
|
|
4
5
|
import type { FileCopierPort } from "./file-copier.port";
|
|
@@ -31,7 +32,7 @@ export class RemoteFileStorageDiskAdapter implements RemoteFileStoragePort {
|
|
|
31
32
|
const parts = key.split("/");
|
|
32
33
|
const filename = tools.Filename.fromString(parts.pop() as string);
|
|
33
34
|
|
|
34
|
-
const directory = tools.DirectoryPathAbsoluteSchema
|
|
35
|
+
const directory = v.parse(tools.DirectoryPathAbsoluteSchema, `${this.config.root}/${parts.join("/")}`);
|
|
35
36
|
|
|
36
37
|
return tools.FilePathAbsolute.fromPartsSafe(directory, filename);
|
|
37
38
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
+
import * as v from "valibot";
|
|
2
3
|
import type { RetryBackoffStrategy } from "./retry-backoff.strategy";
|
|
3
4
|
|
|
4
5
|
export class RetryBackoffExponentialStrategy implements RetryBackoffStrategy {
|
|
5
6
|
constructor(private readonly delay: tools.Duration) {}
|
|
6
7
|
|
|
7
8
|
next(attempt: tools.IntegerPositiveType): tools.Duration {
|
|
8
|
-
return this.delay.times(tools.MultiplicationFactor
|
|
9
|
+
return this.delay.times(v.parse(tools.MultiplicationFactor, 2 ** (attempt - 1)));
|
|
9
10
|
}
|
|
10
11
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
+
import * as v from "valibot";
|
|
2
3
|
import type { RetryBackoffStrategy } from "./retry-backoff.strategy";
|
|
3
4
|
|
|
4
5
|
export class RetryBackoffFibonacciStrategy implements RetryBackoffStrategy {
|
|
5
6
|
constructor(private readonly delay: tools.Duration) {}
|
|
6
7
|
|
|
7
8
|
next(attempt: tools.IntegerPositiveType): tools.Duration {
|
|
8
|
-
return this.delay.times(tools.MultiplicationFactor
|
|
9
|
+
return this.delay.times(v.parse(tools.MultiplicationFactor, this.fibonacci(attempt)));
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
private fibonacci(n: number): number {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as tools from "@bgord/tools";
|
|
2
|
+
import * as v from "valibot";
|
|
2
3
|
import type { RetryBackoffStrategy } from "./retry-backoff.strategy";
|
|
3
4
|
|
|
4
5
|
export class RetryBackoffLinearStrategy implements RetryBackoffStrategy {
|
|
5
6
|
constructor(private readonly delay: tools.Duration) {}
|
|
6
7
|
|
|
7
8
|
next(attempt: tools.IntegerPositiveType): tools.Duration {
|
|
8
|
-
return this.delay.times(tools.MultiplicationFactor
|
|
9
|
+
return this.delay.times(v.parse(tools.MultiplicationFactor, attempt));
|
|
9
10
|
}
|
|
10
11
|
}
|
package/src/retry.service.ts
CHANGED
|
@@ -27,8 +27,7 @@ export class Retry {
|
|
|
27
27
|
lastError = error;
|
|
28
28
|
|
|
29
29
|
if (attempt === config.max || (config.when && !config.when(error))) break;
|
|
30
|
-
|
|
31
|
-
await this.deps.Sleeper.wait(config.backoff.next(tools.IntegerPositive.parse(attempt)));
|
|
30
|
+
await this.deps.Sleeper.wait(config.backoff.next(tools.Int.positive(attempt)));
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
33
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
1
2
|
import type { ClockPort } from "./clock.port";
|
|
2
3
|
import { CorrelationStorage } from "./correlation-storage.service";
|
|
3
4
|
import { createEventEnvelope } from "./event-envelope";
|
|
@@ -50,7 +51,7 @@ export class SecurityCountermeasureBanStrategy implements SecurityCountermeasure
|
|
|
50
51
|
metadata: context,
|
|
51
52
|
});
|
|
52
53
|
|
|
53
|
-
const event =
|
|
54
|
+
const event = v.parse(SecurityViolationDetectedEvent, {
|
|
54
55
|
...createEventEnvelope("security", this.deps),
|
|
55
56
|
name: SECURITY_VIOLATION_DETECTED_EVENT,
|
|
56
57
|
payload: { action: action.kind, ...context },
|
|
@@ -62,6 +63,6 @@ export class SecurityCountermeasureBanStrategy implements SecurityCountermeasure
|
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
get name(): SecurityCountermeasureNameType {
|
|
65
|
-
return
|
|
66
|
+
return v.parse(SecurityCountermeasureName, "ban");
|
|
66
67
|
}
|
|
67
68
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
1
2
|
import { CorrelationStorage } from "./correlation-storage.service";
|
|
2
3
|
import type { LoggerPort } from "./logger.port";
|
|
3
4
|
import type { SecurityContext } from "./security-context.vo";
|
|
@@ -29,6 +30,6 @@ export class SecurityCountermeasureMirageStrategy implements SecurityCountermeas
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
get name(): SecurityCountermeasureNameType {
|
|
32
|
-
return
|
|
33
|
+
return v.parse(SecurityCountermeasureName, "mirage");
|
|
33
34
|
}
|
|
34
35
|
}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as v from "valibot";
|
|
2
2
|
|
|
3
3
|
export const SecurityCountermeasureNameError = {
|
|
4
4
|
Type: "security.countermeasure.name.type",
|
|
5
|
-
Empty: "security.countermeasure.name.empty",
|
|
6
|
-
TooLong: "security.countermeasure.name.too.long",
|
|
7
5
|
BadChars: "security.countermeasure.name.bad.chars",
|
|
8
6
|
};
|
|
9
7
|
|
|
10
8
|
// One to sixty four letters, digits, or underscores
|
|
11
9
|
const CHARS_WHITELIST = /^[a-zA-Z0-9_]{1,64}$/;
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.
|
|
18
|
-
|
|
19
|
-
.regex(CHARS_WHITELIST, SecurityCountermeasureNameError.BadChars)
|
|
20
|
-
.brand("SecurityCountermeasureName");
|
|
11
|
+
export const SecurityCountermeasureName = v.pipe(
|
|
12
|
+
v.string(SecurityCountermeasureNameError.Type),
|
|
13
|
+
v.regex(CHARS_WHITELIST, SecurityCountermeasureNameError.BadChars),
|
|
14
|
+
// Stryker disable next-line StringLiteral
|
|
15
|
+
v.brand("SecurityCountermeasureName"),
|
|
16
|
+
);
|
|
21
17
|
|
|
22
|
-
export type SecurityCountermeasureNameType =
|
|
18
|
+
export type SecurityCountermeasureNameType = v.InferOutput<typeof SecurityCountermeasureName>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
1
2
|
import type { SecurityAction, SecurityCountermeasureStrategy } from "./security-countermeasure.strategy";
|
|
2
3
|
import {
|
|
3
4
|
SecurityCountermeasureName,
|
|
@@ -10,6 +11,6 @@ export class SecurityCountermeasureNoopStrategy implements SecurityCountermeasur
|
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
get name(): SecurityCountermeasureNameType {
|
|
13
|
-
return
|
|
14
|
+
return v.parse(SecurityCountermeasureName, "noop");
|
|
14
15
|
}
|
|
15
16
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
1
2
|
import { CorrelationStorage } from "./correlation-storage.service";
|
|
2
3
|
import type { LoggerPort } from "./logger.port";
|
|
3
4
|
import type { SecurityContext } from "./security-context.vo";
|
|
@@ -25,6 +26,6 @@ export class SecurityCountermeasureReportStrategy implements SecurityCountermeas
|
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
get name(): SecurityCountermeasureNameType {
|
|
28
|
-
return
|
|
29
|
+
return v.parse(SecurityCountermeasureName, "report");
|
|
29
30
|
}
|
|
30
31
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type * as tools from "@bgord/tools";
|
|
2
|
+
import * as v from "valibot";
|
|
2
3
|
import { CorrelationStorage } from "./correlation-storage.service";
|
|
3
4
|
import type { LoggerPort } from "./logger.port";
|
|
4
5
|
import type { SecurityContext } from "./security-context.vo";
|
|
@@ -30,6 +31,6 @@ export class SecurityCountermeasureTarpitStrategy implements SecurityCountermeas
|
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
get name(): SecurityCountermeasureNameType {
|
|
33
|
-
return
|
|
34
|
+
return v.parse(SecurityCountermeasureName, "tarpit");
|
|
34
35
|
}
|
|
35
36
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
1
2
|
import type { RequestContext } from "./request-context.port";
|
|
2
3
|
import type { SecurityRuleStrategy } from "./security-rule.strategy";
|
|
3
4
|
import { SecurityRuleName, type SecurityRuleNameType } from "./security-rule-name.vo";
|
|
@@ -20,6 +21,6 @@ export class SecurityRuleAndStrategy implements SecurityRuleStrategy {
|
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
get name(): SecurityRuleNameType {
|
|
23
|
-
return
|
|
24
|
+
return v.parse(SecurityRuleName, `and_${this.rules.map((rule) => rule.name).join("_")}`);
|
|
24
25
|
}
|
|
25
26
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
1
2
|
import type { HasRequestPath } from "./request-context.port";
|
|
2
3
|
import type { SecurityRuleStrategy } from "./security-rule.strategy";
|
|
3
4
|
import { SecurityRuleName, type SecurityRuleNameType } from "./security-rule-name.vo";
|
|
@@ -10,6 +11,6 @@ export class SecurityRuleBaitRoutesStrategy implements SecurityRuleStrategy {
|
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
get name(): SecurityRuleNameType {
|
|
13
|
-
return
|
|
14
|
+
return v.parse(SecurityRuleName, "bait_routes");
|
|
14
15
|
}
|
|
15
16
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
1
2
|
import type { SecurityRuleStrategy } from "./security-rule.strategy";
|
|
2
3
|
import { SecurityRuleName, type SecurityRuleNameType } from "./security-rule-name.vo";
|
|
3
4
|
|
|
@@ -7,6 +8,6 @@ export class SecurityRuleFailStrategy implements SecurityRuleStrategy {
|
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
get name(): SecurityRuleNameType {
|
|
10
|
-
return
|
|
11
|
+
return v.parse(SecurityRuleName, "fail");
|
|
11
12
|
}
|
|
12
13
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
1
2
|
import type { HasRequestJSON } from "./request-context.port";
|
|
2
3
|
import type { SecurityRuleStrategy } from "./security-rule.strategy";
|
|
3
4
|
import { SecurityRuleName, type SecurityRuleNameType } from "./security-rule-name.vo";
|
|
@@ -14,6 +15,6 @@ export class SecurityRuleHoneyPotFieldStrategy implements SecurityRuleStrategy {
|
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
get name(): SecurityRuleNameType {
|
|
17
|
-
return
|
|
18
|
+
return v.parse(SecurityRuleName, "honey_pot_field");
|
|
18
19
|
}
|
|
19
20
|
}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as v from "valibot";
|
|
2
2
|
|
|
3
3
|
export const SecurityRuleNameError = {
|
|
4
4
|
Type: "security.rule.name.type",
|
|
5
|
-
Empty: "security.rule.name.empty",
|
|
6
|
-
TooLong: "security.rule.name.too.long",
|
|
7
5
|
BadChars: "security.rule.name.bad.chars",
|
|
8
6
|
};
|
|
9
7
|
|
|
10
|
-
// One to
|
|
8
|
+
// One to five hundred twelve letters, digits, or underscores
|
|
11
9
|
const CHARS_WHITELIST = /^[a-zA-Z0-9_]{1,512}$/;
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.
|
|
18
|
-
|
|
19
|
-
.regex(CHARS_WHITELIST, SecurityRuleNameError.BadChars)
|
|
20
|
-
.brand("SecurityRuleName");
|
|
11
|
+
export const SecurityRuleName = v.pipe(
|
|
12
|
+
v.string(SecurityRuleNameError.Type),
|
|
13
|
+
v.regex(CHARS_WHITELIST, SecurityRuleNameError.BadChars),
|
|
14
|
+
// Stryker disable next-line StringLiteral
|
|
15
|
+
v.brand("SecurityRuleName"),
|
|
16
|
+
);
|
|
21
17
|
|
|
22
|
-
export type SecurityRuleNameType =
|
|
18
|
+
export type SecurityRuleNameType = v.InferOutput<typeof SecurityRuleName>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
1
2
|
import type { RequestContext } from "./request-context.port";
|
|
2
3
|
import type { SecurityRuleStrategy } from "./security-rule.strategy";
|
|
3
4
|
import { SecurityRuleName, type SecurityRuleNameType } from "./security-rule-name.vo";
|
|
@@ -20,6 +21,6 @@ export class SecurityRuleOrStrategy implements SecurityRuleStrategy {
|
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
get name(): SecurityRuleNameType {
|
|
23
|
-
return
|
|
24
|
+
return v.parse(SecurityRuleName, `or_${this.rules.map((rule) => rule.name).join("_")}`);
|
|
24
25
|
}
|
|
25
26
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
1
2
|
import type { SecurityRuleStrategy } from "./security-rule.strategy";
|
|
2
3
|
import { SecurityRuleName, type SecurityRuleNameType } from "./security-rule-name.vo";
|
|
3
4
|
|
|
@@ -7,6 +8,6 @@ export class SecurityRulePassStrategy implements SecurityRuleStrategy {
|
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
get name(): SecurityRuleNameType {
|
|
10
|
-
return
|
|
11
|
+
return v.parse(SecurityRuleName, "pass");
|
|
11
12
|
}
|
|
12
13
|
}
|