(sessionSchemaPath?: string, apiSchemaPath?: string)
| 4455 | } |
| 4456 | |
| 4457 | async function generate(sessionSchemaPath?: string, apiSchemaPath?: string): Promise<void> { |
| 4458 | let apiSchemaForSharing: ApiSchema | undefined; |
| 4459 | try { |
| 4460 | const resolvedApiPath = apiSchemaPath ?? (await getApiSchemaPath()); |
| 4461 | apiSchemaForSharing = fixNullableRequiredRefsInApiSchema(cloneSchemaForCodegen((await loadSchemaJson(resolvedApiPath)) as ApiSchema)); |
| 4462 | } catch (err) { |
| 4463 | if ((err as NodeJS.ErrnoException).code !== "ENOENT" || apiSchemaPath) { |
| 4464 | throw err; |
| 4465 | } |
| 4466 | } |
| 4467 | |
| 4468 | await generateSessionEvents(sessionSchemaPath, apiSchemaForSharing); |
| 4469 | try { |
| 4470 | await generateRpc(apiSchemaPath); |
| 4471 | } catch (err) { |
| 4472 | if ((err as NodeJS.ErrnoException).code === "ENOENT" && !apiSchemaPath) { |
| 4473 | console.log("Go: skipping RPC (api.schema.json not found)"); |
| 4474 | } else { |
| 4475 | throw err; |
| 4476 | } |
| 4477 | } |
| 4478 | } |
| 4479 | |
| 4480 | const __filename = fileURLToPath(import.meta.url); |
| 4481 |
no test coverage detected
searching dependent graphs…