refactor(schema): simplify validation and OpenAPI generation (#2709)

This commit is contained in:
Hampus authored and GitHub committed 2026-09-11 23:24:26 +02:00
1 parent 4bc5593f9f
commit de1fd95a99
510 files changed
+29494 -36131

No files matched your search

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {assign, getInitialSnapshot, type SnapshotFrom, setup, transition} from 'xstate';
import {assign, initialTransition, type SnapshotFrom, setup, transition} from 'xstate';
export type ReviewStep = 'account' | 'scopes' | 'community' | 'permissions';
export type AuthorizePhase =
@@ -80,7 +80,7 @@ export type AuthorizeMachineSnapshot = SnapshotFrom<typeof authorizeStateMachine
export type AuthorizeMachineStateValue = 'loading' | 'session_expired' | 'invalid_request' | 'review' | 'success';
export function createAuthorizeSnapshot(): AuthorizeMachineSnapshot {
return getInitialSnapshot(authorizeStateMachine);
return initialTransition(authorizeStateMachine)[0];
}
export function transitionAuthorizeSnapshot(
@@ -10,7 +10,7 @@ import {useId} from 'react';
type FieldErrors = ReadonlyMap<string, string> | null | undefined;
export interface AuthFormControllerLike {
handleSubmit: (event: React.FormEvent<HTMLFormElement>) => void;
handleSubmit: (event: React.SubmitEvent<HTMLFormElement>) => void;
getValue: (name: string) => string;
setValue: (name: string, value: string) => void;
getError: (name: string) => string | null | undefined;