Skip to content

Commit

Permalink
update gen
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Jul 25, 2023
1 parent 267173f commit 4460f20
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/generated/backend/GeneratorTag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class GeneratorTag extends TagAbstract {
* @throws {MessageException}
* @throws {ClientException}
*/
public async getProviderForm(provider: string): Promise<FormContainer> {
public async getForm(provider: string): Promise<FormContainer> {
const url = this.parser.url('/backend/generator/:provider', {
'provider': provider,
});
Expand Down Expand Up @@ -137,7 +137,7 @@ export class GeneratorTag extends TagAbstract {
* @throws {MessageException}
* @throws {ClientException}
*/
public async getProviders(): Promise<GeneratorIndexProviders> {
public async getClasses(): Promise<GeneratorIndexProviders> {
const url = this.parser.url('/backend/generator', {
});

Expand Down
10 changes: 2 additions & 8 deletions src/generated/backend/Identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@
* {@link https://sdkgen.app}
*/

import {IdentityConfig} from "./IdentityConfig";
export interface Identity {
id?: number
appId?: number
roleId?: number
name?: string
icon?: string
class?: string
clientId?: string
clientSecret?: string
authorizationUri?: string
tokenUri?: string
userInfoUri?: string
idProperty?: string
nameProperty?: string
emailProperty?: string
config?: IdentityConfig
allowCreate?: boolean
}
6 changes: 6 additions & 0 deletions src/generated/backend/IdentityConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* IdentityConfig automatically generated by SDKgen please do not edit this file manually
* {@link https://sdkgen.app}
*/

export type IdentityConfig = Record<string, any>;
9 changes: 9 additions & 0 deletions src/generated/backend/IdentityIndex.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* IdentityIndex automatically generated by SDKgen please do not edit this file manually
* {@link https://sdkgen.app}
*/

import {IdentityIndexEntry} from "./IdentityIndexEntry";
export interface IdentityIndex {
providers?: Array<IdentityIndexEntry>
}
9 changes: 9 additions & 0 deletions src/generated/backend/IdentityIndexEntry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* IdentityIndexEntry automatically generated by SDKgen please do not edit this file manually
* {@link https://sdkgen.app}
*/

export interface IdentityIndexEntry {
name?: string
class?: string
}
77 changes: 77 additions & 0 deletions src/generated/backend/IdentityTag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ import axios, {AxiosRequestConfig} from "axios";
import {TagAbstract} from "sdkgen-client"
import {ClientException, UnknownStatusCodeException} from "sdkgen-client";

import {FormContainer} from "./FormContainer";
import {Identity} from "./Identity";
import {IdentityCollection} from "./IdentityCollection";
import {IdentityCreate} from "./IdentityCreate";
import {IdentityIndex} from "./IdentityIndex";
import {IdentityUpdate} from "./IdentityUpdate";
import {Message} from "./Message";
import {MessageException} from "./MessageException";
Expand Down Expand Up @@ -144,6 +146,81 @@ export class IdentityTag extends TagAbstract {
}
}

/**
* @returns {Promise<FormContainer>}
* @throws {MessageException}
* @throws {ClientException}
*/
public async getForm(_class?: string): Promise<FormContainer> {
const url = this.parser.url('/backend/identity/form', {
});

let params: AxiosRequestConfig = {
url: url,
method: 'GET',
params: this.parser.query({
'class': _class,
}),
};

try {
const response = await this.httpClient.request<FormContainer>(params);
return response.data;
} catch (error) {
if (error instanceof ClientException) {
throw error;
} else if (axios.isAxiosError(error) && error.response) {
switch (error.response.status) {
case 401:
throw new MessageException(error.response.data);
case 500:
throw new MessageException(error.response.data);
default:
throw new UnknownStatusCodeException('The server returned an unknown status code');
}
} else {
throw new ClientException('An unknown error occurred: ' + String(error));
}
}
}

/**
* @returns {Promise<IdentityIndex>}
* @throws {MessageException}
* @throws {ClientException}
*/
public async getClasses(): Promise<IdentityIndex> {
const url = this.parser.url('/backend/identity/list', {
});

let params: AxiosRequestConfig = {
url: url,
method: 'GET',
params: this.parser.query({
}),
};

try {
const response = await this.httpClient.request<IdentityIndex>(params);
return response.data;
} catch (error) {
if (error instanceof ClientException) {
throw error;
} else if (axios.isAxiosError(error) && error.response) {
switch (error.response.status) {
case 401:
throw new MessageException(error.response.data);
case 500:
throw new MessageException(error.response.data);
default:
throw new UnknownStatusCodeException('The server returned an unknown status code');
}
} else {
throw new ClientException('An unknown error occurred: ' + String(error));
}
}
}

/**
* @returns {Promise<Message>}
* @throws {MessageException}
Expand Down

0 comments on commit 4460f20

Please sign in to comment.