|
@@ -1,11 +1,10 @@ |
|
|
import {Resource} from './resource'; |
|
|
import {Resource} from './resource'; |
|
|
import {Language} from './language'; |
|
|
|
|
|
import {MediaType} from './media-type'; |
|
|
|
|
|
import {Charset} from './charset'; |
|
|
|
|
|
|
|
|
import {FALLBACK_LANGUAGE, Language} from './language'; |
|
|
|
|
|
import {FALLBACK_MEDIA_TYPE, MediaType} from './media-type'; |
|
|
|
|
|
import {Charset, FALLBACK_CHARSET} from './charset'; |
|
|
import * as v from 'valibot'; |
|
|
import * as v from 'valibot'; |
|
|
import {BackendBuilder, createBackend, CreateBackendParams} from '../backend'; |
|
|
import {BackendBuilder, createBackend, CreateBackendParams} from '../backend'; |
|
|
import {ClientBuilder, createClient, CreateClientParams} from '../client'; |
|
|
import {ClientBuilder, createClient, CreateClientParams} from '../client'; |
|
|
import {FALLBACK_CHARSET, FALLBACK_LANGUAGE, FALLBACK_MEDIA_TYPE} from './index'; |
|
|
|
|
|
|
|
|
|
|
|
type ApplicationMap<T extends { name: string }> = Map<T['name'], T>; |
|
|
type ApplicationMap<T extends { name: string }> = Map<T['name'], T>; |
|
|
|
|
|
|
|
@@ -34,13 +33,13 @@ export const application = (appParams: ApplicationParams): ApplicationBuilder => |
|
|
const appState: ApplicationState = { |
|
|
const appState: ApplicationState = { |
|
|
name: appParams.name, |
|
|
name: appParams.name, |
|
|
resources: new Set<Resource<any>>(), |
|
|
resources: new Set<Resource<any>>(), |
|
|
languages: new Map<Language["name"], Language>([ |
|
|
|
|
|
|
|
|
languages: new Map<Language['name'], Language>([ |
|
|
[FALLBACK_LANGUAGE.name, FALLBACK_LANGUAGE], |
|
|
[FALLBACK_LANGUAGE.name, FALLBACK_LANGUAGE], |
|
|
]), |
|
|
]), |
|
|
mediaTypes: new Map<MediaType["name"], MediaType>([ |
|
|
|
|
|
|
|
|
mediaTypes: new Map<MediaType['name'], MediaType>([ |
|
|
[FALLBACK_MEDIA_TYPE.name, FALLBACK_MEDIA_TYPE], |
|
|
[FALLBACK_MEDIA_TYPE.name, FALLBACK_MEDIA_TYPE], |
|
|
]), |
|
|
]), |
|
|
charsets: new Map<Charset["name"], Charset>([ |
|
|
|
|
|
|
|
|
charsets: new Map<Charset['name'], Charset>([ |
|
|
[FALLBACK_CHARSET.name, FALLBACK_CHARSET], |
|
|
[FALLBACK_CHARSET.name, FALLBACK_CHARSET], |
|
|
]), |
|
|
]), |
|
|
}; |
|
|
}; |
|
|