MCPcopy Index your code
hub / github.com/anomalyco/opencode / generate

Function generate

packages/httpapi-codegen/src/index.ts:771–779  ·  view source on GitHub ↗
(
  api: HttpApi.HttpApi<Id, Groups>,
  options: { readonly directory: string },
)

Source from the content-addressed store, hash-verified

769}
770
771export 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
781function inputFields(schema: Schema.Top | undefined, source: InputField["source"], operation: string) {
782 if (schema === undefined) return []

Callers 1

generate.test.tsFile · 0.90

Calls 3

emitEffectFunction · 0.85
compileFunction · 0.70
writeFunction · 0.70

Tested by

no test coverage detected