diff --git a/src/module.ts b/src/module.ts index 8e7d334..bf90114 100644 --- a/src/module.ts +++ b/src/module.ts @@ -54,6 +54,10 @@ export default defineNuxtModule({ ws: '', NS: '', DB: '', + KV: undefined, + SC: undefined, + AC: undefined, + auth: undefined, }, }, server: { diff --git a/src/runtime/composables/surreal-fetch.ts b/src/runtime/composables/surreal-fetch.ts index b1fbe1f..175c058 100644 --- a/src/runtime/composables/surreal-fetch.ts +++ b/src/runtime/composables/surreal-fetch.ts @@ -4,7 +4,6 @@ import { hash } from 'ohash' import { createDefu, defu } from 'defu' import type { - DatabasePreset, DatabasePresetKeys, KeysOf, PickFrom, @@ -97,9 +96,7 @@ export function useSurrealRPC< }) } -export function useSurrealDatabases(): { - [key in DatabasePresetKeys]: DatabasePreset -} { +export function useSurrealDatabases() { const { databases: publicDatabases, defaultDatabase, diff --git a/src/runtime/server/utils/surreal-fetch.ts b/src/runtime/server/utils/surreal-fetch.ts index 9045e5c..fe94285 100644 --- a/src/runtime/server/utils/surreal-fetch.ts +++ b/src/runtime/server/utils/surreal-fetch.ts @@ -1,6 +1,5 @@ // The following nitropack import is from https://github.com/nuxt/module-builder/issues/141#issuecomment-2078248248 import type {} from 'nitropack' -import type { PublicRuntimeConfig, RuntimeConfig } from 'nuxt/schema' import type { FetchOptions, ResponseType } from 'ofetch' import { textToBase64 } from 'undio' import type { H3Event } from 'h3' @@ -58,10 +57,7 @@ export function useSurrealDatabases(event?: H3Event): { return true }) - const databases = defuDatabases< - RuntimeConfig['surrealdb']['databases'], - PublicRuntimeConfig['surrealdb']['databases'][] - >(privateDatabases, publicDatabases) + const databases = defuDatabases(privateDatabases, publicDatabases) return databases }