- Delete old Vite+Svelte frontend - Initialize new SvelteKit project with TypeScript - Configure Tailwind CSS v4 + DaisyUI - Implement JWT authentication with auto-refresh - Create login page with form validation (Zod) - Add protected route guards - Update Docker configuration for single-stage build - Add E2E tests with Playwright (6/11 passing) - Fix Svelte 5 reactivity with $state() runes Known issues: - 5 E2E tests failing (timing/async issues) - Token refresh implementation needs debugging - Validation error display timing
43 lines
2.0 KiB
TypeScript
43 lines
2.0 KiB
TypeScript
import type { JSONSchema } from '../jsonSchema/index.js';
|
|
import { type SchemaShape } from '../jsonSchema/schemaShape.js';
|
|
import type { InputConstraints } from '../jsonSchema/constraints.js';
|
|
import type { Schema, ValidationResult, Infer as InferSchema, InferIn as InferInSchema, Registry } from './typeSchema.js';
|
|
export type { Schema, ValidationIssue, ValidationResult } from './typeSchema.js';
|
|
export type Infer<T extends Schema, K extends keyof Registry = keyof Registry> = NonNullable<InferSchema<T, K>>;
|
|
export type InferIn<T extends Schema, K extends keyof Registry = keyof Registry> = NonNullable<InferInSchema<T, K>>;
|
|
export type ValidationLibrary = 'arktype' | 'classvalidator' | 'custom' | 'joi' | 'superform' | 'typebox' | 'valibot' | 'yup' | 'zod' | 'zod4' | 'vine' | 'schemasafe' | 'superstruct' | 'effect';
|
|
export type AdapterOptions<T> = {
|
|
jsonSchema?: JSONSchema;
|
|
defaults?: T;
|
|
};
|
|
export type RequiredDefaultsOptions<T> = {
|
|
defaults: T;
|
|
jsonSchema?: JSONSchema;
|
|
};
|
|
export type ClientValidationAdapter<Out, In = Out> = {
|
|
superFormValidationLibrary: ValidationLibrary;
|
|
validate: (data: unknown) => Promise<ValidationResult<Out>>;
|
|
shape?: SchemaShape;
|
|
};
|
|
type BaseValidationAdapter<Out, In = Out> = ClientValidationAdapter<Out, In> & {
|
|
jsonSchema: JSONSchema;
|
|
defaults?: Out;
|
|
constraints?: InputConstraints<Out>;
|
|
};
|
|
export type ValidationAdapter<Out, In = Out> = BaseValidationAdapter<Out, In> & {
|
|
defaults: Out;
|
|
constraints: InputConstraints<Out>;
|
|
shape: SchemaShape;
|
|
id: string;
|
|
};
|
|
/**
|
|
* If the adapter options doesn't have a "defaults" or "jsonSchema" fields,
|
|
* this is a convenient function for creating a JSON schema.
|
|
* If no transformer exist for the adapter, use RequiredDefaultsOptions.
|
|
* @see {AdapterOptions}
|
|
* @see {RequiredDefaultsOptions}
|
|
* @__NO_SIDE_EFFECTS__
|
|
*/
|
|
export declare function createJsonSchema(options: object, transformer?: () => JSONSchema): {};
|
|
export declare function createAdapter<Out, In>(adapter: BaseValidationAdapter<Out, In>, jsonSchema?: JSONSchema): ValidationAdapter<Out, In>;
|