UNPKG

@naturalcycles/nodejs-lib

Version:
63 lines (62 loc) 3.37 kB
import { SavedDBEntity } from '@naturalcycles/js-lib'; import { AlternativesSchemaTyped, AnySchemaTyped, ArraySchemaTyped, BooleanSchemaTyped, ObjectSchemaTyped, StringSchemaTyped } from './joi.model'; export declare const booleanSchema: BooleanSchemaTyped; export declare const booleanDefaultToFalseSchema: BooleanSchemaTyped; export declare const stringSchema: import("./string.extensions").ExtendedStringSchema; export declare const numberSchema: import("./number.extensions").ExtendedNumberSchema; export declare const integerSchema: import("./number.extensions").ExtendedNumberSchema; export declare const percentageSchema: import("./number.extensions").ExtendedNumberSchema; export declare const dateStringSchema: import("./string.extensions").ExtendedStringSchema; export declare const binarySchema: import("joi").BinarySchema; export declare const urlSchema: (scheme?: string | string[]) => StringSchemaTyped; export declare function arraySchema<T>(items?: AnySchemaTyped<T, T>): ArraySchemaTyped<T>; export declare function objectSchema<IN, OUT = IN>(schema?: { [key in keyof Partial<IN>]: AnySchemaTyped<IN[key]>; }): ObjectSchemaTyped<IN, OUT>; export declare function oneOfSchema<T = any>(...schemas: AnySchemaTyped<any>[]): AlternativesSchemaTyped<T>; export declare const anySchema: import("joi").AnySchema; export declare const anyObjectSchema: import("joi").ObjectSchema<any>; /** * [a-zA-Z0-9_]* * 6-64 length */ export declare const idSchema: import("./string.extensions").ExtendedStringSchema; /** * `_` should NOT be allowed to be able to use slug-ids as part of natural ids with `_` separator. */ export declare const SLUG_PATTERN: RegExp; /** * "Slug" - a valid URL, filename, etc. */ export declare const slugSchema: import("./string.extensions").ExtendedStringSchema; /** * Between years 1970 and 2050 */ export declare const unixTimestampSchema: import("./number.extensions").ExtendedNumberSchema; /** * Between years 2000 and 2050 */ export declare const unixTimestamp2000Schema: import("./number.extensions").ExtendedNumberSchema; /** * Between years 1970 and 2050 */ export declare const unixTimestampMillisSchema: import("./number.extensions").ExtendedNumberSchema; /** * Between years 2000 and 2050 */ export declare const unixTimestampMillis2000Schema: import("./number.extensions").ExtendedNumberSchema; export declare const verSchema: import("./number.extensions").ExtendedNumberSchema; /** * Be careful, by default emailSchema does TLD validation. To disable it - use `stringSchema.email({tld: false}).lowercase()` */ export declare const emailSchema: import("./string.extensions").ExtendedStringSchema; /** * Pattern is simplified for our use, it's not a canonical SemVer. */ export declare const SEM_VER_PATTERN: RegExp; export declare const semVerSchema: import("./string.extensions").ExtendedStringSchema; export declare const userAgentSchema: import("./string.extensions").ExtendedStringSchema; export declare const utcOffsetSchema: import("./number.extensions").ExtendedNumberSchema; export declare const ipAddressSchema: import("./string.extensions").ExtendedStringSchema; export declare const baseDBEntitySchema: ObjectSchemaTyped<Partial<SavedDBEntity<string>>, Partial<SavedDBEntity<string>>>; export declare const savedDBEntitySchema: ObjectSchemaTyped<SavedDBEntity<string>, SavedDBEntity<string>>;