diff --git a/frontend/src/app/core/api/.openapi-generator/FILES b/frontend/src/app/core/api/.openapi-generator/FILES index 9505d8c..f3d80a3 100644 --- a/frontend/src/app/core/api/.openapi-generator/FILES +++ b/frontend/src/app/core/api/.openapi-generator/FILES @@ -6,6 +6,7 @@ api/api.ts api/badwords.service.ts api/email.service.ts api/hoods.service.ts +api/mastodon.service.ts api/telegram.service.ts api/test.service.ts api/triggers.service.ts @@ -16,9 +17,9 @@ git_push.sh index.ts model/bodyAccessToken.ts model/bodyAdmin.ts -model/bodyAdminLoginAdminLoginPost.ts model/bodyBadWord.ts model/bodyHood.ts +model/bodyLogin.ts model/bodyPassword.ts model/bodySubscriber.ts model/bodyTelegram.ts diff --git a/frontend/src/app/core/api/api.module.ts b/frontend/src/app/core/api/api.module.ts index 606119d..b3a7ddb 100644 --- a/frontend/src/app/core/api/api.module.ts +++ b/frontend/src/app/core/api/api.module.ts @@ -6,6 +6,7 @@ import { AdminService } from './api/admin.service'; import { BadwordsService } from './api/badwords.service'; import { EmailService } from './api/email.service'; import { HoodsService } from './api/hoods.service'; +import { MastodonService } from './api/mastodon.service'; import { TelegramService } from './api/telegram.service'; import { TestService } from './api/test.service'; import { TriggersService } from './api/triggers.service'; diff --git a/frontend/src/app/core/api/api/admin.service.ts b/frontend/src/app/core/api/api/admin.service.ts index ab1b2c9..665a6f0 100644 --- a/frontend/src/app/core/api/api/admin.service.ts +++ b/frontend/src/app/core/api/api/admin.service.ts @@ -33,7 +33,7 @@ import { Configuration } from '../configurat }) export class AdminService { - protected basePath = 'http://localhost'; + protected basePath = 'http://localhost:8000/api'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); public encoder: HttpParameterCodec; @@ -136,7 +136,7 @@ export class AdminService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/admin/confirm/${encodeURIComponent(String(registerToken))}`, + return this.httpClient.post(`${this.configuration.basePath}/admin/confirm/${encodeURIComponent(String(registerToken))}`, null, { responseType: responseType, @@ -195,7 +195,7 @@ export class AdminService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/admin/reset/${encodeURIComponent(String(resetToken))}`, + return this.httpClient.post(`${this.configuration.basePath}/admin/reset/${encodeURIComponent(String(resetToken))}`, bodyPassword, { responseType: responseType, @@ -243,7 +243,7 @@ export class AdminService { responseType = 'text'; } - return this.httpClient.delete(`${this.configuration.basePath}/api/admin/`, + return this.httpClient.delete(`${this.configuration.basePath}/admin/`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -256,7 +256,7 @@ export class AdminService { /** * Admin Read - * Get a list of all hoods of a given admin. + * Get a list of all hoods of a given admin. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -292,7 +292,7 @@ export class AdminService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/admin/`, + return this.httpClient.get(`${this.configuration.basePath}/admin/`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -305,7 +305,7 @@ export class AdminService { /** * Admin Hood Read All - * Get a list of all hoods of a given admin. + * Get a list of all hoods of a given admin. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -341,7 +341,7 @@ export class AdminService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/admin/hoods/`, + return this.httpClient.get(`${this.configuration.basePath}/admin/hoods/`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -429,7 +429,7 @@ export class AdminService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/admin/login/`, + return this.httpClient.post(`${this.configuration.basePath}/admin/login/`, convertFormParamsToString ? formParams.toString() : formParams, { responseType: responseType, @@ -485,7 +485,7 @@ export class AdminService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/admin/register/`, + return this.httpClient.post(`${this.configuration.basePath}/admin/register/`, bodyAdmin, { responseType: responseType, @@ -541,7 +541,7 @@ export class AdminService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/admin/reset/`, + return this.httpClient.post(`${this.configuration.basePath}/admin/reset/`, kibicaraWebapiAdminBodyEmail, { responseType: responseType, diff --git a/frontend/src/app/core/api/api/api.ts b/frontend/src/app/core/api/api/api.ts index b9c2089..69e9b19 100644 --- a/frontend/src/app/core/api/api/api.ts +++ b/frontend/src/app/core/api/api/api.ts @@ -6,6 +6,8 @@ export * from './email.service'; import { EmailService } from './email.service'; export * from './hoods.service'; import { HoodsService } from './hoods.service'; +export * from './mastodon.service'; +import { MastodonService } from './mastodon.service'; export * from './telegram.service'; import { TelegramService } from './telegram.service'; export * from './test.service'; @@ -14,4 +16,4 @@ export * from './triggers.service'; import { TriggersService } from './triggers.service'; export * from './twitter.service'; import { TwitterService } from './twitter.service'; -export const APIS = [AdminService, BadwordsService, EmailService, HoodsService, TelegramService, TestService, TriggersService, TwitterService]; +export const APIS = [AdminService, BadwordsService, EmailService, HoodsService, MastodonService, TelegramService, TestService, TriggersService, TwitterService]; diff --git a/frontend/src/app/core/api/api/badwords.service.ts b/frontend/src/app/core/api/api/badwords.service.ts index ccc62f2..da66dfa 100644 --- a/frontend/src/app/core/api/api/badwords.service.ts +++ b/frontend/src/app/core/api/api/badwords.service.ts @@ -30,7 +30,7 @@ import { Configuration } from '../configurat }) export class BadwordsService { - protected basePath = 'http://localhost'; + protected basePath = 'http://localhost:8000/api'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); public encoder: HttpParameterCodec; @@ -140,7 +140,7 @@ export class BadwordsService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/badwords/`, + return this.httpClient.post(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/badwords/`, bodyBadWord, { responseType: responseType, @@ -154,7 +154,7 @@ export class BadwordsService { /** * Badword Delete - * Deletes badword with id **badword_id** for hood with id **hood_id**. + * Deletes badword with id **badword_id** for hood with id **hood_id**. * @param badwordId * @param hoodId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -198,7 +198,7 @@ export class BadwordsService { responseType = 'text'; } - return this.httpClient.delete(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/badwords/${encodeURIComponent(String(badwordId))}`, + return this.httpClient.delete(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/badwords/${encodeURIComponent(String(badwordId))}`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -211,7 +211,7 @@ export class BadwordsService { /** * Badword Read - * Reads badword with id **badword_id** for hood with id **hood_id**. + * Reads badword with id **badword_id** for hood with id **hood_id**. * @param badwordId * @param hoodId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -255,7 +255,7 @@ export class BadwordsService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/badwords/${encodeURIComponent(String(badwordId))}`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/badwords/${encodeURIComponent(String(badwordId))}`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -268,7 +268,7 @@ export class BadwordsService { /** * Badword Read All - * Get all badwords of hood with id **hood_id**. + * Get all badwords of hood with id **hood_id**. * @param hoodId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -308,7 +308,7 @@ export class BadwordsService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/badwords/`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/badwords/`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -378,7 +378,7 @@ export class BadwordsService { responseType = 'text'; } - return this.httpClient.put(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/badwords/${encodeURIComponent(String(badwordId))}`, + return this.httpClient.put(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/badwords/${encodeURIComponent(String(badwordId))}`, bodyBadWord, { responseType: responseType, diff --git a/frontend/src/app/core/api/api/email.service.ts b/frontend/src/app/core/api/api/email.service.ts index bd64617..526622c 100644 --- a/frontend/src/app/core/api/api/email.service.ts +++ b/frontend/src/app/core/api/api/email.service.ts @@ -32,7 +32,7 @@ import { Configuration } from '../configurat }) export class EmailService { - protected basePath = 'http://localhost'; + protected basePath = 'http://localhost:8000/api'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); public encoder: HttpParameterCodec; @@ -126,7 +126,7 @@ export class EmailService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/email/subscribe/confirm/${encodeURIComponent(String(token))}`, + return this.httpClient.post(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/email/subscribe/confirm/${encodeURIComponent(String(token))}`, null, { responseType: responseType, @@ -193,7 +193,7 @@ export class EmailService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/email/`, + return this.httpClient.post(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/email/`, kibicaraPlatformsEmailWebapiBodyEmail, { responseType: responseType, @@ -207,7 +207,7 @@ export class EmailService { /** * Email Delete - * Delete an Email bot. Stops and deletes the Email bot. :param hood: Hood the Email bot belongs to. + * Delete an Email bot. Stops and deletes the Email bot. :param hood: Hood the Email bot belongs to. * @param emailId * @param hoodId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -251,7 +251,7 @@ export class EmailService { responseType = 'text'; } - return this.httpClient.delete(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/email/${encodeURIComponent(String(emailId))}`, + return this.httpClient.delete(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/email/${encodeURIComponent(String(emailId))}`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -307,7 +307,7 @@ export class EmailService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/email/${encodeURIComponent(String(emailId))}`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/email/${encodeURIComponent(String(emailId))}`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -359,7 +359,7 @@ export class EmailService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/email/`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/email/`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -404,7 +404,7 @@ export class EmailService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/email/public`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/email/public`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -460,7 +460,7 @@ export class EmailService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/email/subscribers/${encodeURIComponent(String(subscriberId))}`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/email/subscribers/${encodeURIComponent(String(subscriberId))}`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -512,7 +512,7 @@ export class EmailService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/email/subscribers/`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/email/subscribers/`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -571,7 +571,7 @@ export class EmailService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/email/messages/`, + return this.httpClient.post(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/email/messages/`, kibicaraPlatformsEmailWebapiBodyMessage, { responseType: responseType, @@ -624,7 +624,7 @@ export class EmailService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/email/start`, + return this.httpClient.post(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/email/start`, null, { responseType: responseType, @@ -677,7 +677,7 @@ export class EmailService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/email/status`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/email/status`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -729,7 +729,7 @@ export class EmailService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/email/stop`, + return this.httpClient.post(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/email/stop`, null, { responseType: responseType, @@ -789,7 +789,7 @@ export class EmailService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/email/subscribe/`, + return this.httpClient.post(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/email/subscribe/`, bodySubscriber, { responseType: responseType, @@ -840,7 +840,7 @@ export class EmailService { responseType = 'text'; } - return this.httpClient.delete(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/email/unsubscribe/${encodeURIComponent(String(token))}`, + return this.httpClient.delete(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/email/unsubscribe/${encodeURIComponent(String(token))}`, { responseType: responseType, withCredentials: this.configuration.withCredentials, diff --git a/frontend/src/app/core/api/api/hoods.service.ts b/frontend/src/app/core/api/api/hoods.service.ts index 51ed5ac..583c40b 100644 --- a/frontend/src/app/core/api/api/hoods.service.ts +++ b/frontend/src/app/core/api/api/hoods.service.ts @@ -30,7 +30,7 @@ import { Configuration } from '../configurat }) export class HoodsService { - protected basePath = 'http://localhost'; + protected basePath = 'http://localhost:8000/api'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); public encoder: HttpParameterCodec; @@ -136,7 +136,7 @@ export class HoodsService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/hoods/`, + return this.httpClient.post(`${this.configuration.basePath}/hoods/`, bodyHood, { responseType: responseType, @@ -150,7 +150,7 @@ export class HoodsService { /** * Hood Delete - * Deletes hood with id **hood_id**. + * Deletes hood with id **hood_id**. * @param hoodId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -190,7 +190,7 @@ export class HoodsService { responseType = 'text'; } - return this.httpClient.delete(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}`, + return this.httpClient.delete(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -203,7 +203,7 @@ export class HoodsService { /** * Hood Read - * Get hood with id **hood_id**. + * Get hood with id **hood_id**. * @param hoodId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -236,7 +236,7 @@ export class HoodsService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -249,7 +249,7 @@ export class HoodsService { /** * Hood Read All - * Get all existing hoods. + * Get all existing hoods. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -278,7 +278,7 @@ export class HoodsService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -344,7 +344,7 @@ export class HoodsService { responseType = 'text'; } - return this.httpClient.put(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}`, + return this.httpClient.put(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}`, bodyHood, { responseType: responseType, diff --git a/frontend/src/app/core/api/api/mastodon.service.ts b/frontend/src/app/core/api/api/mastodon.service.ts new file mode 100644 index 0000000..f937044 --- /dev/null +++ b/frontend/src/app/core/api/api/mastodon.service.ts @@ -0,0 +1,547 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +import { HTTPValidationError } from '../model/models'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class MastodonService { + + protected basePath = 'http://localhost:8000/api'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Mastodon Create + * Add a Mastodon Account to a Ticketfrei account. open questions: do we really get the username + password like this? can the instance_url have different ways of writing? :param: instance_url: the API base URL of the mastodon server :param: username: the username of the Mastodon account :param: password: the password of the Mastodon account :param: hood: the hood ORM object + * @param hoodId + * @param instanceUrl + * @param username + * @param password + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createMastodon(hoodId: number, instanceUrl: any, username: any, password: any, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; + public createMastodon(hoodId: number, instanceUrl: any, username: any, password: any, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public createMastodon(hoodId: number, instanceUrl: any, username: any, password: any, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public createMastodon(hoodId: number, instanceUrl: any, username: any, password: any, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + if (hoodId === null || hoodId === undefined) { + throw new Error('Required parameter hoodId was null or undefined when calling createMastodon.'); + } + if (instanceUrl === null || instanceUrl === undefined) { + throw new Error('Required parameter instanceUrl was null or undefined when calling createMastodon.'); + } + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling createMastodon.'); + } + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling createMastodon.'); + } + + let queryParameters = new HttpParams({encoder: this.encoder}); + if (instanceUrl !== undefined && instanceUrl !== null) { + queryParameters = this.addToHttpParams(queryParameters, + instanceUrl, 'instance_url'); + } + if (username !== undefined && username !== null) { + queryParameters = this.addToHttpParams(queryParameters, + username, 'username'); + } + if (password !== undefined && password !== null) { + queryParameters = this.addToHttpParams(queryParameters, + password, 'password'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (OAuth2PasswordBearer) required + credential = this.configuration.lookupCredential('OAuth2PasswordBearer'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/mastodon/`, + null, + { + params: queryParameters, + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Mastodon Delete + * @param mastodonId + * @param hoodId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteMastodon(mastodonId: any, hoodId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; + public deleteMastodon(mastodonId: any, hoodId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public deleteMastodon(mastodonId: any, hoodId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public deleteMastodon(mastodonId: any, hoodId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + if (mastodonId === null || mastodonId === undefined) { + throw new Error('Required parameter mastodonId was null or undefined when calling deleteMastodon.'); + } + if (hoodId === null || hoodId === undefined) { + throw new Error('Required parameter hoodId was null or undefined when calling deleteMastodon.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (OAuth2PasswordBearer) required + credential = this.configuration.lookupCredential('OAuth2PasswordBearer'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.delete(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/mastodon/${encodeURIComponent(String(mastodonId))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Mastodon Read + * @param mastodonId + * @param hoodId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getMastodon(mastodonId: any, hoodId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; + public getMastodon(mastodonId: any, hoodId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public getMastodon(mastodonId: any, hoodId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public getMastodon(mastodonId: any, hoodId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + if (mastodonId === null || mastodonId === undefined) { + throw new Error('Required parameter mastodonId was null or undefined when calling getMastodon.'); + } + if (hoodId === null || hoodId === undefined) { + throw new Error('Required parameter hoodId was null or undefined when calling getMastodon.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (OAuth2PasswordBearer) required + credential = this.configuration.lookupCredential('OAuth2PasswordBearer'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/mastodon/${encodeURIComponent(String(mastodonId))}`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Mastodon Read All + * @param hoodId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getMastodons(hoodId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; + public getMastodons(hoodId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public getMastodons(hoodId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public getMastodons(hoodId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + if (hoodId === null || hoodId === undefined) { + throw new Error('Required parameter hoodId was null or undefined when calling getMastodons.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (OAuth2PasswordBearer) required + credential = this.configuration.lookupCredential('OAuth2PasswordBearer'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/mastodon/`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Mastodon Read All Public + * @param hoodId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getMastodonsPublic(hoodId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; + public getMastodonsPublic(hoodId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public getMastodonsPublic(hoodId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public getMastodonsPublic(hoodId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + if (hoodId === null || hoodId === undefined) { + throw new Error('Required parameter hoodId was null or undefined when calling getMastodonsPublic.'); + } + + let headers = this.defaultHeaders; + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/mastodon/public`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Mastodon Start + * @param mastodonId + * @param hoodId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public startMastodon(mastodonId: any, hoodId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; + public startMastodon(mastodonId: any, hoodId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public startMastodon(mastodonId: any, hoodId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public startMastodon(mastodonId: any, hoodId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + if (mastodonId === null || mastodonId === undefined) { + throw new Error('Required parameter mastodonId was null or undefined when calling startMastodon.'); + } + if (hoodId === null || hoodId === undefined) { + throw new Error('Required parameter hoodId was null or undefined when calling startMastodon.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (OAuth2PasswordBearer) required + credential = this.configuration.lookupCredential('OAuth2PasswordBearer'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/mastodon/${encodeURIComponent(String(mastodonId))}/start`, + null, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Mastodon Status + * @param mastodonId + * @param hoodId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public statusMastodon(mastodonId: any, hoodId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; + public statusMastodon(mastodonId: any, hoodId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public statusMastodon(mastodonId: any, hoodId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public statusMastodon(mastodonId: any, hoodId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + if (mastodonId === null || mastodonId === undefined) { + throw new Error('Required parameter mastodonId was null or undefined when calling statusMastodon.'); + } + if (hoodId === null || hoodId === undefined) { + throw new Error('Required parameter hoodId was null or undefined when calling statusMastodon.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (OAuth2PasswordBearer) required + credential = this.configuration.lookupCredential('OAuth2PasswordBearer'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/mastodon/${encodeURIComponent(String(mastodonId))}/status`, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Mastodon Stop + * @param mastodonId + * @param hoodId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public stopMastodon(mastodonId: any, hoodId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable; + public stopMastodon(mastodonId: any, hoodId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public stopMastodon(mastodonId: any, hoodId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json'}): Observable>; + public stopMastodon(mastodonId: any, hoodId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json'}): Observable { + if (mastodonId === null || mastodonId === undefined) { + throw new Error('Required parameter mastodonId was null or undefined when calling stopMastodon.'); + } + if (hoodId === null || hoodId === undefined) { + throw new Error('Required parameter hoodId was null or undefined when calling stopMastodon.'); + } + + let headers = this.defaultHeaders; + + let credential: string | undefined; + // authentication (OAuth2PasswordBearer) required + credential = this.configuration.lookupCredential('OAuth2PasswordBearer'); + if (credential) { + headers = headers.set('Authorization', 'Bearer ' + credential); + } + + let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (httpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + + let responseType: 'text' | 'json' = 'json'; + if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) { + responseType = 'text'; + } + + return this.httpClient.post(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/mastodon/${encodeURIComponent(String(mastodonId))}/stop`, + null, + { + responseType: responseType, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/frontend/src/app/core/api/api/telegram.service.ts b/frontend/src/app/core/api/api/telegram.service.ts index 6bb2672..3167896 100644 --- a/frontend/src/app/core/api/api/telegram.service.ts +++ b/frontend/src/app/core/api/api/telegram.service.ts @@ -30,7 +30,7 @@ import { Configuration } from '../configurat }) export class TelegramService { - protected basePath = 'http://localhost'; + protected basePath = 'http://localhost:8000/api'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); public encoder: HttpParameterCodec; @@ -139,7 +139,7 @@ export class TelegramService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/telegram/`, + return this.httpClient.post(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/telegram/`, bodyTelegram, { responseType: responseType, @@ -196,7 +196,7 @@ export class TelegramService { responseType = 'text'; } - return this.httpClient.delete(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/telegram/${encodeURIComponent(String(telegramId))}`, + return this.httpClient.delete(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/telegram/${encodeURIComponent(String(telegramId))}`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -252,7 +252,7 @@ export class TelegramService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/telegram/${encodeURIComponent(String(telegramId))}`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/telegram/${encodeURIComponent(String(telegramId))}`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -304,7 +304,7 @@ export class TelegramService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/telegram/`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/telegram/`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -349,7 +349,7 @@ export class TelegramService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/telegram/public`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/telegram/public`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -405,7 +405,7 @@ export class TelegramService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/telegram/${encodeURIComponent(String(telegramId))}/start`, + return this.httpClient.post(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/telegram/${encodeURIComponent(String(telegramId))}/start`, null, { responseType: responseType, @@ -462,7 +462,7 @@ export class TelegramService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/telegram/${encodeURIComponent(String(telegramId))}/status`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/telegram/${encodeURIComponent(String(telegramId))}/status`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -518,7 +518,7 @@ export class TelegramService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/telegram/${encodeURIComponent(String(telegramId))}/stop`, + return this.httpClient.post(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/telegram/${encodeURIComponent(String(telegramId))}/stop`, null, { responseType: responseType, @@ -588,7 +588,7 @@ export class TelegramService { responseType = 'text'; } - return this.httpClient.put(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/telegram/${encodeURIComponent(String(telegramId))}`, + return this.httpClient.put(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/telegram/${encodeURIComponent(String(telegramId))}`, bodyTelegram, { responseType: responseType, diff --git a/frontend/src/app/core/api/api/test.service.ts b/frontend/src/app/core/api/api/test.service.ts index 1a148e3..b207662 100644 --- a/frontend/src/app/core/api/api/test.service.ts +++ b/frontend/src/app/core/api/api/test.service.ts @@ -30,7 +30,7 @@ import { Configuration } from '../configurat }) export class TestService { - protected basePath = 'http://localhost'; + protected basePath = 'http://localhost:8000/api'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); public encoder: HttpParameterCodec; @@ -126,7 +126,7 @@ export class TestService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/test/`, + return this.httpClient.post(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/test/`, null, { responseType: responseType, @@ -183,7 +183,7 @@ export class TestService { responseType = 'text'; } - return this.httpClient.delete(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/test/${encodeURIComponent(String(testId))}`, + return this.httpClient.delete(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/test/${encodeURIComponent(String(testId))}`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -252,7 +252,7 @@ export class TestService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/test/${encodeURIComponent(String(testId))}/messages/`, + return this.httpClient.post(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/test/${encodeURIComponent(String(testId))}/messages/`, kibicaraPlatformsTestWebapiBodyMessage, { responseType: responseType, @@ -309,7 +309,7 @@ export class TestService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/test/${encodeURIComponent(String(testId))}/messages/`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/test/${encodeURIComponent(String(testId))}/messages/`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -361,7 +361,7 @@ export class TestService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/test/`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/test/`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -417,7 +417,7 @@ export class TestService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/test/${encodeURIComponent(String(testId))}`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/test/${encodeURIComponent(String(testId))}`, { responseType: responseType, withCredentials: this.configuration.withCredentials, diff --git a/frontend/src/app/core/api/api/triggers.service.ts b/frontend/src/app/core/api/api/triggers.service.ts index cd8dffd..28a9f01 100644 --- a/frontend/src/app/core/api/api/triggers.service.ts +++ b/frontend/src/app/core/api/api/triggers.service.ts @@ -30,7 +30,7 @@ import { Configuration } from '../configurat }) export class TriggersService { - protected basePath = 'http://localhost'; + protected basePath = 'http://localhost:8000/api'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); public encoder: HttpParameterCodec; @@ -140,7 +140,7 @@ export class TriggersService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/triggers/`, + return this.httpClient.post(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/triggers/`, bodyTrigger, { responseType: responseType, @@ -154,7 +154,7 @@ export class TriggersService { /** * Trigger Delete - * Deletes trigger with id **trigger_id** for hood with id **hood_id**. + * Deletes trigger with id **trigger_id** for hood with id **hood_id**. * @param triggerId * @param hoodId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -198,7 +198,7 @@ export class TriggersService { responseType = 'text'; } - return this.httpClient.delete(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/triggers/${encodeURIComponent(String(triggerId))}`, + return this.httpClient.delete(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/triggers/${encodeURIComponent(String(triggerId))}`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -211,7 +211,7 @@ export class TriggersService { /** * Trigger Read - * Reads trigger with id **trigger_id** for hood with id **hood_id**. + * Reads trigger with id **trigger_id** for hood with id **hood_id**. * @param triggerId * @param hoodId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -255,7 +255,7 @@ export class TriggersService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/triggers/${encodeURIComponent(String(triggerId))}`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/triggers/${encodeURIComponent(String(triggerId))}`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -268,7 +268,7 @@ export class TriggersService { /** * Trigger Read All - * Get all triggers of hood with id **hood_id**. + * Get all triggers of hood with id **hood_id**. * @param hoodId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -308,7 +308,7 @@ export class TriggersService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/triggers/`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/triggers/`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -378,7 +378,7 @@ export class TriggersService { responseType = 'text'; } - return this.httpClient.put(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/triggers/${encodeURIComponent(String(triggerId))}`, + return this.httpClient.put(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/triggers/${encodeURIComponent(String(triggerId))}`, bodyTrigger, { responseType: responseType, diff --git a/frontend/src/app/core/api/api/twitter.service.ts b/frontend/src/app/core/api/api/twitter.service.ts index e91fb01..c0d3f1c 100644 --- a/frontend/src/app/core/api/api/twitter.service.ts +++ b/frontend/src/app/core/api/api/twitter.service.ts @@ -29,7 +29,7 @@ import { Configuration } from '../configurat }) export class TwitterService { - protected basePath = 'http://localhost'; + protected basePath = 'http://localhost:8000/api'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); public encoder: HttpParameterCodec; @@ -147,7 +147,7 @@ export class TwitterService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/twitter/callback`, + return this.httpClient.get(`${this.configuration.basePath}/twitter/callback`, { params: queryParameters, responseType: responseType, @@ -201,7 +201,7 @@ export class TwitterService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/twitter/`, + return this.httpClient.post(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/twitter/`, null, { responseType: responseType, @@ -258,7 +258,7 @@ export class TwitterService { responseType = 'text'; } - return this.httpClient.delete(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/twitter/${encodeURIComponent(String(twitterId))}`, + return this.httpClient.delete(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/twitter/${encodeURIComponent(String(twitterId))}`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -314,7 +314,7 @@ export class TwitterService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/twitter/${encodeURIComponent(String(twitterId))}`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/twitter/${encodeURIComponent(String(twitterId))}`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -366,7 +366,7 @@ export class TwitterService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/twitter/`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/twitter/`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -411,7 +411,7 @@ export class TwitterService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/twitter/public`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/twitter/public`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -467,7 +467,7 @@ export class TwitterService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/twitter/${encodeURIComponent(String(twitterId))}/start`, + return this.httpClient.post(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/twitter/${encodeURIComponent(String(twitterId))}/start`, null, { responseType: responseType, @@ -524,7 +524,7 @@ export class TwitterService { responseType = 'text'; } - return this.httpClient.get(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/twitter/${encodeURIComponent(String(twitterId))}/status`, + return this.httpClient.get(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/twitter/${encodeURIComponent(String(twitterId))}/status`, { responseType: responseType, withCredentials: this.configuration.withCredentials, @@ -580,7 +580,7 @@ export class TwitterService { responseType = 'text'; } - return this.httpClient.post(`${this.configuration.basePath}/api/hoods/${encodeURIComponent(String(hoodId))}/twitter/${encodeURIComponent(String(twitterId))}/stop`, + return this.httpClient.post(`${this.configuration.basePath}/hoods/${encodeURIComponent(String(hoodId))}/twitter/${encodeURIComponent(String(twitterId))}/stop`, null, { responseType: responseType, diff --git a/frontend/src/app/core/api/model/bodyLogin.ts b/frontend/src/app/core/api/model/bodyLogin.ts new file mode 100644 index 0000000..a98113b --- /dev/null +++ b/frontend/src/app/core/api/model/bodyLogin.ts @@ -0,0 +1,22 @@ +/** + * FastAPI + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface BodyLogin { + grant_type?: string; + username: string; + password: string; + scope?: string; + client_id?: string; + client_secret?: string; +} + diff --git a/frontend/src/app/core/api/model/bodySubscriber.ts b/frontend/src/app/core/api/model/bodySubscriber.ts index 2ebec6d..e4cc61a 100644 --- a/frontend/src/app/core/api/model/bodySubscriber.ts +++ b/frontend/src/app/core/api/model/bodySubscriber.ts @@ -12,7 +12,7 @@ /** - * This model holds the email address of a fresh subscriber. + * This model holds the email address of a fresh subscriber. */ export interface BodySubscriber { email: string; diff --git a/frontend/src/app/core/api/model/kibicaraPlatformsEmailWebapiBodyMessage.ts b/frontend/src/app/core/api/model/kibicaraPlatformsEmailWebapiBodyMessage.ts index b41cde6..04bf795 100644 --- a/frontend/src/app/core/api/model/kibicaraPlatformsEmailWebapiBodyMessage.ts +++ b/frontend/src/app/core/api/model/kibicaraPlatformsEmailWebapiBodyMessage.ts @@ -12,7 +12,7 @@ /** - * This model shows which values are supplied by the MDA listener script. + * This model shows which values are supplied by the MDA listener script. */ export interface KibicaraPlatformsEmailWebapiBodyMessage { text: string; diff --git a/frontend/src/app/core/api/model/models.ts b/frontend/src/app/core/api/model/models.ts index c74e204..bc00d4b 100644 --- a/frontend/src/app/core/api/model/models.ts +++ b/frontend/src/app/core/api/model/models.ts @@ -1,8 +1,8 @@ export * from './bodyAccessToken'; export * from './bodyAdmin'; -export * from './bodyAdminLoginAdminLoginPost'; export * from './bodyBadWord'; export * from './bodyHood'; +export * from './bodyLogin'; export * from './bodyPassword'; export * from './bodySubscriber'; export * from './bodyTelegram'; diff --git a/frontend/src/app/core/api/model/validationError.ts b/frontend/src/app/core/api/model/validationError.ts index c624e14..141a839 100644 --- a/frontend/src/app/core/api/model/validationError.ts +++ b/frontend/src/app/core/api/model/validationError.ts @@ -12,7 +12,7 @@ export interface ValidationError { - loc: Array; + loc: Array; msg: string; type: string; }