Skip to content

Commit

Permalink
update gen
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Jul 23, 2023
1 parent 245b43b commit d4a2834
Show file tree
Hide file tree
Showing 10 changed files with 422 additions and 50 deletions.
9 changes: 9 additions & 0 deletions src/generated/backend/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {PlanTag} from "./PlanTag";
import {PageTag} from "./PageTag";
import {MarketplaceTag} from "./MarketplaceTag";
import {LogTag} from "./LogTag";
import {IdentityTag} from "./IdentityTag";
import {GeneratorTag} from "./GeneratorTag";
import {EventTag} from "./EventTag";
import {DashboardTag} from "./DashboardTag";
Expand Down Expand Up @@ -146,6 +147,14 @@ export class Client extends ClientAbstract {
);
}

public identity(): IdentityTag
{
return new IdentityTag(
this.httpClient,
this.parser
);
}

public generator(): GeneratorTag
{
return new GeneratorTag(
Expand Down
22 changes: 22 additions & 0 deletions src/generated/backend/Identity.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Identity automatically generated by SDKgen please do not edit this file manually
* {@link https://sdkgen.app}
*/

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
allowCreate?: boolean
}
8 changes: 8 additions & 0 deletions src/generated/backend/IdentityCollection.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* IdentityCollection automatically generated by SDKgen please do not edit this file manually
* {@link https://sdkgen.app}
*/

import {Collection} from "./Collection";
import {Identity} from "./Identity";
export type IdentityCollection = Collection<Identity>;
8 changes: 8 additions & 0 deletions src/generated/backend/IdentityCreate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* IdentityCreate automatically generated by SDKgen please do not edit this file manually
* {@link https://sdkgen.app}
*/

import {Identity} from "./Identity";
export interface IdentityCreate extends Identity {
}
228 changes: 228 additions & 0 deletions src/generated/backend/IdentityTag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
/**
* IdentityTag automatically generated by SDKgen please do not edit this file manually
* {@link https://sdkgen.app}
*/

import axios, {AxiosRequestConfig} from "axios";
import {TagAbstract} from "sdkgen-client"
import {ClientException, UnknownStatusCodeException} from "sdkgen-client";

import {Identity} from "./Identity";
import {IdentityCollection} from "./IdentityCollection";
import {IdentityCreate} from "./IdentityCreate";
import {IdentityUpdate} from "./IdentityUpdate";
import {Message} from "./Message";
import {MessageException} from "./MessageException";

export class IdentityTag extends TagAbstract {
/**
* @returns {Promise<Message>}
* @throws {MessageException}
* @throws {ClientException}
*/
public async delete(identityId: string): Promise<Message> {
const url = this.parser.url('/backend/identity/$identity_id<[0-9]+|^~>', {
'identity_id': identityId,
});

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

try {
const response = await this.httpClient.request<Message>(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 404:
throw new MessageException(error.response.data);
case 410:
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}
* @throws {ClientException}
*/
public async update(identityId: string, payload: IdentityUpdate): Promise<Message> {
const url = this.parser.url('/backend/identity/$identity_id<[0-9]+|^~>', {
'identity_id': identityId,
});

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

try {
const response = await this.httpClient.request<Message>(params);
return response.data;
} catch (error) {
if (error instanceof ClientException) {
throw error;
} else if (axios.isAxiosError(error) && error.response) {
switch (error.response.status) {
case 400:
throw new MessageException(error.response.data);
case 401:
throw new MessageException(error.response.data);
case 404:
throw new MessageException(error.response.data);
case 410:
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<Identity>}
* @throws {MessageException}
* @throws {ClientException}
*/
public async get(identityId: string): Promise<Identity> {
const url = this.parser.url('/backend/identity/$identity_id<[0-9]+|^~>', {
'identity_id': identityId,
});

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

try {
const response = await this.httpClient.request<Identity>(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 404:
throw new MessageException(error.response.data);
case 410:
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}
* @throws {ClientException}
*/
public async create(payload: IdentityCreate): Promise<Message> {
const url = this.parser.url('/backend/identity', {
});

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

try {
const response = await this.httpClient.request<Message>(params);
return response.data;
} catch (error) {
if (error instanceof ClientException) {
throw error;
} else if (axios.isAxiosError(error) && error.response) {
switch (error.response.status) {
case 400:
throw new MessageException(error.response.data);
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<IdentityCollection>}
* @throws {MessageException}
* @throws {ClientException}
*/
public async getAll(startIndex?: number, count?: number, search?: string): Promise<IdentityCollection> {
const url = this.parser.url('/backend/identity', {
});

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

try {
const response = await this.httpClient.request<IdentityCollection>(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));
}
}
}


}
8 changes: 8 additions & 0 deletions src/generated/backend/IdentityUpdate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* IdentityUpdate automatically generated by SDKgen please do not edit this file manually
* {@link https://sdkgen.app}
*/

import {Identity} from "./Identity";
export interface IdentityUpdate extends Identity {
}
40 changes: 0 additions & 40 deletions src/generated/consumer/AccountTag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {UserEmail} from "./UserEmail";
import {UserJWT} from "./UserJWT";
import {UserLogin} from "./UserLogin";
import {UserPasswordReset} from "./UserPasswordReset";
import {UserProvider} from "./UserProvider";
import {UserRefresh} from "./UserRefresh";
import {UserRegister} from "./UserRegister";

Expand Down Expand Up @@ -138,45 +137,6 @@ export class AccountTag extends TagAbstract {
}
}

/**
* @returns {Promise<UserJWT>}
* @throws {MessageException}
* @throws {ClientException}
*/
public async provider(provider: string, payload: UserProvider): Promise<UserJWT> {
const url = this.parser.url('/consumer/provider/:provider', {
'provider': provider,
});

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

try {
const response = await this.httpClient.request<UserJWT>(params);
return response.data;
} catch (error) {
if (error instanceof ClientException) {
throw error;
} else if (axios.isAxiosError(error) && error.response) {
switch (error.response.status) {
case 400:
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<UserJWT>}
* @throws {MessageException}
Expand Down
9 changes: 9 additions & 0 deletions src/generated/consumer/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import axios, {AxiosRequestConfig} from "axios";
import {ClientAbstract, TokenStoreInterface} from "sdkgen-client"
import {ClientException, UnknownStatusCodeException} from "sdkgen-client";

import {IdentityTag} from "./IdentityTag";
import {AccountTag} from "./AccountTag";
import {TransactionTag} from "./TransactionTag";
import {SubscriptionTag} from "./SubscriptionTag";
Expand All @@ -20,6 +21,14 @@ import {EventTag} from "./EventTag";
import {AppTag} from "./AppTag";

export class Client extends ClientAbstract {
public identity(): IdentityTag
{
return new IdentityTag(
this.httpClient,
this.parser
);
}

public account(): AccountTag
{
return new AccountTag(
Expand Down
Loading

0 comments on commit d4a2834

Please sign in to comment.