build: Upgrade to Vite 5 (#7784)

This commit is contained in:
Csaba Tuncsik
2023-11-23 11:55:02 +01:00
committed by GitHub
parent 77bc8ecd4b
commit e128b23a2b
32 changed files with 442 additions and 94 deletions

View File

@@ -32,12 +32,12 @@ type GetPathSegments<Traversable, Filter> = Traversable extends Filter
type JoinByDotting<T extends string[]> = T extends [infer F]
? F
: T extends [infer F, ...infer R]
? F extends string
? R extends string[]
? `${F}.${JoinByDotting<R>}`
? F extends string
? R extends string[]
? `${F}.${JoinByDotting<R>}`
: never
: never
: never
: string;
: string;
type ToDottedPath<T> = JoinByDotting<RemoveExcess<T>>;
@@ -65,14 +65,14 @@ type ConfigOptionPath =
type ToReturnType<T extends ConfigOptionPath> = T extends NumericPath
? number
: T extends BooleanPath
? boolean
: T extends StringLiteralArrayPath
? StringLiteralMap[T]
: T extends keyof ExceptionPaths
? ExceptionPaths[T]
: T extends StringPath
? string
: unknown;
? boolean
: T extends StringLiteralArrayPath
? StringLiteralMap[T]
: T extends keyof ExceptionPaths
? ExceptionPaths[T]
: T extends StringPath
? string
: unknown;
type ExceptionPaths = {
'queue.bull.redis': object;

View File

@@ -29,15 +29,15 @@ export class CreateLdapEntities1674509946020 implements ReversibleMigration {
dbType === 'sqlite'
? 'INTEGER PRIMARY KEY AUTOINCREMENT'
: dbType === 'postgresdb'
? 'SERIAL NOT NULL PRIMARY KEY'
: 'INTEGER NOT NULL AUTO_INCREMENT';
? 'SERIAL NOT NULL PRIMARY KEY'
: 'INTEGER NOT NULL AUTO_INCREMENT';
const timestampColumn =
dbType === 'sqlite'
? 'DATETIME NOT NULL'
: dbType === 'postgresdb'
? 'TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP'
: 'DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP';
? 'TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP'
: 'DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP';
await runQuery(
`CREATE TABLE IF NOT EXISTS ${escape.tableName('auth_provider_sync_history')} (

View File

@@ -3,7 +3,7 @@ import { CONTROLLER_AUTH_ROLES } from './constants';
import type { AuthRoleMetadata } from './types';
export function Authorized(authRole: AuthRoleMetadata[string] = 'any'): Function {
return function (target: Function | Object, handlerName?: string) {
return function (target: Function | object, handlerName?: string) {
const controllerClass = handlerName ? target.constructor : target;
const authRoles = (Reflect.getMetadata(CONTROLLER_AUTH_ROLES, controllerClass) ??
{}) as AuthRoleMetadata;