web: use API as dedicated module

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-03-16 21:32:39 +01:00
parent db99225c65
commit 5f024eb1f7
68 changed files with 91 additions and 110 deletions

View File

@ -1,5 +0,0 @@
apis/**
models/**
index.ts
runtime.ts
.openapi-generator/**

View File

@ -1,23 +0,0 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@ -5,12 +5,10 @@ export interface QueryArguments {
}
export interface BaseInheritanceModel {
objectType: string;
verboseName: string;
verboseNamePlural: string;
}
export interface AKPagination {

View File

@ -2,9 +2,7 @@ import * as Sentry from "@sentry/browser";
import { Integrations } from "@sentry/tracing";
import { VERSION } from "../constants";
import { SentryIgnoredError } from "../common/errors";
import { Configuration } from "./runtime";
import { RootApi } from "./apis";
import { Config } from ".";
import { Config, Configuration, RootApi } from "authentik-api";
import { getCookie } from "../utils";
export const DEFAULT_CONFIG = new Configuration({

View File

@ -1,4 +1,4 @@
import { Event } from "./models";
import { Event } from "authentik-api";
export interface EventUser {
pk: number;

View File

@ -1,4 +1,4 @@
import { ChallengeTypeEnum } from "./models";
import { ChallengeTypeEnum } from "authentik-api";
export interface Error {
code: string;

View File

@ -1,6 +1,5 @@
import { CoreApi } from "./apis";
import { CoreApi, User } from "authentik-api";
import { DEFAULT_CONFIG } from "./Config";
import { User } from "./models";
let _globalMePromise: Promise<User>;
export function me(): Promise<User> {