mirror of
https://github.com/langgenius/dify.git
synced 2026-04-27 22:18:15 +08:00
27 lines
799 B
TypeScript
27 lines
799 B
TypeScript
import type { OrpcPlugin } from './types'
|
|
|
|
import { definePluginConfig } from '@hey-api/openapi-ts'
|
|
|
|
import { handler } from './plugin'
|
|
|
|
export const defaultConfig: OrpcPlugin['Config'] = {
|
|
config: {
|
|
output: 'orpc',
|
|
},
|
|
dependencies: ['@hey-api/typescript', 'zod'],
|
|
handler,
|
|
name: 'orpc',
|
|
resolveConfig: (plugin) => {
|
|
plugin.config.output = plugin.config.output ?? 'orpc'
|
|
plugin.config.exportFromIndex = plugin.config.exportFromIndex ?? false
|
|
plugin.config.contractNameBuilder = plugin.config.contractNameBuilder
|
|
?? ((id: string) => `${id}Contract`)
|
|
plugin.config.defaultTag = plugin.config.defaultTag ?? 'default'
|
|
},
|
|
}
|
|
|
|
/**
|
|
* Type helper for oRPC plugin, returns {@link Plugin.Config} object
|
|
*/
|
|
export const defineConfig = definePluginConfig(defaultConfig)
|