Skip to content
Source
Sign inSign up

package-swagger.mjs

23 lines702 Bytes

1/* oxlint-disable no-undef */
2import * as Fs from "fs/promises"
3​
4const jsBundle = await fetch(
5 "https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js"
6).then((res) => res.text())
7const jsPreset = await fetch(
8 "https://unpkg.com/swagger-ui-dist/swagger-ui-standalone-preset.js"
9).then((res) => res.text())
10const css = await fetch(
11 "https://unpkg.com/swagger-ui-dist/swagger-ui.css"
12).then((res) => res.text())
13​
14const source = `/* oxlint-disable no-undef */
15​
16/** @internal */
17export const javascript = ${JSON.stringify(`${jsBundle}\n${jsPreset}`)}
18​
19/** @internal */
20export const css = ${JSON.stringify(css)}
22​
23await Fs.writeFile("packages/effect/src/http-api/internal/httpApiSwagger.ts", source)