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