mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 21:45:31 +09:00
refactor(schema): simplify validation and OpenAPI generation (#2709)
This commit is contained in:
1 parent
4bc5593f9f
commit
de1fd95a99
510 files changed
+29494
-36131
No files matched your search
@@ -6,7 +6,7 @@ import {
|
||||
sanitizeRetryAfterSeconds,
|
||||
} from '@fluxer/errors/src/domains/core/RetryAfterSeconds';
|
||||
import {ThrottledError} from '@fluxer/errors/src/domains/core/ThrottledError';
|
||||
import type {FluxerErrorData} from '@fluxer/errors/src/FluxerError';
|
||||
import type {RateLimitMetadata} from '@fluxer/schema/src/domains/common/ErrorSchemas';
|
||||
|
||||
type RateLimitScope = 'global' | 'shared' | 'user';
|
||||
|
||||
@@ -63,7 +63,7 @@ export class RateLimitError extends ThrottledError {
|
||||
? safeRetryAfterDecimal
|
||||
: resetAfterDecimal;
|
||||
const safeScope = sanitizeRateLimitScope(scope, global);
|
||||
const data: FluxerErrorData = {
|
||||
const data: RateLimitMetadata = {
|
||||
global,
|
||||
retry_after: safeRetryAfterDecimal,
|
||||
};
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import type {ValidationErrorCode} from '@fluxer/constants/src/ValidationErrorCodes';
|
||||
import type {ValidationErrorItem} from '@fluxer/schema/src/domains/common/ErrorSchemas';
|
||||
|
||||
export interface ValidationError {
|
||||
path: string;
|
||||
message: string;
|
||||
export interface ValidationError extends ValidationErrorItem {
|
||||
code?: ValidationErrorCode;
|
||||
}
|
||||
Reference in new issue
Block a user