web: make sure naming matches backend

This commit is contained in:
Jens Langhammer 2020-12-16 23:02:43 +01:00
parent 2d9efe035e
commit 3b7bba5a62
35 changed files with 64 additions and 62 deletions

View file

@ -1,4 +1,4 @@
import { DefaultClient, PBResponse, QueryArguments } from "./client";
import { DefaultClient, PBResponse, QueryArguments } from "./Client";
export class Application {
pk: string;

View file

@ -1,4 +1,4 @@
import { DefaultClient, PBResponse, QueryArguments } from "./client";
import { DefaultClient, PBResponse, QueryArguments } from "./Client";
export enum FlowDesignation {
Authentication = "authentication",

24
web/src/api/Policies.ts Normal file
View file

@ -0,0 +1,24 @@
import { DefaultClient, PBResponse, QueryArguments } from "./Client";
export class Policy {
pk: string;
name: string;
constructor() {
throw Error();
}
static get(pk: string): Promise<Policy> {
return DefaultClient.fetch<Policy>(["policies", "all", pk]);
}
static list(filter?: QueryArguments): Promise<PBResponse<Policy>> {
return DefaultClient.fetch<PBResponse<Policy>>(["policies", "all"], filter);
}
static cached(): Promise<number> {
return DefaultClient.fetch<PBResponse<Policy>>(["policies", "cached"]).then(r => {
return r.pagination.count;
});
}
}

View file

@ -1,27 +1,5 @@
import { DefaultClient, PBResponse, QueryArguments } from "./client";
export class Policy {
pk: string;
name: string;
constructor() {
throw Error();
}
static get(pk: string): Promise<Policy> {
return DefaultClient.fetch<Policy>(["policies", "all", pk]);
}
static list(filter?: QueryArguments): Promise<PBResponse<Policy>> {
return DefaultClient.fetch<PBResponse<Policy>>(["policies", "all"], filter);
}
static cached(): Promise<number> {
return DefaultClient.fetch<PBResponse<Policy>>(["policies", "cached"]).then(r => {
return r.pagination.count;
});
}
}
import { DefaultClient, PBResponse, QueryArguments } from "./Client";
import { Policy } from "./Policies";
export class PolicyBinding {
pk: string;

View file

@ -1,4 +1,4 @@
import { DefaultClient, PBResponse, QueryArguments } from "./client";
import { DefaultClient, PBResponse, QueryArguments } from "./Client";
export class Provider {
pk: number;

View file

@ -1,4 +1,4 @@
import { DefaultClient, PBResponse, QueryArguments } from "./client";
import { DefaultClient, PBResponse, QueryArguments } from "./Client";
export class Source {
pk: string;

View file

@ -1,4 +1,4 @@
import { DefaultClient } from "./client";
import { DefaultClient } from "./Client";
interface TokenResponse {
key: string;

View file

@ -1,4 +1,4 @@
import { DefaultClient, PBResponse } from "./client";
import { DefaultClient, PBResponse } from "./Client";
let _globalMePromise: Promise<User>;

View file

@ -1,4 +1,4 @@
import { DefaultClient } from "./client";
import { DefaultClient } from "./Client";
export class Version {

View file

@ -1,4 +1,4 @@
import { NotFoundError, RequestError } from "./errors";
import { NotFoundError, RequestError } from "./Error";
export const VERSION = "v2beta";

View file

@ -1,4 +1,4 @@
import { DefaultClient } from "./client";
import { DefaultClient } from "./Client";
import * as Sentry from "@sentry/browser";
import { Integrations } from "@sentry/tracing";
import { VERSION } from "../constants";

View file

@ -1,4 +1,4 @@
import { DefaultClient } from "./client";
import { DefaultClient } from "./Client";
export class AuditEvent {
//audit/events/top_per_user/?filter_action=authorize_application

View file

@ -3,7 +3,7 @@ import { css, CSSResult, customElement, html, LitElement, property, TemplateResu
import GlobalsStyle from "@patternfly/patternfly/base/patternfly-globals.css";
// @ts-ignore
import ButtonStyle from "@patternfly/patternfly/components/Button/button.css";
import { tokenByIdentifier } from "../../api/token";
import { tokenByIdentifier } from "../../api/Tokens";
import { ColorStyles, ERROR_CLASS, PRIMARY_CLASS, SUCCESS_CLASS } from "../../constants";
@customElement("ak-token-copy-button")

View file

@ -1,6 +1,6 @@
import { gettext } from "django";
import { LitElement, html, customElement, TemplateResult, property } from "lit-element";
import { DefaultClient } from "../../api/client";
import { DefaultClient } from "../../api/Client";
import "./Message";
import { APIMessage } from "./Message";

View file

@ -1,8 +1,8 @@
import { gettext } from "django";
import { customElement, html, property, TemplateResult } from "lit-element";
import { PBResponse } from "../../api/client";
import { PolicyBinding } from "../../api/policy";
import { PBResponse } from "../../api/Client";
import { Table } from "../../elements/table/Table";
import { PolicyBinding } from "../../api/PolicyBindings";
import "../../elements/Tabs";
import "../../elements/AdminLoginsChart";

View file

@ -3,7 +3,7 @@ import { css, CSSResult, customElement, html, LitElement, property, TemplateResu
import PageStyle from "@patternfly/patternfly/components/Page/page.css";
// @ts-ignore
import GlobalsStyle from "@patternfly/patternfly/base/patternfly-globals.css";
import { Config } from "../../api/config";
import { Config } from "../../api/Config";
export const DefaultConfig: Config = {
branding_logo: " /static/dist/assets/icons/icon_left_brand.svg",

View file

@ -5,7 +5,7 @@ import NavStyle from "@patternfly/patternfly/components/Nav/nav.css";
import fa from "@fortawesome/fontawesome-free/css/all.css";
// @ts-ignore
import AvatarStyle from "@patternfly/patternfly/components/Avatar/avatar.css";
import { User } from "../../api/user";
import { User } from "../../api/Users";
import { until } from "lit-html/directives/until";
@customElement("ak-sidebar-user")

View file

@ -1,6 +1,6 @@
import { gettext } from "django";
import { CSSResult, html, LitElement, property, TemplateResult } from "lit-element";
import { PBResponse } from "../../api/client";
import { PBResponse } from "../../api/Client";
import { COMMON_STYLES } from "../../common/styles";
import "./TablePagination";

View file

@ -1,6 +1,6 @@
import { CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element";
import { COMMON_STYLES } from "../../common/styles";
import { PBPagination } from "../../api/client";
import { PBPagination } from "../../api/Client";
@customElement("ak-table-pagination")
export class TablePagination extends LitElement {

View file

@ -1,5 +1,5 @@
import { customElement } from "lit-element";
import { User } from "../api/user";
import { User } from "../api/Users";
import { SidebarItem } from "../elements/sidebar/Sidebar";
import { SLUG_REGEX } from "../elements/router/Route";
import { Interface } from "./Interface";

View file

@ -1,8 +1,8 @@
import { gettext } from "django";
import { css, CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element";
import { ifDefined } from "lit-html/directives/if-defined";
import { Application } from "../api/application";
import { PBResponse } from "../api/client";
import { Application } from "../api/Applications";
import { PBResponse } from "../api/Client";
import { COMMON_STYLES } from "../common/styles";
import { loading, truncate } from "../utils";

View file

@ -1,7 +1,7 @@
import { gettext } from "django";
import { CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element";
import { DefaultClient } from "../../api/client";
import { User } from "../../api/user";
import { DefaultClient } from "../../api/Client";
import { User } from "../../api/Users";
import { COMMON_STYLES } from "../../common/styles";
import "../../elements/AdminLoginsChart";

View file

@ -1,6 +1,6 @@
import { gettext } from "django";
import { CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element";
import { AuditEvent, TopNEvent } from "../../api/events";
import { AuditEvent, TopNEvent } from "../../api/Events";
import { COMMON_STYLES } from "../../common/styles";
import "../../elements/Spinner";

View file

@ -1,6 +1,6 @@
import { gettext } from "django";
import { customElement, html, TemplateResult } from "lit-element";
import { Flow } from "../../../api/flow";
import { Flow } from "../../../api/Flows";
import { AdminStatus, AdminStatusCard } from "./AdminStatusCard";
import "../../../elements/buttons/ModalButton";

View file

@ -1,7 +1,7 @@
import { gettext } from "django";
import { customElement } from "lit-element";
import { TemplateResult, html } from "lit-html";
import { Policy } from "../../../api/policy";
import { Policy } from "../../../api/Policies";
import { AdminStatusCard, AdminStatus } from "./AdminStatusCard";
import "../../../elements/buttons/ModalButton";

View file

@ -1,6 +1,6 @@
import { gettext } from "django";
import { customElement } from "lit-element";
import { Policy } from "../../../api/policy";
import { Policy } from "../../../api/Policies";
import { AdminStatusCard, AdminStatus } from "./AdminStatusCard";
@customElement("ak-admin-status-card-policy-unbound")

View file

@ -1,6 +1,6 @@
import { gettext } from "django";
import { customElement } from "lit-element";
import { Provider } from "../../../api/provider";
import { Provider } from "../../../api/Providers";
import { AdminStatusCard, AdminStatus } from "./AdminStatusCard";
@customElement("ak-admin-status-card-provider")

View file

@ -1,6 +1,6 @@
import { gettext } from "django";
import { customElement } from "lit-element";
import { Version } from "../../../api/version";
import { Version } from "../../../api/Versions";
import { AdminStatusCard, AdminStatus } from "./AdminStatusCard";
@customElement("ak-admin-status-version")

View file

@ -1,6 +1,6 @@
import { gettext } from "django";
import { customElement } from "lit-element";
import { DefaultClient, PBResponse } from "../../../api/client";
import { DefaultClient, PBResponse } from "../../../api/Client";
import { AdminStatus, AdminStatusCard } from "./AdminStatusCard";
@customElement("ak-admin-status-card-workers")

View file

@ -1,7 +1,7 @@
import { gettext } from "django";
import { customElement, html, TemplateResult } from "lit-element";
import { Application } from "../../api/application";
import { PBResponse } from "../../api/client";
import { Application } from "../../api/Applications";
import { PBResponse } from "../../api/Client";
import { TablePage } from "../../elements/table/TablePage";
import "../../elements/buttons/ModalButton";

View file

@ -1,7 +1,7 @@
import { gettext } from "django";
import { css, CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element";
import { Application } from "../../api/application";
import { DefaultClient } from "../../api/client";
import { Application } from "../../api/Applications";
import { DefaultClient } from "../../api/Client";
import { COMMON_STYLES } from "../../common/styles";
import "../../elements/Tabs";

View file

@ -1,6 +1,6 @@
import { gettext } from "django";
import { customElement, html, property, TemplateResult } from "lit-element";
import { PBResponse } from "../../api/client";
import { PBResponse } from "../../api/Client";
import { Table } from "../../elements/table/Table";
import "../../elements/Tabs";
@ -8,7 +8,7 @@ import "../../elements/AdminLoginsChart";
import "../../elements/buttons/ModalButton";
import "../../elements/buttons/SpinnerButton";
import "../../elements/policies/BoundPoliciesList";
import { FlowStageBinding } from "../../api/flow";
import { FlowStageBinding } from "../../api/Flows";
@customElement("ak-bound-stages-list")
export class BoundStagesList extends Table<FlowStageBinding> {

View file

@ -1,7 +1,7 @@
import { gettext } from "django";
import { css, CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element";
import { COMMON_STYLES } from "../../common/styles";
import { Flow } from "../../api/flow";
import { Flow } from "../../api/Flows";
import "../../elements/Tabs";
import "../../elements/AdminLoginsChart";

View file

@ -7,7 +7,7 @@ import "../../elements/AdminLoginsChart";
import "../../elements/buttons/ModalButton";
import "../../elements/buttons/SpinnerButton";
import "../../elements/policies/BoundPoliciesList";
import { Source } from "../../api/source";
import { Source } from "../../api/Sources";
@customElement("ak-source-view")
export class SourceViewPage extends LitElement {