@nhtio/validation 1.20251030.0 → 1.20251103.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nhtio/validation",
3
- "version": "1.20251030.0",
3
+ "version": "1.20251103.0",
4
4
  "description": "A powerful schema description language and data validator",
5
5
  "keywords": [],
6
6
  "author": "Jak Giveon <jak@nht.io>",
@@ -0,0 +1,5 @@
1
+ import type { SchemaTypeDefinititionMiddlewareFn } from '../core/root';
2
+ export declare const fqdnMessages: {
3
+ 'string.fqdn': string;
4
+ };
5
+ export declare const fqdn: SchemaTypeDefinititionMiddlewareFn;
@@ -1,8 +1,8 @@
1
1
  import { DateTime } from 'luxon';
2
+ import { ExtensionFactory, CustomHelpers, Reference } from 'joi';
2
3
  import type { Dayjs } from 'dayjs';
3
4
  import type { Tokens } from '../types';
4
5
  import type { AnySchema } from '../schemas';
5
- import type { ExtensionFactory, CustomHelpers, Reference } from 'joi';
6
6
  import type { Zone, LocaleOptions, DateObjectUnits, ZoneOptions, ToISOTimeOptions, ToISODateOptions, ToSQLOptions, ToRelativeOptions } from 'luxon';
7
7
  type CallbackOrValue<T> = T | ((dt: DateTime, helpers: CustomHelpers) => T);
8
8
  export declare const messages: {
@@ -366,6 +366,12 @@ export interface StringSchema<TSchema = string> extends AnySchema<TSchema> {
366
366
  * - `helpers` - Validation helper functions for custom validation logic
367
367
  */
368
368
  default(value?: DefaultableValue): this;
369
+ /**
370
+ * Requires the string value to be a valid fully qualified domain name.
371
+ *
372
+ * @tip This does not do fully RFC-compliant validation, but a practical approximation.
373
+ */
374
+ fqdn(): this;
369
375
  }
370
376
  /**
371
377
  * Schema type for binary data validation.