diff --git a/.github/workflows/web-api-publish.yml b/.github/workflows/web-api-publish.yml index 5a7750a3c..eceaf581c 100644 --- a/.github/workflows/web-api-publish.yml +++ b/.github/workflows/web-api-publish.yml @@ -17,6 +17,7 @@ jobs: - run: make gen-web - run: | cd web/api/ + npm run build npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} diff --git a/web/package-lock.json b/web/package-lock.json index 239c35849..b3e06bf3e 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -33,7 +33,6 @@ "@typescript-eslint/eslint-plugin": "^4.29.1", "@typescript-eslint/parser": "^4.29.1", "@webcomponents/webcomponentsjs": "^2.6.0", - "authentik-api": "file:api", "babel-plugin-macros": "^3.1.0", "base64-js": "^1.5.1", "chart.js": "^3.5.0", @@ -69,23 +68,11 @@ "api": { "name": "authentik-api", "version": "1.0.0", + "extraneous": true, "devDependencies": { "typescript": "^3.9.5" } }, - "api/node_modules/typescript": { - "version": "3.9.9", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.9.tgz", - "integrity": "sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, "node_modules/@apitools/openapi-parser": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/@apitools/openapi-parser/-/openapi-parser-0.0.7.tgz", @@ -2994,10 +2981,6 @@ "node": ">= 4.5.0" } }, - "node_modules/authentik-api": { - "resolved": "api", - "link": true - }, "node_modules/babel-plugin-dynamic-import-node": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", @@ -10233,20 +10216,6 @@ "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" }, - "authentik-api": { - "version": "file:api", - "requires": { - "typescript": "^3.9.5" - }, - "dependencies": { - "typescript": { - "version": "3.9.9", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.9.tgz", - "integrity": "sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==", - "dev": true - } - } - }, "babel-plugin-dynamic-import-node": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", diff --git a/web/rollup.config.js b/web/rollup.config.js index 8d1d60e26..259203f8a 100644 --- a/web/rollup.config.js +++ b/web/rollup.config.js @@ -2,7 +2,6 @@ import resolve from "rollup-plugin-node-resolve"; import commonjs from "rollup-plugin-commonjs"; import { terser } from "rollup-plugin-terser"; import sourcemaps from "rollup-plugin-sourcemaps"; -import typescript from "@rollup/plugin-typescript"; import cssimport from "rollup-plugin-cssimport"; import copy from "rollup-plugin-copy"; import babel from "@rollup/plugin-babel"; @@ -47,9 +46,6 @@ const resources = [ const isProdBuild = process.env.NODE_ENV === "production"; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types function manualChunks(id) { - if (id.endsWith("web/api/dist/index.js")) { - return "api"; - } if (id.includes("locales")) { const parts = id.split("/"); const file = parts[parts.length - 1]; @@ -64,31 +60,6 @@ function manualChunks(id) { } export default [ - // Autogenerated API Client - { - input: "./api/src/index.ts", - output: [ - { - format: "es", - dir: "./api/dist/", - sourcemap: true, - }, - ], - plugins: [ - typescript({ - declaration: true, - outDir: "./api/dist/", - }), - isProdBuild && terser(), - copy({ - targets: [...resources], - copyOnce: false, - }), - ].filter((p) => p), - watch: { - clearScreen: false, - }, - }, // Polyfills (imported first) { input: "./poly.ts", diff --git a/web/src/api/Config.ts b/web/src/api/Config.ts index 2b6dceb3a..b204feaa4 100644 --- a/web/src/api/Config.ts +++ b/web/src/api/Config.ts @@ -1,4 +1,4 @@ -import { Config, Configuration, CoreApi, CurrentTenant, Middleware, ResponseContext, RootApi, Tenant } from "@goauthentik/api"; +import { Config, Configuration, CoreApi, CurrentTenant, Middleware, ResponseContext, RootApi } from "@goauthentik/api"; import { getCookie } from "../utils"; import { APIMiddleware } from "../elements/notifications/APIDrawer"; import { MessageMiddleware } from "../elements/messages/Middleware"; diff --git a/web/src/elements/PageHeader.ts b/web/src/elements/PageHeader.ts index 59357efd3..c05611920 100644 --- a/web/src/elements/PageHeader.ts +++ b/web/src/elements/PageHeader.ts @@ -19,7 +19,7 @@ import { TITLE_DEFAULT, } from "../constants"; import { DEFAULT_CONFIG, tenant } from "../api/Config"; -import { EventsApi } from "../../api/dist"; +import { EventsApi } from "@goauthentik/api"; @customElement("ak-page-header") export class PageHeader extends LitElement { diff --git a/web/src/pages/policies/PolicyTestForm.ts b/web/src/pages/policies/PolicyTestForm.ts index 65143c92a..030172e36 100644 --- a/web/src/pages/policies/PolicyTestForm.ts +++ b/web/src/pages/policies/PolicyTestForm.ts @@ -1,4 +1,10 @@ -import { CoreApi, PoliciesApi, Policy, PolicyTestRequest, PolicyTestResult } from "@goauthentik/api"; +import { + CoreApi, + PoliciesApi, + Policy, + PolicyTestRequest, + PolicyTestResult, +} from "@goauthentik/api"; import { t } from "@lingui/macro"; import { customElement, property } from "lit-element"; import { html, TemplateResult } from "lit-html";