Yokan / rebuild
Course 1 8624561

PlatformRecipeServices.jvm.kt

composeApp/src/jvmCommonMain/kotlin/eu/friedcutlet/yokan/services/extensions/recipe/PlatformRecipeServices.jvm.kt

implementation21 lines
1package eu.friedcutlet.yokan.services.extensions.recipe23import eu.friedcutlet.yokan.database.YokanDatabase4import eu.friedcutlet.yokan.database.room.RoomRecipeInstallationStore5import eu.friedcutlet.yokan.database.room.RoomYokanDatabase6actual fun createPlatformRecipeServices(7    database: YokanDatabase,8    clock: RecipeInstallationClock,9): PlatformRecipeServices {10    val roomDatabase = database as? RoomYokanDatabase ?: return unavailablePlatformRecipeServices(clock)11    val store = RoomRecipeInstallationStore(roomDatabase.room, clock)12    return PlatformRecipeServices(13        installation = RecipeCatalogInstallationService(store, CapabilityCatalogDownloader(developerMode = { database.settings().developerMode }), clock),14        runtimeBindings = RecipeRuntimeBindings(15            resolver = InstalledRecipeBundleResolver(store),16            broker = CapabilityHttpsBroker(),17            // Host limits only: an installed recipe is granted exactly its own declared origins at execution time.18            policy = RecipeExecutionPolicy(emptyMap()),19        ),20    )21}22

Search chapters, reference and source filenames.