From fd6a3d623073832cab3186e20a4cb1502f0852c8 Mon Sep 17 00:00:00 2001 From: Jens L Date: Fri, 21 Oct 2022 09:08:25 +0200 Subject: [PATCH] root: update options for generating TS API (#3833) --- Makefile | 4 ++-- scripts/api-ts-config.yaml | 12 ++++++++++++ .../README.mustache} | 0 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 scripts/api-ts-config.yaml rename scripts/{web_api_readme.md => api-ts-templates/README.mustache} (100%) diff --git a/Makefile b/Makefile index fcfe2cba0..cdbbf63f2 100644 --- a/Makefile +++ b/Makefile @@ -90,11 +90,11 @@ gen-client-ts: -i /local/schema.yml \ -g typescript-fetch \ -o /local/gen-ts-api \ - --additional-properties=typescriptThreePlus=true,supportsES6=true,npmName=@goauthentik/api,npmVersion=${NPM_VERSION} \ + -c /local/scripts/api-ts-config.yaml \ + --additional-properties=npmVersion=${NPM_VERSION} \ --git-repo-id authentik \ --git-user-id goauthentik mkdir -p web/node_modules/@goauthentik/api - \cp -fv scripts/web_api_readme.md gen-ts-api/README.md cd gen-ts-api && npm i \cp -rfv gen-ts-api/* web/node_modules/@goauthentik/api diff --git a/scripts/api-ts-config.yaml b/scripts/api-ts-config.yaml new file mode 100644 index 000000000..86577b10b --- /dev/null +++ b/scripts/api-ts-config.yaml @@ -0,0 +1,12 @@ +templateDir: /local/scripts/api-ts-templates/ +additionalProperties: + typescriptThreePlus: true + supportsES6: true + npmName: "@goauthentik/api" + fileContentDataType: Blob + enumUnknownDefaultCase: true + useObjectParameters: true +files: + README.mustache: + templateType: SupportingFiles + destinationFilename: README.md diff --git a/scripts/web_api_readme.md b/scripts/api-ts-templates/README.mustache similarity index 100% rename from scripts/web_api_readme.md rename to scripts/api-ts-templates/README.mustache