1{
2 lib,
3 fetchFromGitHub,
4 buildNpmPackage,
5 nodejs,
6 versionCheckHook,
7 nix-update-script,
8}:
9
10buildNpmPackage (finalAttrs: {
11 pname = "openapi-down-convert";
12 version = "0.14.1";
13
14 src = fetchFromGitHub {
15 owner = "apiture";
16 repo = "openapi-down-convert";
17 tag = "v${finalAttrs.version}";
18 hash = "sha256-8csxj2HfOb9agDmwNmksNaiQhRd+3D1tf0vWU2w+XWw=";
19 };
20
21 npmDepsHash = "sha256-5VgFAiphahDKz3ZhzNEdQOFxvhvDy+S/qOClqBgMzSg=";
22
23 postInstall = ''
24 find $out/lib -type f \( -name '*.ts' \) -delete
25 rm -r $out/lib/node_modules/@apiture/openapi-down-convert/node_modules/typescript
26 rm $out/lib/node_modules/@apiture/openapi-down-convert/node_modules/.bin/*
27 '';
28
29 nativeInstallCheckInputs = [
30 versionCheckHook
31 ];
32 versionCheckProgramArg = "--version";
33 doInstallCheck = true;
34
35 passthru.updateScript = nix-update-script { };
36
37 meta = {
38 description = "Convert an OpenAPI 3.1.x document to OpenAPI 3.0.x format";
39 homepage = "https://github.com/apiture/openapi-down-convert";
40 changelog = "https://github.com/apiture/openapi-down-convert/releases/tag/v${finalAttrs.version}";
41 license = lib.licenses.isc;
42 maintainers = with lib.maintainers; [ fliegendewurst ];
43 mainProgram = "openapi-down-convert";
44 };
45})