(
api: HttpApi.HttpApi<Id, Groups>,
options: { readonly directory: string },
)
| 769 | } |
| 770 | |
| 771 | export function generate<Id extends string, Groups extends HttpApiGroup.Any>( |
| 772 | api: HttpApi.HttpApi<Id, Groups>, |
| 773 | options: { readonly directory: string }, |
| 774 | ): Effect.Effect<void, GenerationError | PlatformError.PlatformError, FileSystem.FileSystem> { |
| 775 | return Effect.try({ |
| 776 | try: () => emitEffect(compile(api)), |
| 777 | catch: (error) => (error instanceof GenerationError ? error : new GenerationError({ reason: String(error) })), |
| 778 | }).pipe(Effect.flatMap((output) => write(output, options.directory))) |
| 779 | } |
| 780 | |
| 781 | function inputFields(schema: Schema.Top | undefined, source: InputField["source"], operation: string) { |
| 782 | if (schema === undefined) return [] |
no test coverage detected