Compare commits

...

42 Commits

Author SHA1 Message Date
carteronm 5d26572073 Merge remote-tracking branch 'origin/develop' into develop 2026-06-11 01:51:04 +02:00
carteronm 0b69eee16b Rôles ajoutés 2026-06-11 01:50:58 +02:00
gokhoal d43b6b746d Merge remote-tracking branch 'origin/develop' into develop 2026-06-11 01:30:43 +02:00
gokhoal dccc2a5e4d LES MESSAGES MARCHENT 2026-06-11 01:30:33 +02:00
carteronm 673269e2b8 Création de groupe terminé + affichage des noms d'utilisateur dans la discussion 2026-06-11 01:15:04 +02:00
carteronm 6ffcece3fa création de groupe début 2026-06-11 00:26:25 +02:00
gokhoal 1c663913a7 LES DISCUSSIONS S'AFFICHENT 2026-06-10 23:39:42 +02:00
gokhoal e386897dc9 Merge remote-tracking branch 'origin/develop' into develop 2026-06-10 23:30:38 +02:00
gokhoal 79cb219a38 creation de discussions 2026-06-10 23:30:31 +02:00
carteronm aec268fbce openapi réalisé encore 2026-06-10 22:50:23 +02:00
gokhoal fd8d33642e logique de creation de discussions 2026-06-10 22:46:03 +02:00
gokhoal 127023fd7f Merge remote-tracking branch 'origin/develop' into develop 2026-06-10 22:36:35 +02:00
carteronm 96dfc905f9 Merge remote-tracking branch 'origin/develop' into develop 2026-06-10 22:36:41 +02:00
carteronm baee754ee8 Register terminé 2026-06-10 22:36:35 +02:00
gokhoal 7ceafb61f8 chargements des discussions 2026-06-10 22:36:26 +02:00
gokhoal 95de4cca9e Merge remote-tracking branch 'origin/develop' into develop 2026-06-10 22:11:17 +02:00
gokhoal a5c8a83281 chargement des messages 2026-06-10 22:11:03 +02:00
carteronm 3e58f8026f Déconnexion 2026-06-10 22:10:13 +02:00
carteronm d7e3a93c04 Debut parametres profil 2026-06-10 17:26:46 +02:00
carteronm cc87ceeacd Login marche ! 2026-06-10 16:27:04 +02:00
gokhoal 18a8ecb351 non used imports 2026-06-10 15:59:19 +02:00
gokhoal dcb715703e Merge remote-tracking branch 'origin/develop' into develop 2026-06-10 15:58:50 +02:00
gokhoal e5044c8940 nouveau register 2026-06-10 15:58:43 +02:00
carteronm 05ee858f04 Merge remote-tracking branch 'origin/develop' into develop 2026-06-10 14:35:24 +02:00
carteronm 98d2465c38 nav début 2026-06-10 14:35:14 +02:00
gokhoal d18735bd4b services chat et discussion 2026-06-10 14:30:17 +02:00
carteronm cb0ebe3c92 openapi fait 2026-06-10 13:53:50 +02:00
gokhoal eb87d15f94 login et register + chat et discussion services 2026-06-10 13:21:54 +02:00
carteronm 60d8e5d588 Parameters terminés 2026-06-10 11:59:04 +02:00
carteronm b85d09ee55 Début du login + parametres 2026-06-10 11:49:23 +02:00
gokhoal 1cc9688d00 changement de la logique des messages 2026-06-08 21:31:41 +02:00
carteronm bff995151f Merge remote-tracking branch 'origin/develop' into develop 2026-05-12 10:47:19 +02:00
carteronm e4e0f9c457 début affichage des utilisateurs 2026-05-12 10:47:14 +02:00
oistig 3975b60496 ajout du service de messages 2026-05-12 10:26:58 +02:00
carteronm da813fd166 Merge remote-tracking branch 'origin/develop' into develop 2026-05-05 12:00:38 +02:00
carteronm 49135e764d avancement boutons pages 2026-05-05 12:00:31 +02:00
carteronm 49867798f4 openapi fin 2026-05-05 10:58:22 +02:00
carteronm 90f49b2d81 openapi 2026-05-05 08:30:06 +02:00
carteronm 16d9e90b43 Merge remote-tracking branch 'origin/develop' into develop 2026-04-30 17:49:53 +02:00
carteronm 99d7b43495 Merge remote-tracking branch 'origin/develop' into develop 2026-04-30 17:49:49 +02:00
gokhoal c6950e863a Changements login + register 2026-04-30 17:49:44 +02:00
carteronm 89c3e3c790 update page parametres 2026-04-30 17:49:38 +02:00
114 changed files with 8019 additions and 444 deletions
+4 -12
View File
@@ -3,7 +3,6 @@ apply plugin: 'com.android.application'
android {
namespace = "com.knots.mobile"
compileSdk = rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "com.knots.mobile"
minSdkVersion rootProject.ext.minSdkVersion
@@ -11,19 +10,12 @@ android {
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
ignoreAssetsPattern = '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
}
}
// ✅ Forcer Java 17
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
buildTypes {
release {
minifyEnabled false
@@ -33,7 +25,7 @@ android {
}
repositories {
flatDir {
flatDir{
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
}
}
@@ -59,4 +51,4 @@ try {
}
} catch(Exception e) {
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
}
}
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="app_name">Knots</string>
<string name="title_activity_main">Knots</string>
<string name="app_name">knots</string>
<string name="title_activity_main">knots</string>
<string name="package_name">com.knots.mobile</string>
<string name="custom_url_scheme">com.knots.mobile</string>
</resources>
+1 -10
View File
@@ -1,16 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}
}
repositories {
google()
mavenCentral()
+2
View File
@@ -115,6 +115,8 @@
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"proxyConfig": "proxy.conf.json"},
"configurations": {
"production": {
"buildTarget": "Knots-Front:build:production"
+2 -2
View File
@@ -2,8 +2,8 @@ import type { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
appId: 'com.knots.mobile',
appName: 'Knots',
webDir: 'dist/knots-front/browser'
appName: 'knots',
webDir: 'dist'
};
export default config;
+3
View File
@@ -0,0 +1,3 @@
additionalProperties:
fileNaming: kebab-case
modelPropertyNaming: camelCase
+7
View File
@@ -0,0 +1,7 @@
{
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "7.22.0"
}
}
+1171 -94
View File
File diff suppressed because it is too large Load Diff
+7 -3
View File
@@ -5,7 +5,8 @@
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development"
"watch": "ng build --watch --configuration development",
"openapi": "rm -rf src/app/services/api && openapi-generator-cli generate -i http://localhost:5250/swagger/v1/swagger.json -g typescript-angular -o src/app/services/api -c openapi-generator.yaml"
},
"private": true,
"dependencies": {
@@ -20,7 +21,10 @@
"@capacitor/angular": "^2.0.3",
"@capacitor/core": "latest",
"@capacitor/ios": "^8.3.0",
"@capacitor/push-notifications": "^8.0.4",
"@ionic/angular": "^8.8.3",
"@microsoft/signalr": "^10.0.0",
"@openapitools/openapi-generator-cli": "^2.32.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.15.0"
@@ -30,7 +34,7 @@
"@angular/cli": "^19.2.23",
"@angular/compiler-cli": "^19.2.0",
"@capacitor/cli": "latest",
"typescript": "~5.7.2",
"@ionic/angular-toolkit": "latest"
"@ionic/angular-toolkit": "latest",
"typescript": "~5.7.2"
}
}
+7
View File
@@ -0,0 +1,7 @@
{
"/API": {
"target": "http://localhost:5250",
"secure": false,
"changeOrigin": true
}
}
+4 -1
View File
@@ -3,7 +3,10 @@ import { provideRouter } from '@angular/router';
import { routes } from './app.routes';
import { provideIonicAngular } from '@ionic/angular/standalone';
import {provideHttpClient, withInterceptors} from "@angular/common/http";
import {authInterceptor} from "./core/auth/auth.interceptor";
export const appConfig: ApplicationConfig = {
providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes), provideIonicAngular({})]
providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes), provideIonicAngular({}),provideHttpClient(withInterceptors([authInterceptor])), provideHttpClient()],
};
+8 -13
View File
@@ -1,42 +1,37 @@
import { Routes } from '@angular/router';
import {authGuard} from "./core/auth/auth.guard";
export const routes: Routes = [
{
path: '',
pathMatch: 'full',
redirectTo: '/main/messages',
redirectTo: '/main/menu',
},
{
path: 'main',
canActivate: [authGuard],
loadComponent: () => import('./pages/main/main.component').then(x => x.Main),
children: [
/*{
path:'groupmessages',
loadComponent: () => import('./pages/groupmessages/groupmessages.component').then(x => x.Groupmessages)
},*/
{
path:'messages',
path: 'messages/:discussionId',
loadComponent: () => import('./pages/messages/messages-main/messages-main.component').then(x => x.MessagesMain)
},
{
path:'menu',
path: 'menu',
loadComponent: () => import('./pages/menu/menu/menu.component').then(x => x.Menu)
},
{
path:'parameters',
path: 'parameters',
loadComponent: () => import('./pages/parameters/parameters-main/parameters-main.component').then(x => x.ParametersMain)
}
]
},
{
path:'login',
path: 'login',
loadComponent: () => import('./pages/login-form/login-form.component').then(x => x.LoginFormComponent)
},
{
path:'register',
path: 'register',
loadComponent: () => import('./pages/register-form/register-form.component').then(x => x.RegisterFormComponent)
},
];
+13
View File
@@ -0,0 +1,13 @@
import { inject } from '@angular/core';
import { CanActivateFn, Router } from '@angular/router';
import {AuthService} from "./auth.service";
export const authGuard: CanActivateFn = () => {
const authService = inject(AuthService);
const router = inject(Router);
if (authService.isLoggedIn()) return true;
router.navigate(['/login']);
return false;
};
+15
View File
@@ -0,0 +1,15 @@
import { HttpInterceptorFn } from '@angular/common/http';
import { inject } from '@angular/core';
import {AuthService} from "./auth.service";
export const authInterceptor: HttpInterceptorFn = (req, next) => {
const token = inject(AuthService).getToken();
if (token) {
req = req.clone({
setHeaders: { Authorization: `Bearer ${token}` }
});
}
return next(req);
};
+110
View File
@@ -0,0 +1,110 @@
import { inject, Injectable, signal } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Router } from '@angular/router';
import { firstValueFrom } from 'rxjs';
import { LoggedUser } from "../../models/user.model";
interface LoginResponse {
token: string;
id: number;
username: string;
email: string | null;
tel: string | null;
profilePicture: string | null;
description: string | null;
}
interface RegisterRequest {
username: string;
password: string;
}
@Injectable({ providedIn: 'root' })
export class AuthService {
private http = inject(HttpClient);
private router = inject(Router);
private readonly TOKEN_KEY = 'knots_token';
private readonly USER_KEY = 'knots_user';
currentUser = signal<LoggedUser | null>(this.loadUser());
private loadUser(): LoggedUser | null {
const raw = localStorage.getItem(this.USER_KEY);
return raw ? JSON.parse(raw) : null;
}
isLoggedIn(): boolean {
return !!localStorage.getItem(this.TOKEN_KEY);
}
getToken(): string | null {
return localStorage.getItem(this.TOKEN_KEY);
}
async login(username: string, password: string): Promise<void> {
const response = await firstValueFrom(
this.http.post<LoginResponse>('/API/users/login', { username, password })
);
localStorage.setItem(this.TOKEN_KEY, response.token);
const user: LoggedUser = {
id: String(response.id),
username: response.username,
email: response.email,
tel: response.tel,
profilePicture: response.profilePicture,
description: response.description,
};
localStorage.setItem(this.USER_KEY, JSON.stringify(user));
this.currentUser.set(user);
await this.router.navigate(['/main/menu']);
}
async register(
username: string,
password: string,
email: string,
tel: string,
description: string | null = null
): Promise<void> {
await firstValueFrom(
this.http.post<void>('/API/users', {
username,
password,
email,
tel,
description,
profilePicture: null
})
);
await this.router.navigate(['/login']);
}
logout(): void {
localStorage.removeItem(this.TOKEN_KEY);
localStorage.removeItem(this.USER_KEY);
this.currentUser.set(null);
this.router.navigate(['/login']);
}
updateCurrentUser(partial: Partial<LoggedUser>): void {
const user = this.currentUser();
if (!user) return;
const updated = { ...user, ...partial };
localStorage.setItem(this.USER_KEY, JSON.stringify(updated));
this.currentUser.set(updated);
}
getCurrentUserId(): number {
const user = this.currentUser();
if (!user) {
throw new Error('Aucun utilisateur connecté');
}
return Number(user.id);
}
}
+40
View File
@@ -0,0 +1,40 @@
import {inject, Injectable} from '@angular/core';
import { HubConnectionBuilder, HubConnectionState } from '@microsoft/signalr';
import * as signalR from '@microsoft/signalr';
import { AuthService } from "../auth/auth.service";
@Injectable({ providedIn: 'root' })
export class ChatService {
private authService = inject(AuthService);
private hub: signalR.HubConnection;
constructor() {
this.hub = new HubConnectionBuilder()
.withUrl('http://localhost:5250/hubs/chat', {
accessTokenFactory: () => this.authService.getToken() ?? ''
})
.withAutomaticReconnect()
.build();
}
async connect() {
if (this.hub.state === HubConnectionState.Disconnected) {
await this.hub.start();
}
}
async sendMessage(discussionId: string, content: string) {
await this.connect(); // s'assure que la connexion est active
await this.hub.invoke('SendMessage', discussionId, content);
}
onMessage(callback: (message: any) => void) {
this.hub.on('ReceiveMessage', callback);
}
async joinConversation(discussionId: string) {
await this.connect();
await this.hub.invoke('JoinConversation', discussionId);
}
}
+65
View File
@@ -0,0 +1,65 @@
import { Observable } from "rxjs";
import { HttpClient } from "@angular/common/http";
import { inject, Injectable } from "@angular/core";
export interface Message {
id: number;
contenu: string;
date: string;
userId: number;
authorName: string;
}
export interface MemberWithRole {
userId: number;
username: string;
roleId: number | null;
roleLibelle: string | null;
}
export interface Discussion {
id: number;
name: string;
isGroup: boolean;
membersCount?: number;
groupId?: number;
}
@Injectable({ providedIn: 'root' })
export class discussionsService {
private http = inject(HttpClient);
private apiUrl = 'http://localhost:5250/API';
getDiscussions(): Observable<Discussion[]> {
return this.http.get<Discussion[]>(`${this.apiUrl}/discussions/my`);
}
getMessages(discussionId: string): Observable<Message[]> {
return this.http.get<Message[]>(`${this.apiUrl}/discussions/${discussionId}/messages`);
}
createPrivateDiscussion(username: string): Observable<Discussion> {
return this.http.post<Discussion>(`${this.apiUrl}/discussions/private`, { username });
}
createGroupDiscussion(groupName: string, usernames: string[]): Observable<Discussion> {
return this.http.post<Discussion>(`${this.apiUrl}/discussions/group`, { groupName, usernames });
}
getDiscussionMembers(discussionId: string): Observable<string[]> {
return this.http.get<string[]>(`${this.apiUrl}/discussions/${discussionId}/members`);
}
getMembersWithRoles(discussionId: string): Observable<MemberWithRole[]> {
return this.http.get<MemberWithRole[]>(`${this.apiUrl}/discussions/${discussionId}/members/roles`);
}
createRole(libelle: string): Observable<{ id: number, libelle: string }> {
return this.http.post<{ id: number, libelle: string }>(`${this.apiUrl}/roles`, { libelle });
}
assignRole(groupId: number, userId: number, roleId: number): Observable<void> {
return this.http.post<void>(`${this.apiUrl}/groups/${groupId}/members/${userId}/role`, { roleId });
}
}
-41
View File
@@ -1,41 +0,0 @@
import { Injectable } from '@angular/core';
import {tap} from "rxjs";
@Injectable({
providedIn: 'root'
})
export class LoginService {
/*
login(credentials: { name: string; password: string }) {
return this.http.post<LoginResponse>(`${this.apiUrl}/login`, credentials).pipe(
tap(response => this.setSession(response.token))
);
}
*/
/*
refreshToken(): Observable<RefreshResponse> {
this.isRefreshing = true;
return this.http.post<RefreshResponse>(`${this.apiUrl}/refresh`, {})
.pipe(
tap(response => {
this.setSession(response.token);
}),
finalize(() => {
this.isRefreshing = false;
})
);
}
*/
/*
logout(){
return localStorage.removeItem('token');
this.currentUser.set(null);
this.router.navigate(['/login']);
}
*/
}
+8
View File
@@ -0,0 +1,8 @@
export interface LoggedUser {
id: string;
username: string;
email: string | null;
tel: string | null;
profilePicture: string | null;
description: string | null;
}
+112 -45
View File
@@ -1,85 +1,152 @@
.bg {
--background: linear-gradient(180deg, #e6dede, #e58a8a);
/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');
/* ---- Page background ---- */
ion-content.bg {
--background: transparent;
--overflow: hidden;
&::before {
content: '';
position: fixed;
inset: 0;
background: linear-gradient(
160deg,
#f9e8e8 0%,
#f2c4c4 35%,
#e89898 70%,
#d97070 100%
);
z-index: -1;
}
}
/* ---- Centered container ---- */
.container {
text-align: center;
padding-top: 60px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100%;
padding: 40px 24px;
font-family: 'Nunito', sans-serif;
gap: 10px;
}
/* ---- Logo box ---- */
.logo-box {
width: 90px;
height: 90px;
margin: 0 auto 10px;
border-radius: 20px;
background: #f2eaea;
width: 80px;
height: 80px;
background: #ffffff;
border-radius: 22px;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 8px 8px 15px #d1bcbc,
-8px -8px 15px #ffffff;
box-shadow: 0 4px 18px rgba(180, 80, 80, 0.18);
overflow: hidden;
margin-bottom: 4px;
img {
width: 50px;
width: 52px;
height: 52px;
object-fit: contain;
}
}
/* ---- App title ---- */
h1 {
color: #b86b6b;
margin-bottom: 30px;
font-family: 'Nunito', sans-serif;
font-size: 28px;
font-weight: 800;
color: #b05050;
margin: 0 0 10px;
letter-spacing: 0.5px;
}
/* ---- White card ---- */
.card {
width: 85%;
max-width: 320px;
margin: auto;
padding: 25px;
border-radius: 20px;
background: #f2eaea;
box-shadow: 10px 10px 20px #cfaeae,
-10px -10px 20px #ffffff;
width: 100%;
max-width: 340px;
background: rgba(255, 255, 255, 0.88);
border-radius: 24px;
padding: 28px 24px 32px;
box-shadow: 0 8px 32px rgba(180, 80, 80, 0.12);
display: flex;
flex-direction: column;
gap: 14px;
h3 {
color: #c27a7a;
margin-bottom: 20px;
font-weight: normal;
font-family: 'Nunito', sans-serif;
font-size: 16px;
font-weight: 700;
color: #b05050;
text-align: center;
margin: 0 0 4px;
}
}
/* ---- Inputs ---- */
.input {
margin: 10px 0;
border-radius: 20px;
--background: #f2eaea;
--padding-start: 15px;
box-shadow: inset 5px 5px 10px #d1bcbc,
inset -5px -5px 10px #ffffff;
--background: rgba(255, 255, 255, 0.95);
--border-radius: 50px;
--padding-start: 18px;
--padding-end: 18px;
--inner-padding-end: 0;
--highlight-color-focused: #d97070;
border-radius: 50px;
box-shadow: 0 2px 8px rgba(180, 80, 80, 0.10);
overflow: hidden;
ion-input {
color: #a35c5c;
--placeholder-color: #c9a0a0;
--placeholder-opacity: 1;
--color: #6b3030;
font-family: 'Nunito', sans-serif;
font-size: 15px;
font-weight: 600;
caret-color: #d97070;
}
}
/* ---- Login button ---- */
.btn {
margin-top: 15px;
--background: #b86b6b;
--border-radius: 20px;
--background: #b05050;
--background-activated: #903838;
--border-radius: 50px;
--box-shadow: 0 4px 16px rgba(176, 80, 80, 0.35);
--color: #ffffff;
font-family: 'Nunito', sans-serif;
font-size: 16px;
font-weight: 700;
letter-spacing: 0.3px;
margin-top: 6px;
height: 48px;
transition: transform 0.15s ease, box-shadow 0.15s ease;
box-shadow: 5px 5px 10px #a45f5f,
-5px -5px 10px #ff9c9c;
&:active {
transform: scale(0.97);
--box-shadow: 0 2px 8px rgba(176, 80, 80, 0.25);
}
}
/* ---- Sign-up link ---- */
.signup {
margin-top: 20px;
color: white;
text-align: center;
font-family: 'Nunito', sans-serif;
font-size: 14px;
font-weight: 700;
color: #b05050;
line-height: 1.7;
margin-top: 6px;
a {
color: white;
font-weight: bold;
color: #b05050;
font-weight: 800;
text-decoration: underline;
text-underline-offset: 2px;
&:hover {
color: #903838;
}
}
}
@@ -8,19 +8,19 @@
<h1>Knots</h1>
<div class="card">
<div class="card" [formGroup]="loginForm">
<h3>Connectez-vous à Knots !</h3>
<ion-item lines="none" class="input">
<ion-input placeholder="Login..."></ion-input>
<ion-input formControlName="name" placeholder="Login..."></ion-input>
</ion-item>
<ion-item lines="none" class="input">
<ion-input type="password" placeholder="Password..."></ion-input>
<ion-input formControlName="password" type="password" placeholder="Password..."></ion-input>
</ion-item>
<ion-button expand="block" class="btn">
<ion-button expand="block" class="btn" (click)="submitForm()">
Se connecter
</ion-button>
@@ -28,7 +28,7 @@
<div class="signup">
Vous êtes nouveau ?<br>
<a href="#">Créez vous un compte ici</a>
<a (click)="goToRegister()">Créez vous un compte ici</a>
</div>
</div>
@@ -1,73 +1,65 @@
import {Component, inject} from '@angular/core';
import { Component, inject } from '@angular/core';
import {
IonButton,
IonCard,
IonCardContent,
IonCardHeader,
IonCardTitle, IonContent, IonInput, IonItem, NavController,
IonButton, IonContent, IonInput, IonItem, NavController,
} from '@ionic/angular/standalone';
import {CommonModule} from "@angular/common";
import {FormBuilder, ReactiveFormsModule, Validators} from "@angular/forms";
import {Router} from "@angular/router";
import {LoginService} from "../../login.service";
import { CommonModule } from "@angular/common";
import { FormBuilder, ReactiveFormsModule, Validators } from "@angular/forms";
import { Router } from "@angular/router";
import { AuthService } from "../../core/auth/auth.service";
@Component({
selector: 'login-form',
templateUrl: 'login-form.component.html',
styleUrls: ['login-form.component.css'],
imports: [IonButton, IonCard, IonCardContent, IonCardHeader, IonCardTitle, CommonModule, ReactiveFormsModule, IonItem, IonInput, IonContent,],
imports: [IonButton, CommonModule, ReactiveFormsModule, IonItem, IonInput, IonContent],
})
export class LoginFormComponent {
private fb = inject(FormBuilder);
private loginService = inject(LoginService);
private authService = inject(AuthService);
private router = inject(Router);
private navCtrl = inject(NavController);
isLoading = false;
goToRegister() {
this.router.navigate(['/register']);
}
loginForm = this.fb.group({
name: ['', [Validators.required]],
password: ['', [Validators.required]]
});
async submitForm(): Promise<void> {
console.log('submitForm appelé');
console.log('form valid:', this.loginForm.valid);
console.log('form values:', this.loginForm.value);
if (this.loginForm.valid) {
await this.navCtrl.navigateRoot(['main/messages']);
this.isLoading = true;
const request = {
name: this.loginForm.value.name!,
password: this.loginForm.value.password!
};
/*this.authService.login(request).subscribe({
next: () => {
this.isLoading = false;
this.notification.success('Succès', 'Connexion réussie !');
this.router.navigate(['/main/discussions']);
},
error: (err) => {
this.isLoading = false;
// Gestion des erreurs (inchangée)
if (err.status === 401) {
this.notification.error('Erreur', 'Identifiant ou mot de passe incorrect.');
} else {
this.notification.error('Erreur', 'Impossible de contacter le serveur.');
}
try {
await this.authService.login(
this.loginForm.value.name!,
this.loginForm.value.password!
);
} catch (err: any) {
console.error('Erreur complète:', err);
if (err.status === 401) {
console.error('Identifiant ou mot de passe incorrect.');
} else {
console.error('Impossible de contacter le serveur.');
}
});
} finally {
this.isLoading = false;
}
} else {
// Affiche les erreurs de validation visuelles
Object.values(this.loginForm.controls).forEach(control => {
if (control.invalid) {
control.markAsDirty();
control.updateValueAndValidity({ onlySelf: true });
}
});*/
});
}
}
}
@@ -1,29 +1,265 @@
.hamburger-btn {
width: 50px;
height: 50px;
align-self: flex-start;
width: 44px;
height: 44px;
border-radius: 14px;
background: white;
border: none;
box-shadow: 0 2px 10px rgba(180, 80, 80, 0.12);
display: flex;
align-items: center;
justify-content: center;
color: rosybrown;
cursor: pointer;
border-radius: 17px;
margin-bottom: 28px;
transition: box-shadow 0.2s, transform 0.15s;
/* Dégradé radial depuis le coin supérieur gauche pour l'effet "glow" */
background: radial-gradient(ellipse at 30% 30%, #fff 0%, #f9ece9 60%, #f3d4cc 100%);
&:active {
transform: scale(0.94);
box-shadow: 0 1px 5px rgba(180, 80, 80, 0.1);
}
}
/* Légère ombre rosée */
box-shadow: 0 4px 24px rgba(200, 120, 100, 0.13);
.modal-layout {
display: flex;
flex-direction: column;
height: 100%;
background: linear-gradient(160deg, #f9e8e8 0%, #f2c4c4 35%, #e89898 70%, #d97070 100%);
}
.modal-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px 20px 12px;
border-bottom: 1px solid rgba(189, 90, 90, 0.15);
}
.modal-title {
font-size: 1.1rem;
font-weight: 700;
color: #7a2e2e;
margin: 0;
}
.modal-close-btn {
width: 34px;
height: 34px;
border-radius: 10px;
background: white;
border: none;
box-shadow: 0 2px 8px rgba(180, 80, 80, 0.12);
display: flex;
align-items: center;
justify-content: center;
color: #bd5a5a;
cursor: pointer;
font-size: 1.2rem;
transition: transform 0.15s;
&:active { transform: scale(0.92); }
}
.modal-body {
display: flex;
flex-direction: column;
gap: 20px;
padding: 24px 20px;
}
.input-wrapper {
display: flex;
flex-direction: column;
gap: 6px;
}
.custom-item {
--background: white;
--border-radius: 12px;
--padding-start: 14px;
--inner-padding-end: 14px;
--color: #7a2e2e;
--highlight-color-focused: #bd5a5a;
border-radius: 12px;
box-shadow: 0 2px 10px rgba(180, 80, 80, 0.1);
}
.error-msg {
color: #7a2e2e;
font-size: 0.8rem;
padding-left: 4px;
margin: 0;
}
.submit-btn {
background: white;
color: #bd5a5a;
border: none;
border-radius: 14px;
padding: 14px;
font-size: 0.95rem;
font-weight: 600;
box-shadow: 0 2px 10px rgba(180, 80, 80, 0.15);
cursor: pointer;
transition: transform 0.15s, box-shadow 0.2s;
&:active {
transform: scale(0.97);
box-shadow: 0 1px 5px rgba(180, 80, 80, 0.1);
}
}
.mode-switch {
margin-top: auto;
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 16px;
background: rgba(255, 255, 255, 0.2);
border-radius: 16px;
backdrop-filter: blur(8px);
box-shadow: 0 2px 12px rgba(122, 46, 46, 0.08);
}
.switch-label {
color: #7a2e2e;
font-weight: 600;
font-size: 0.95rem;
}
/* SWITCH */
.switch {
position: relative;
width: 58px;
height: 32px;
}
.switch input {
display: none;
}
.slider {
position: absolute;
inset: 0;
cursor: pointer;
background: rgba(255, 255, 255, 0.6);
border-radius: 999px;
transition: all 0.25s ease;
box-shadow:
inset 0 1px 3px rgba(0,0,0,0.08),
0 2px 8px rgba(0,0,0,0.05);
}
.slider::before {
content: "";
position: absolute;
top: 4px;
left: 4px;
width: 24px;
height: 24px;
border-radius: 50%;
background: white;
transition: all 0.25s ease;
box-shadow:
0 2px 8px rgba(0,0,0,0.15);
}
.switch input:checked + .slider {
background: #bd5a5a;
}
.switch input:checked + .slider::before {
transform: translateX(26px);
}
.mode-switch:hover .slider {
transform: scale(1.03);
}
.add-member-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
width: 100%;
padding: 12px 16px;
border: 2px dashed rgba(189, 90, 90, 0.35);
border-radius: 14px;
background: rgba(255, 255, 255, 0.55);
color: #bd5a5a;
font-size: 0.95rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
ion-icon {
font-size: 1.2rem;
}
&:hover {
background: rgba(255, 255, 255, 0.8);
border-color: #bd5a5a;
transform: translateY(-1px);
}
&:active {
transform: scale(0.98);
}
}
.remove-btn {
width: 26px;
height: 26px;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
/* Transitions pour l'hover */
transition: transform 0.15s ease, box-shadow 0.15s ease;
}
border: none;
border-radius: 50%;
.hamburger-btn:hover {
transform: scale(1.04);
box-shadow: 0 6px 28px rgba(200, 120, 100, 0.2);
}
background: white;
color: #bd5a5a;
.hamburger-btn:active {
transform: scale(0.97);
cursor: pointer;
box-shadow: 0 2px 8px rgba(180, 80, 80, 0.12);
transition: all 0.2s ease;
ion-icon {
font-size: 1.1rem;
}
&:hover {
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(180, 80, 80, 0.18);
}
&:active {
transform: scale(0.92);
}
}
@@ -5,3 +5,97 @@
<path d="M56,48c2.209,0 4,1.791 4,4c0,2.209 -1.791,4 -4,4c-1.202,0 -38.798,0 -40,0c-2.209,0 -4,-1.791 -4,-4c0,-2.209 1.791,-4 4,-4c1.202,0 38.798,0 40,0zM56,32c2.209,0 4,1.791 4,4c0,2.209 -1.791,4 -4,4c-1.202,0 -38.798,0 -40,0c-2.209,0 -4,-1.791 -4,-4c0,-2.209 1.791,-4 4,-4c1.202,0 38.798,0 40,0zM56,16c2.209,0 4,1.791 4,4c0,2.209 -1.791,4 -4,4c-1.202,0 -38.798,0 -40,0c-2.209,0 -4,-1.791 -4,-4c0,-2.209 1.791,-4 4,-4c1.202,0 38.798,0 40,0z"></path></g></g>
</svg>
</button>
<ion-modal [isOpen]="isModalOpen()" (didDismiss)="closeNav()">
<ng-template>
<div class="modal-layout">
<div class="modal-header">
<h2 class="modal-title">{{ isGroup() ? 'Nouveau groupe' : 'Nouvelle conversation' }}</h2>
<div class="header-actions">
<button class="modal-close-btn" (click)="closeNav()">
<ion-icon name="close-outline" />
</button>
</div>
</div>
<div class="modal-body">
<!-- Mode privé -->
<ng-container *ngIf="!isGroup()">
<div class="input-wrapper">
<ion-item class="custom-item">
<ion-input
[formControl]="username"
label="Nom d'utilisateur"
labelPlacement="floating"
placeholder="ex: jean_dupont"
/>
</ion-item>
<p class="error-msg" *ngIf="errorMsg()">{{ errorMsg() }}</p>
</div>
<button class="submit-btn" (click)="startConversation()" [disabled]="isLoading()">
{{ isLoading() ? 'Création...' : 'Démarrer la conversation' }}
</button>
</ng-container>
<!-- Mode groupe -->
<ng-container *ngIf="isGroup()">
<div class="input-wrapper">
<ion-item class="custom-item">
<ion-input
[formControl]="groupName"
label="Nom du groupe"
labelPlacement="floating"
placeholder="ex: Les amis"
/>
</ion-item>
</div>
<div class="members-list">
<div class="member-row" *ngFor="let ctrl of groupMembers; let i = index">
<ion-item class="custom-item member-item">
<ion-input
[formControl]="ctrl"
label="Membre {{ i + 1 }}"
labelPlacement="floating"
placeholder="ex: jean_dupont"
/>
</ion-item>
<button class="remove-btn" (click)="removeMember(i)" *ngIf="groupMembers.length > 1">
<ion-icon name="close-outline" />
</button>
</div>
</div>
<button class="add-member-btn" (click)="addMember()" *ngIf="groupMembers.length < 10">
<ion-icon name="add-outline" />
Ajouter un membre
</button>
<p class="error-msg" *ngIf="errorMsg()">{{ errorMsg() }}</p>
<button class="submit-btn" (click)="startGroupConversation()" [disabled]="isLoading()">
{{ isLoading() ? 'Création...' : 'Créer le groupe' }}
</button>
</ng-container>
<div class="mode-switch">
<span class="switch-label">
{{ isGroup() ? 'Mode groupe' : 'Conversation privée' }}
</span>
<label class="switch">
<input
type="checkbox"
[checked]="isGroup()"
(change)="toggleMode()"
>
<span class="slider"></span>
</label>
</div>
</div>
</div>
</ng-template>
</ion-modal>
@@ -1,16 +1,110 @@
import {Component, inject} from '@angular/core';
import {Router} from "@angular/router";
import { Component, inject, signal } from '@angular/core';
import { Router } from "@angular/router";
import { ReactiveFormsModule, FormControl } from "@angular/forms";
import { addIcons } from "ionicons";
import { IonIcon, IonInput, IonItem, IonModal } from "@ionic/angular/standalone";
import { closeOutline, addOutline } from "ionicons/icons";
import { discussionsService } from "../../../core/chat/discussion.service";
import {CommonModule} from "@angular/common";
@Component({
selector: 'app-menu-nav',
imports: [],
imports: [IonModal, IonItem, IonInput, IonIcon, ReactiveFormsModule, CommonModule],
templateUrl: './menu-nav.component.html',
styleUrl: './menu-nav.component.css'
})
export class MenuNav {
private router = inject(Router)
openNav() {
this.router.navigate(['/main/messages']);
private router = inject(Router);
private discussionService = inject(discussionsService);
isModalOpen = signal(false);
isLoading = signal(false);
errorMsg = signal<string | null>(null);
isGroup = signal(false);
// Mode privé
username = new FormControl('');
// Mode groupe
groupName = new FormControl('');
groupMembers: FormControl[] = [new FormControl('')];
constructor() {
addIcons({ closeOutline, addOutline });
}
}
openNav() { this.isModalOpen.set(true); }
closeNav() {
this.isModalOpen.set(false);
this.username.reset();
this.groupName.reset();
this.groupMembers = [new FormControl('')];
this.errorMsg.set(null);
this.isGroup.set(false);
}
toggleMode() {
this.isGroup.update(v => !v);
this.errorMsg.set(null);
}
addMember() {
if (this.groupMembers.length < 10) {
this.groupMembers.push(new FormControl(''));
}
}
removeMember(index: number) {
this.groupMembers.splice(index, 1);
}
startConversation() {
const name = this.username.value?.trim();
if (!name || this.isLoading()) return;
this.isLoading.set(true);
this.errorMsg.set(null);
this.discussionService.createPrivateDiscussion(name).subscribe({
next: (discussion) => {
this.isLoading.set(false);
this.closeNav();
this.router.navigate(['/main/messages', discussion.id]);
},
error: (err) => {
this.isLoading.set(false);
this.errorMsg.set(
err.status === 404 ? 'Utilisateur introuvable.' : 'Une erreur est survenue.'
);
}
});
}
startGroupConversation() {
const name = this.groupName.value?.trim();
const usernames = this.groupMembers
.map(c => c.value?.trim())
.filter(v => !!v);
if (!name || usernames.length === 0 || this.isLoading()) return;
this.isLoading.set(true);
this.errorMsg.set(null);
this.discussionService.createGroupDiscussion(name, usernames).subscribe({
next: (discussion) => {
this.isLoading.set(false);
this.closeNav();
this.router.navigate(['/main/messages', discussion.id]);
},
error: (err) => {
this.isLoading.set(false);
this.errorMsg.set(
err.status === 404 ? 'Un ou plusieurs utilisateurs introuvables.' : 'Une erreur est survenue.'
);
}
});
}
}
@@ -1,29 +1,21 @@
.hamburger-btn {
width: 50px;
height: 50px;
align-self: flex-start;
width: 44px;
height: 44px;
border-radius: 14px;
background: white;
border: none;
cursor: pointer;
border-radius: 17px;
/* Dégradé radial depuis le coin supérieur gauche pour l'effet "glow" */
background: radial-gradient(ellipse at 30% 30%, #fff 0%, #f9ece9 60%, #f3d4cc 100%);
/* Légère ombre rosée */
box-shadow: 0 4px 24px rgba(200, 120, 100, 0.13);
box-shadow: 0 2px 10px rgba(180, 80, 80, 0.12);
display: flex;
align-items: center;
justify-content: center;
color: rosybrown;
cursor: pointer;
margin-bottom: 28px;
transition: box-shadow 0.2s, transform 0.15s;
/* Transitions pour l'hover */
transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hamburger-btn:hover {
transform: scale(1.04);
box-shadow: 0 6px 28px rgba(200, 120, 100, 0.2);
}
.hamburger-btn:active {
transform: scale(0.97);
&:active {
transform: scale(0.94);
box-shadow: 0 1px 5px rgba(180, 80, 80, 0.1);
}
}
@@ -0,0 +1,52 @@
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');
.discussions-list {
display: flex;
flex-direction: column;
gap: 10px;
width: 100%;
}
.discussion-btn {
display: flex;
align-items: center;
gap: 14px;
width: 100%;
padding: 12px 16px;
background: rgba(255, 255, 255, 0.88);
border: none;
border-radius: 50px;
box-shadow: 0 2px 10px rgba(180, 80, 80, 0.10);
cursor: pointer;
transition: transform 0.15s, box-shadow 0.15s;
img {
opacity: 0.7;
flex-shrink: 0;
}
&:active {
transform: scale(0.97);
box-shadow: 0 1px 5px rgba(180, 80, 80, 0.08);
}
}
.discussion-info {
display: flex;
flex-direction: column;
align-items: flex-start;
}
.username {
font-family: 'Nunito', sans-serif;
font-size: 15px;
font-weight: 700;
color: #b05050;
}
.members {
font-family: 'Nunito', sans-serif;
font-size: 12px;
font-weight: 600;
color: #c98080;
}
@@ -0,0 +1,20 @@
<div class="discussions-list">
<button
class="discussion-btn"
*ngFor="let disc of discussions"
(click)="openDiscussion(disc.id)">
<img
width="36" height="36"
[src]="disc.isGroup
? 'https://img.icons8.com/ios/50/conference-call--v1.png'
: 'https://img.icons8.com/ios/50/user-male-circle--v1.png'"
alt="avatar"/>
<div class="discussion-info">
<span class="username">{{ disc.name }}</span>
<span class="members" *ngIf="disc.isGroup"> {{ disc.membersCount }} membres </span>
</div>
</button>
</div>
@@ -0,0 +1,36 @@
import {Component, inject, OnInit} from '@angular/core';
import { Router } from "@angular/router";
import { CommonModule } from "@angular/common";
import {discussionsService} from "../../../core/chat/discussion.service";
export interface Discussion {
id: number;
name: string;
isGroup: boolean;
membersCount?: number;
}
@Component({
selector: 'app-menu-users',
imports: [CommonModule],
templateUrl: './menu-users.component.html',
styleUrl: './menu-users.component.css'
})
export class MenuUsersComponent implements OnInit {
private router = inject(Router);
private discussionService = inject(discussionsService);
discussions: Discussion[] = [];
ngOnInit() {
this.discussionService.getDiscussions().subscribe({
next: (discussions) => this.discussions = discussions,
error: (err) => console.error('Impossible de charger les discussions', err)
});
}
openDiscussion(discussionId: number) {
this.router.navigate(['/main/messages', discussionId]);
}
}
+23 -2
View File
@@ -2,13 +2,34 @@
min-height: 100vh;
display: flex;
flex-direction: column;
background: radial-gradient(ellipse at 50% 5%, #fff8f7 0%, #fde0db 45%, #dea09a 100%);
background: linear-gradient(
160deg,
#f9e8e8 0%,
#f2c4c4 35%,
#e89898 70%,
#d97070 100%
);
padding: 26px;
gap: 12px;
gap: 30px;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 16px;
}
@media (min-width: 480px) {
.header {
padding: 0 24px;
}
}
@media (min-width: 768px) {
.header {
padding: 0 40px;
}
}
.param {
@@ -3,4 +3,10 @@
<app-menu-nav/>
<app-menu-param/>
</div>
<div class="users">
<app-menu-users/>
</div>
</div>
+33 -5
View File
@@ -1,16 +1,44 @@
import { Component } from '@angular/core';
import {Component, inject, signal} from '@angular/core';
import {MenuNav} from "../menu-nav/menu-nav.component";
import {MenuParamComponent} from "../menu-param/menu-param.component";
import {MenuUsersComponent} from "../menu-users/menu-users.component";
import {KnotsDTOUserGetUserDto, UsersService} from "../../../services/api";
import {Router} from "@angular/router";
import {firstValueFrom} from "rxjs";
@Component({
selector: 'app-menu',
imports: [
MenuNav,
MenuParamComponent
],
imports: [
MenuNav,
MenuParamComponent,
MenuUsersComponent
],
templateUrl: './menu.component.html',
styleUrl: './menu.component.css'
})
export class Menu {
private usersService = inject(UsersService);
router = inject(Router);
users = signal<KnotsDTOUserGetUserDto[]>([]);
usersLoading = signal<boolean>(false);
async ngOnInit() {
}
async fetchUsers() {
this.usersLoading.set(true);
try {
const users = await firstValueFrom(this.usersService.getAllUsersEndpoint());
this.users.set(users);
} catch (e) {
console.log('Erreur', 'Erreur de communication avec l\'API');
}
this.usersLoading.set(false);
}
}
@@ -40,4 +40,216 @@
font-size: 18px;
font-weight: 500;
color: #c07070;
}
ion-modal {
--background: transparent;
}
/* MODALE */
.modal-layout {
display: flex;
flex-direction: column;
height: 100%;
background: radial-gradient(
ellipse at top,
#fff 0%,
#f9ece9 45%,
#f3d4cc 100%
);
border-radius: 22px 22px 0 0;
box-shadow: 0 -12px 45px rgba(200, 120, 100, 0.25);
overflow: hidden;
}
/* HEADER */
.modal-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 18px;
background: rgba(255, 255, 255, 0.6);
backdrop-filter: blur(10px);
border-bottom: 1px solid rgba(192, 112, 112, 0.15);
}
.modal-title {
margin: 0;
font-size: 1.15rem;
font-weight: 700;
color: #c07070;
}
/* CLOSE */
.modal-close-btn {
width: 38px;
height: 38px;
border: none;
border-radius: 50%;
background: #fff;
color: #c07070;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 3px 12px rgba(200, 120, 100, 0.15);
cursor: pointer;
transition: all 0.2s ease;
ion-icon {
font-size: 1.2rem;
}
&:hover {
transform: translateY(-1px);
box-shadow: 0 6px 18px rgba(200, 120, 100, 0.22);
}
&:active {
transform: scale(0.92);
}
}
/* BODY */
.modal-body {
display: flex;
flex-direction: column;
gap: 12px;
padding: 18px;
overflow-y: auto;
}
/* MEMBER CARD */
.member-card {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px;
background: rgba(255, 255, 255, 0.75);
border-radius: 16px;
box-shadow: 0 2px 12px rgba(200, 120, 100, 0.12);
transition: all 0.2s ease;
&:hover {
transform: translateY(-2px);
background: rgba(255, 255, 255, 0.92);
}
}
/* MEMBER INFO */
.member-info {
display: flex;
align-items: center;
gap: 12px;
}
.member-info img {
width: 38px;
height: 38px;
border-radius: 50%;
}
.member-text {
display: flex;
flex-direction: column;
gap: 2px;
}
.member-name {
font-size: 0.95rem;
font-weight: 600;
color: #7a3a3a;
}
.member-role {
font-size: 0.75rem;
color: rgba(122, 58, 58, 0.6);
}
/* ROLE ASSIGN */
.role-assign {
display: flex;
align-items: center;
gap: 6px;
}
/* INPUT */
.role-input {
width: 120px;
padding: 8px 10px;
border: 1px solid rgba(192, 112, 112, 0.25);
border-radius: 10px;
background: rgba(255, 255, 255, 0.8);
font-size: 0.85rem;
color: #7a3a3a;
outline: none;
transition: all 0.2s ease;
&:focus {
border-color: #c07070;
box-shadow: 0 0 0 3px rgba(192, 112, 112, 0.15);
}
}
/* BUTTON + */
.role-btn {
width: 34px;
height: 34px;
border: none;
border-radius: 10px;
background: #c07070;
color: white;
font-size: 18px;
font-weight: 600;
cursor: pointer;
box-shadow: 0 2px 10px rgba(192, 112, 112, 0.25);
transition: all 0.2s ease;
&:hover {
transform: translateY(-1px);
box-shadow: 0 6px 16px rgba(192, 112, 112, 0.35);
}
&:active {
transform: scale(0.92);
}
}
@@ -1,6 +1,40 @@
<button class="profile-btn">
<button class="profile-btn" (click)="openModal()">
<div class="icon-wrapper">
<img width="50" height="50" src="https://img.icons8.com/ios/50/user-male-circle--v1.png" alt="user"/>
</div>
<span class="username">Nom User</span>
</button>
<span class="username">{{ name || 'Utilisateur' }}</span>
</button>
<ion-modal [isOpen]="isModalOpen()" (didDismiss)="closeModal()">
<ng-template>
<div class="modal-layout">
<div class="modal-header">
<h2 class="modal-title">Membres</h2>
<button class="modal-close-btn" (click)="closeModal()">
<ion-icon name="close-outline"/>
</button>
</div>
<div class="modal-body">
<div class="member-card" *ngFor="let member of members()">
<div class="member-info">
<img width="36" height="36" src="https://img.icons8.com/ios/50/user-male-circle--v1.png" alt="user"/>
<div class="member-text">
<span class="member-name">{{ member.username }}</span>
<span class="member-role" *ngIf="member.roleLibelle">{{ member.roleLibelle }}</span>
</div>
</div>
<div class="role-assign" *ngIf="groupId">
<input
class="role-input"
[(ngModel)]="newRoleInput[member.userId]"
placeholder="Nouveau rôle..."
/>
<button class="role-btn" (click)="assignRole(member.userId)">+</button>
</div>
</div>
</div>
</div>
</ng-template>
</ion-modal>
@@ -1,11 +1,63 @@
import { Component } from '@angular/core';
import { Component, Input, inject, signal } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonModal, IonIcon } from '@ionic/angular/standalone';
import { addIcons } from 'ionicons';
import { closeOutline } from 'ionicons/icons';
import { discussionsService, MemberWithRole } from '../../../core/chat/discussion.service';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'app-messages-infouser',
imports: [],
imports: [CommonModule, IonModal, IonIcon, FormsModule],
templateUrl: './messages-infouser.component.html',
styleUrl: './messages-infouser.component.css'
})
export class MessagesInfoUser {
@Input() name: string = '';
@Input() groupId: number | null = null;
}
private discussionService = inject(discussionsService);
private route = inject(ActivatedRoute);
isModalOpen = signal(false);
members = signal<MemberWithRole[]>([]);
newRoleInput: { [userId: number]: string } = {};
constructor() {
addIcons({ closeOutline });
}
openModal() {
const discussionId = this.route.snapshot.paramMap.get('discussionId')!;
this.discussionService.getMembersWithRoles(discussionId).subscribe({
next: (members) => {
this.members.set(members);
this.isModalOpen.set(true);
}
});
}
closeModal() { this.isModalOpen.set(false); }
assignRole(userId: number) {
const libelle = this.newRoleInput[userId]?.trim();
if (!libelle || !this.groupId) return;
this.discussionService.createRole(libelle).subscribe({
next: (role) => {
this.discussionService.assignRole(this.groupId!, userId, role.id).subscribe({
next: () => {
this.members.update(members =>
members.map(m => m.userId === userId
? { ...m, roleId: role.id, roleLibelle: libelle }
: m
)
);
this.newRoleInput[userId] = '';
}
});
}
});
}
}
@@ -2,15 +2,34 @@
min-height: 100vh;
display: flex;
flex-direction: column;
background: radial-gradient(ellipse at 50% 5%, #fff8f7 0%, #fde0db 45%, #dea09a 100%);
background: linear-gradient(
160deg,
#f9e8e8 0%,
#f2c4c4 35%,
#e89898 70%,
#d97070 100%
);
padding: 16px;
gap: 12px;
}
.topbar {
.header {
display: flex;
justify-content: space-between;
align-items: center;
gap: 30px;
padding: 0 16px;
}
@media (min-width: 480px) {
.header {
padding: 0 24px;
}
}
@media (min-width: 768px) {
.header {
padding: 0 40px;
}
}
.messages {
@@ -1,25 +1,22 @@
<div class="page-mess">
<div class="topbar">
<div class="header">
<app-messages-menu/>
<div class="param">
<app-messages-infouser/>
</div>
<app-messages-infouser [name]="discussionName" [groupId]="groupId"/>
</div>
<div class="messages">
<div class="message received">
<p>Salut, comment tu vas ?</p>
<span class="timestamp">15:33, Hier.</span>
</div>
<div class="message sent">
<p>ça va</p>
<span class="timestamp">11:25, Aujd.</span>
<div *ngFor="let message of messages"
class="message"
[class.sent]="isSent(message)"
[class.received]="!isSent(message)">
<p>{{ message.contenu }}</p>
<span class="timestamp">{{ message.date | date:'HH:mm' }}</span>
</div>
</div>
<div class="bottombar">
<app-messages-send/>
<app-messages-send [discussionId]="currentDiscussionId" />
</div>
</div>
@@ -1,19 +1,62 @@
import { Component } from '@angular/core';
import {MessagesMenu} from "../messages-menu/messages-menu.component";
import {MessagesInfoUser} from "../messages-infouser/messages-infouser.component";
import {MessagesSend} from "../messages-send/messages-send.component";
import {Router} from '@angular/router';
import { Component, inject, OnInit } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MessagesMenu } from "../messages-menu/messages-menu.component";
import { MessagesInfoUser } from "../messages-infouser/messages-infouser.component";
import { MessagesSend } from "../messages-send/messages-send.component";
import { ActivatedRoute } from '@angular/router';
import { discussionsService, Message } from "../../../core/chat/discussion.service";
import { AuthService } from "../../../core/auth/auth.service";
import {ChatService} from "../../../core/chat/chat.service";
@Component({
selector: 'app-messages-main',
imports: [
MessagesMenu,
MessagesInfoUser,
MessagesSend
],
imports: [CommonModule, MessagesMenu, MessagesInfoUser, MessagesSend],
templateUrl: './messages-main.component.html',
styleUrl: './messages-main.component.css'
})
export class MessagesMain {
export class MessagesMain implements OnInit {
}
private route = inject(ActivatedRoute);
private discussionService = inject(discussionsService);
private authService = inject(AuthService);
private chatService = inject(ChatService);
currentDiscussionId!: string;
currentUserId!: number;
messages: Message[] = [];
discussionName: string = '';
groupId: number | null = null;
async ngOnInit() {
this.currentDiscussionId = this.route.snapshot.paramMap.get('discussionId')!;
this.currentUserId = this.authService.getCurrentUserId();
this.discussionService.getDiscussions().subscribe({
next: (discussions) => {
const discussion = discussions.find(d => d.id === +this.currentDiscussionId);
console.log('discussion:', discussion);
this.discussionName = discussion?.name ?? '';
this.groupId = discussion?.groupId ?? null;
console.log('groupId:', this.groupId);
}
});
this.discussionService.getMessages(this.currentDiscussionId).subscribe({
next: (messages) => this.messages = messages,
error: (err) => console.error('Impossible de charger les messages', err)
});
// réception temps réel
this.chatService.onMessage((message: Message) => {
this.messages = [...this.messages, message];
});
// rejoindre la room pour ne recevoir que cette conversation
await this.chatService.connect();
await this.chatService.joinConversation(this.currentDiscussionId);
}
isSent(message: Message): boolean {
return message.userId === this.currentUserId;
}
}
@@ -1,29 +1,21 @@
.hamburger-btn {
width: 50px;
height: 50px;
align-self: flex-start;
width: 44px;
height: 44px;
border-radius: 14px;
background: white;
border: none;
cursor: pointer;
border-radius: 17px;
/* Dégradé radial depuis le coin supérieur gauche pour l'effet "glow" */
background: radial-gradient(ellipse at 30% 30%, #fff 0%, #f9ece9 60%, #f3d4cc 100%);
/* Légère ombre rosée */
box-shadow: 0 4px 24px rgba(200, 120, 100, 0.13);
box-shadow: 0 2px 10px rgba(180, 80, 80, 0.12);
display: flex;
align-items: center;
justify-content: center;
color: rosybrown;
cursor: pointer;
margin-bottom: 28px;
transition: box-shadow 0.2s, transform 0.15s;
/* Transitions pour l'hover */
transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hamburger-btn:hover {
transform: scale(1.04);
box-shadow: 0 6px 28px rgba(200, 120, 100, 0.2);
}
.hamburger-btn:active {
transform: scale(0.97);
&:active {
transform: scale(0.94);
box-shadow: 0 1px 5px rgba(180, 80, 80, 0.1);
}
}
@@ -1,27 +1,37 @@
import { Component } from '@angular/core';
import {FormControl, FormsModule, ReactiveFormsModule} from "@angular/forms";
import { Component, inject, Input } from '@angular/core';
import { FormControl, FormsModule, ReactiveFormsModule } from "@angular/forms";
import { ChatService } from "../../../core/chat/chat.service";
@Component({
selector: 'app-messages-send',
imports: [
FormsModule,
ReactiveFormsModule
],
templateUrl:'./messages-send.component.html',
imports: [FormsModule, ReactiveFormsModule],
templateUrl: './messages-send.component.html',
styleUrl: './messages-send.component.css'
})
export class MessagesSend {
sendMessage = new FormControl();
onSubmit() {
private chatService = inject(ChatService);
@Input() discussionId!: string;
sendMessage = new FormControl();
isSending = false;
async onSubmit() {
const message = this.sendMessage.value;
if (!message || message.trim() === '') return;
if (this.isSending) return;
console.log('Message envoyé :', message);
this.isSending = true;
// Logique d'envoi
this.sendMessage.reset();
try {
await this.chatService.sendMessage(this.discussionId, message.trim());
this.sendMessage.reset();
} catch (error) {
console.error('Erreur lors de l\'envoi :', error);
} finally {
this.isSending = false;
}
}
}
@@ -0,0 +1,21 @@
.logout-btn {
align-self: flex-start;
width: 44px;
height: 44px;
border-radius: 14px;
background: white;
border: none;
box-shadow: 0 2px 10px rgba(180, 80, 80, 0.12);
display: flex;
align-items: center;
justify-content: center;
color: rosybrown;
cursor: pointer;
margin-bottom: 28px;
transition: box-shadow 0.2s, transform 0.15s;
&:active {
transform: scale(0.94);
box-shadow: 0 1px 5px rgba(180, 80, 80, 0.1);
}
}
@@ -0,0 +1,7 @@
<button class="logout-btn" (click)="logout()">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
<polyline points="16 17 21 12 16 7" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
<line x1="21" y1="12" x2="9" y2="12" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>
</svg>
</button>
@@ -0,0 +1,16 @@
import {Component, inject} from '@angular/core';
import {AuthService} from "../../../core/auth/auth.service";
@Component({
selector: 'app-disconnect',
imports: [],
templateUrl: './disconnect.component.html',
styleUrl: './disconnect.component.css'
})
export class DisconnectComponent {
private authService = inject(AuthService);
logout() {
this.authService.logout();
}
}
@@ -0,0 +1,105 @@
.modal-layout {
display: flex;
flex-direction: column;
height: 100%;
background: linear-gradient(160deg, #f9e8e8 0%, #f2c4c4 35%, #e89898 70%, #d97070 100%);
}
.modal-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px 20px 12px;
border-bottom: 1px solid rgba(189, 90, 90, 0.15);
}
.modal-title {
font-size: 1.1rem;
font-weight: 700;
color: #7a2e2e;
margin: 0;
}
.modal-close-btn {
width: 34px;
height: 34px;
border-radius: 10px;
background: white;
border: none;
box-shadow: 0 2px 8px rgba(180, 80, 80, 0.12);
display: flex;
align-items: center;
justify-content: center;
color: #bd5a5a;
cursor: pointer;
font-size: 1.2rem;
transition: transform 0.15s;
&:active { transform: scale(0.92); }
}
.modal-body {
display: flex;
flex-direction: column;
gap: 20px;
padding: 24px 20px;
}
.input-wrapper {
display: flex;
flex-direction: column;
gap: 6px;
padding-bottom: 10px;
}
.custom-item {
--background: white;
--border-radius: 12px;
--padding-start: 14px;
--inner-padding-end: 14px;
--color: #7a2e2e;
--highlight-color-focused: #bd5a5a;
border-radius: 12px;
box-shadow: 0 2px 10px rgba(180, 80, 80, 0.1);
&.invalid {
--border-color: #d97070;
box-shadow: 0 2px 10px rgba(180, 80, 80, 0.25);
}
}
.error-msg {
color: #7a2e2e;
font-size: 0.8rem;
padding-left: 4px;
margin: 0;
}
.submit-btn {
width: 100%;
background: white;
color: #bd5a5a;
border: none;
border-radius: 14px;
padding: 14px;
font-size: 0.95rem;
font-weight: 600;
box-shadow: 0 2px 10px rgba(180, 80, 80, 0.15);
cursor: pointer;
transition: transform 0.15s, box-shadow 0.2s;
&:active {
transform: scale(0.97);
box-shadow: 0 1px 5px rgba(180, 80, 80, 0.1);
}
&:disabled {
opacity: 0.5;
cursor: not-allowed;
}
}
:host {
display: block;
height: 100%;
}
@@ -0,0 +1,54 @@
<div class="modal-layout">
<div class="modal-header">
<h2 class="modal-title">Modifier les coordonnées</h2>
<button class="modal-close-btn" (click)="close.emit()">
<ion-icon name="close-outline" />
</button>
</div>
<div class="modal-body">
<form [formGroup]="coordinatesForm" (ngSubmit)="submitForm()">
<div class="input-wrapper">
<ion-item class="custom-item" [class.invalid]="email.invalid && email.touched">
<ion-input
label="Email"
labelPlacement="floating"
type="email"
formControlName="email"
placeholder="exemple@email.com"
/>
</ion-item>
@if (email.invalid && email.touched) {
<p class="error-msg">Adresse email invalide</p>
}
</div>
<div class="input-wrapper">
<ion-item class="custom-item" [class.invalid]="tel.invalid && tel.touched">
<ion-input
label="Téléphone"
labelPlacement="floating"
type="tel"
formControlName="tel"
placeholder="0612345678"
/>
</ion-item>
@if (tel.invalid && tel.touched) {
<p class="error-msg">Numéro à 10 chiffres requis</p>
}
</div>
<button
class="submit-btn"
type="submit"
[disabled]="coordinatesForm.invalid || loading()"
>
{{ loading() ? 'Enregistrement...' : 'Valider' }}
</button>
</form>
</div>
</div>
@@ -0,0 +1,76 @@
import {Component, EventEmitter, inject, Output, signal} from '@angular/core';
import { addIcons } from 'ionicons';
import { closeOutline } from 'ionicons/icons';
import {
IonButton,
IonButtons,
IonContent,
IonHeader,
IonIcon, IonInput,
IonItem, IonNote,
IonTitle,
IonToolbar
} from "@ionic/angular/standalone";
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";
import {firstValueFrom} from "rxjs";
import {KnotsDTOUserUpdateUserContactDto, UsersService} from "../../../services/api";
import {AuthService} from "../../../core/auth/auth.service";
@Component({
selector: 'app-parameters-coordinates-form',
imports: [IonIcon,ReactiveFormsModule, IonItem, IonInput],
templateUrl: './parameters-coordinates-form.component.html',
styleUrl: './parameters-coordinates-form.component.css'
})
export class ParametersCoordinatesFormComponent {
@Output() close = new EventEmitter<void>();
private userService = inject(UsersService);
private authService = inject(AuthService);
loading = signal(false);
coordinatesForm = new FormGroup({
email: new FormControl<string>(null, [Validators.required, Validators.email]),
tel: new FormControl<string>(null, [Validators.required, Validators.pattern(/^\d{10}$/)]),
});
constructor() {
addIcons({ closeOutline });
}
ngOnInit() {
const user = this.authService.currentUser();
this.coordinatesForm.patchValue({
email: user?.email ?? null,
tel: user?.tel ?? null,
});
}
get email() { return this.coordinatesForm.get('email')!; }
get tel() { return this.coordinatesForm.get('tel')!; }
async submitForm() {
if (this.coordinatesForm.invalid) return;
this.loading.set(true);
const user = this.authService.currentUser();
if (!user) return;
const userValue: KnotsDTOUserUpdateUserContactDto = {
email: this.coordinatesForm.value.email,
tel: this.coordinatesForm.value.tel,
};
try {
await firstValueFrom(this.userService.patchUserContactEndpoint(Number(user.id), userValue));
this.coordinatesForm.reset();
this.close.emit();
} catch (e) {
console.error('Erreur lors de la mise à jour des coordonnées', e);
}
this.loading.set(false);
}
}
@@ -0,0 +1,95 @@
.coordinates-btn {
display: flex;
align-items: center;
gap: 14px;
padding: 7px 105px 7px 5px;
border: 1.5px solid rgba(201, 112, 112, 0.25);
cursor: pointer;
border-radius: 50px;
background: #fff8f8;
box-shadow:
0 8px 32px rgba(180, 80, 80, 0.12),
0 2px 8px rgba(180, 80, 80, 0.08);
transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
font-family: 'Nunito', 'Segoe UI', sans-serif;
}
.coordinates-btn:hover {
background: #fff3f3;
box-shadow: 0 6px 28px rgba(180, 80, 80, 0.18);
transform: translateY(-1px);
}
.coordinates-btn:active {
transform: translateY(1px) scale(0.985);
background: #ffe8e8;
box-shadow: 0 2px 8px rgba(180, 80, 80, 0.10);
}
.coordinates-btn .icon-wrapper {
width: 40px;
height: 40px;
border-radius: 50%;
background-color: #f8e2e2;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
box-shadow: 0 4px 12px rgba(180, 80, 80, 0.2);
}
.coordinates-btn .icon-wrapper img {
width: 28px;
height: 28px;
filter: brightness(0) invert(1);
}
.coordinates-btn .username {
font-size: 14.5px;
font-weight: 500;
color: #7a3a3a;
white-space: nowrap;
}
@media (min-width: 480px) {
.coordinates-btn {
padding: 8px 120px 8px 6px;
gap: 16px;
}
.coordinates-btn .icon-wrapper {
width: 44px;
height: 44px;
}
.coordinates-btn .icon-wrapper img {
width: 30px;
height: 30px;
}
.coordinates-btn .username {
font-size: 15px;
}
}
@media (min-width: 768px) {
.coordinates-btn {
padding: 9px 140px 9px 7px;
gap: 18px;
border-radius: 50px;
}
.coordinates-btn .icon-wrapper {
width: 50px;
height: 50px;
}
.coordinates-btn .icon-wrapper img {
width: 32px;
height: 32px;
}
.coordinates-btn .username {
font-size: 16px;
}
}
@@ -0,0 +1,17 @@
<button class="coordinates-btn" (click)="openModal()">
<svg width="35" height="35" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path d="M256 48c-114.9 0-208 93.1-208 208s93.1 208 208 208c42.6 0 81.8-12.8 114.4-34.7 6.6-4.5 8.3-13.5 3.8-20.1-4.5-6.6-13.5-8.3-20.1-3.8C325.9 420.6 292.2 432 256 432c-97 0-176-79-176-176S159 80 256 80s176 79 176 176v40c0 22.1-17.9 40-40 40s-40-17.9-40-40v-40c0-53-43-96-96-96s-96 43-96 96 43 96 96 96c22.1 0 42.4-7.5 58.6-20.1C328.7 354.2 358.1 368 392 368c39.7 0 72-32.3 72-72v-40c0-114.9-93.1-208-208-208zm0 272c-35.3 0-64-28.7-64-64s28.7-64 64-64 64 28.7 64 64-28.7 64-64 64z" fill="#BD5A5A" fill-opacity="0.8"
stroke="#BD5A5A"
stroke-width="8"
stroke-linejoin="round"
stroke-linecap="round"
/>
</svg>
<span class="username">Modifier les coordonnées</span>
</button>
<ion-modal [isOpen]="isModalOpen" (didDismiss)="closeModal()">
<ng-template>
<app-parameters-coordinates-form (close)="closeModal()" />
</ng-template>
</ion-modal>
@@ -0,0 +1,19 @@
import {Component, ViewEncapsulation} from '@angular/core';
import { IonModal, IonButton } from '@ionic/angular/standalone';
import {FormsModule} from "@angular/forms";
import {ParametersCoordinatesFormComponent} from "../parameters-coordinates-form/parameters-coordinates-form.component";
@Component({
selector: 'app-parameters-coordinates',
encapsulation: ViewEncapsulation.None,
imports: [IonModal, FormsModule, ParametersCoordinatesFormComponent],
templateUrl: './parameters-coordinates.component.html',
styleUrl: './parameters-coordinates.component.css'
})
export class ParametersCoordinatesComponent {
isModalOpen = false;
openModal() { this.isModalOpen = true; }
closeModal() { this.isModalOpen = false; }
}
@@ -0,0 +1,21 @@
.hamburger-btn {
align-self: flex-start;
width: 44px;
height: 44px;
border-radius: 14px;
background: white;
border: none;
box-shadow: 0 2px 10px rgba(180, 80, 80, 0.12);
display: flex;
align-items: center;
justify-content: center;
color: rosybrown;
cursor: pointer;
margin-bottom: 28px;
transition: box-shadow 0.2s, transform 0.15s;
&:active {
transform: scale(0.94);
box-shadow: 0 1px 5px rgba(180, 80, 80, 0.1);
}
}
@@ -1,10 +1,6 @@
<button class="hamburger-btn" (click)="exitParam()">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="64.000000pt" height="64.000000pt" viewBox="0 0 64.000000 64.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,64.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
</g>
<svg width="20" height="20" viewBox="0 0 24 24" fill="none">
<path d="M19 12H5M5 12L12 19M5 12L12 5" stroke="currentColor" stroke-width="2.5"
stroke-linecap="round" stroke-linejoin="round" />
</svg>
</button>
@@ -2,7 +2,20 @@
min-height: 100vh;
display: flex;
flex-direction: column;
background: radial-gradient(ellipse at 50% 5%, #fff8f7 0%, #fde0db 45%, #dea09a 100%);
background: linear-gradient(
160deg,
#f9e8e8 0%,
#f2c4c4 35%,
#e89898 70%,
#d97070 100%
);
padding: 16px;
gap: 12px;
}
.header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
}
@@ -1,5 +1,13 @@
<div class="page-param" >
<app-parameters-exit/>
<p>Paramètres !</p>
<div class="header">
<app-parameters-exit/>
<app-disconnect/>
</div>
<div>
<app-parameters-coordinates/>
<app-parameters-profile/>
</div>
</div>
@@ -1,14 +1,21 @@
import { Component } from '@angular/core';
import {ParametersExit} from "../parameters-exit/parameters-exit.component";
import {DisconnectComponent} from "../disconnect/disconnect.component";
import {ParametersCoordinatesComponent} from "../parameters-coordinates/parameters-coordinates.component";
import {ParametersProfileComponent} from "../parameters-profile/parameters-profile.component";
@Component({
selector: 'app-parameters-main',
imports: [
ParametersExit
],
templateUrl: './parameters-main.component.html',
styleUrl: './parameters-main.component.css'
selector: 'app-parameters-main',
templateUrl: './parameters-main.component.html',
imports: [
ParametersExit,
DisconnectComponent,
ParametersCoordinatesComponent,
ParametersProfileComponent
],
styleUrl: './parameters-main.component.css'
})
export class ParametersMain {
}
@@ -0,0 +1,256 @@
.card-wrapper {
display: flex;
align-items: flex-start;
justify-content: center;
min-height: 100vh;
padding: 60px 16px 24px;
font-family: 'Nunito', 'Segoe UI', sans-serif;
box-sizing: border-box;
@media (min-width: 480px) {
padding: 60px 24px 24px;
}
@media (min-width: 768px) {
padding: 80px 32px 32px;
}
}
.card {
background: #fff8f8;
border-radius: 20px;
padding: 28px 21px 28px;
width: 100%;
max-width: 340px;
box-shadow:
0 8px 32px rgba(180, 80, 80, 0.12),
0 2px 8px rgba(180, 80, 80, 0.08),
inset 0 0 0 1.5px rgba(255, 255, 255, 0.7);
display: flex;
flex-direction: column;
gap: 16px;
@media (min-width: 480px) {
padding: 28px 24px;
gap: 16px;
}
@media (min-width: 768px) {
max-width: 400px;
padding: 32px 28px;
border-radius: 24px;
gap: 18px;
}
}
.avatar-row {
display: flex;
align-items: center;
gap: 18px;
margin-bottom: 4px;
@media (min-width: 480px) {
gap: 18px;
margin-bottom: 4px;
flex-wrap: nowrap;
}
}
.avatar {
width: 80px;
height: 80px;
border-radius: 50%;
background: #c97878;
flex-shrink: 0;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 12px rgba(180, 80, 80, 0.2);
@media (min-width: 480px) {
width: 80px;
height: 80px;
}
@media (min-width: 768px) {
width: 90px;
height: 90px;
}
img {
width: 100%;
height: 100%;
object-fit: cover;
}
svg {
width: 100%;
height: 100%;
}
}
.photo-btn {
background: radial-gradient(ellipse at 30% 40%, #fff 0%, #f9ece9 60%, #f3d4cc 100%);
box-shadow: 0 4px 24px rgba(200, 120, 100, 0.12);
color: #c97070;
border: 1.5px solid rgba(201, 112, 112, 0.25);
border-radius: 50px;
padding: 9px 16px;
font-size: 13px;
font-weight: 600;
font-family: inherit;
cursor: pointer;
transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
white-space: nowrap;
line-height: 1.2;
@media (min-width: 480px) {
padding: 9px 16px;
font-size: 13px;
}
@media (min-width: 768px) {
padding: 10px 18px;
font-size: 14px;
}
&:hover {
background: #f8d8d8;
box-shadow: 0 2px 8px rgba(180, 80, 80, 0.15);
transform: translateY(-1px);
}
&:active {
transform: translateY(0);
}
}
.field {
background: #fdf4f4;
border: 1.5px solid rgba(201, 112, 112, 0.15);
border-radius: 14px;
padding: 12px 14px;
display: flex;
align-items: flex-start;
gap: 8px;
position: relative;
transition: border-color 0.2s, box-shadow 0.2s;
@media (min-width: 480px) {
border-radius: 14px;
padding: 12px 14px;
}
@media (min-width: 768px) {
padding: 14px 16px;
}
&:hover {
border-color: rgba(201, 112, 112, 0.3);
box-shadow: 0 2px 8px rgba(180, 80, 80, 0.07);
}
}
.bio-field {
min-height: 90px;
align-items: flex-start;
@media (min-width: 480px) {
min-height: 90px;
}
@media (min-width: 768px) {
min-height: 110px;
}
}
.field-value {
flex: 1;
color: #7a3a3a;
font-size: 14.5px;
font-weight: 500;
line-height: 1.5;
@media (min-width: 480px) {
font-size: 14.5px;
}
@media (min-width: 768px) {
font-size: 15px;
}
}
.bio-value {
align-self: flex-start;
}
.field-input {
flex: 1;
border: none;
outline: none;
background: transparent;
color: #7a3a3a;
font-size: 14.5px;
font-weight: 500;
font-family: inherit;
line-height: 1.5;
resize: none;
width: 100%;
@media (min-width: 480px) {
font-size: 14.5px;
}
@media (min-width: 768px) {
font-size: 15px;
}
}
.bio-textarea {
min-height: 60px;
resize: none;
}
.edit-btn {
background: none;
border: none;
cursor: pointer;
color: #c97070;
padding: 2px;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
opacity: 0.7;
transition: opacity 0.2s, transform 0.15s;
@media (min-width: 480px) {
min-width: unset;
min-height: unset;
}
svg {
width: 16px;
height: 16px;
}
@media (min-width: 768px) {
width: 17px;
height: 17px;
}
&:hover {
opacity: 1;
transform: scale(1.15);
}
.field-error {
color: var(--ion-color-danger, #eb445a);
font-size: 0.75rem;
padding: 2px 0 0 4px;
}
}
@@ -0,0 +1,79 @@
<div class="card-wrapper">
<div class="card">
<!-- Avatar + Photo button -->
<div class="avatar-row">
<div class="avatar">
<img *ngIf="profileImage()" [src]="profileImage()" alt="Photo de profil" />
<svg *ngIf="!profileImage()" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="40" cy="30" r="16" fill="rgba(255,255,255,0.55)" />
<ellipse cx="40" cy="68" rx="26" ry="18" fill="rgba(255,255,255,0.55)" />
</svg>
</div>
<button class="photo-btn" (click)="triggerFileInput()">
Modifier la photo de profil
</button>
<input id="photoInput" type="file" accept="image/*" hidden (change)="onPhotoChange($event)" />
</div>
<!-- Username field -->
<div class="field">
<ng-container *ngIf="!editingUsername(); else editUsernameBlock">
<span class="field-value">{{ username() }}</span>
</ng-container>
<ng-template #editUsernameBlock>
<input
class="field-input"
[(ngModel)]="username"
[ngModel]="username()"
(ngModelChange)="username.set($event)"
(blur)="toggleEditUsername()"
(keydown.enter)="toggleEditUsername()"
autofocus
/>
</ng-template>
<button class="edit-btn" (click)="toggleEditUsername()" title="Modifier">
<svg *ngIf="!editingUsername()" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.5 3.5L16.5 6.5L7 16H4V13L13.5 3.5Z" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/>
<path d="M11.5 5.5L14.5 8.5" stroke="currentColor" stroke-width="1.6"/>
</svg>
<svg *ngIf="editingUsername()" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4 10L8 14L16 6" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
</div>
<!-- Sous la div.field du username -->
<span class="field-error" *ngIf="usernameError()">{{ usernameError() }}</span>
<!-- Bio field -->
<div class="field bio-field">
<ng-container *ngIf="!editingBio(); else editBioBlock">
<span class="field-value bio-value">{{ bio() }}</span>
</ng-container>
<ng-template #editBioBlock>
<input
class="field-input"
[(ngModel)]="bio"
[ngModel]="bio()"
(ngModelChange)="bio.set($event)"
(blur)="toggleEditBio()"
(keydown.enter)="toggleEditBio()"
autofocus
/>
</ng-template>
<textarea class="field-input bio-textarea" [value]="bio()" (input)="bio.set($any($event.target).value)" (blur)="toggleEditBio()" autofocus></textarea>
<button class="edit-btn" (click)="toggleEditBio()" title="Modifier">
<svg *ngIf="!editingBio()" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.5 3.5L16.5 6.5L7 16H4V13L13.5 3.5Z" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/>
<path d="M11.5 5.5L14.5 8.5" stroke="currentColor" stroke-width="1.6"/>
</svg>
<svg *ngIf="editingBio()" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4 10L8 14L16 6" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
</div>
</div>
</div>
@@ -0,0 +1,143 @@
import {Component, inject, OnInit, signal} from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import {firstValueFrom} from "rxjs";
import {UsersService} from "../../../services/api";
import {AuthService} from "../../../core/auth/auth.service";
@Component({
selector: 'app-parameters-profile',
imports: [FormsModule, CommonModule],
templateUrl: './parameters-profile.component.html',
standalone: true,
styleUrl: './parameters-profile.component.css'
})
export class ParametersProfileComponent implements OnInit {
private usersService = inject(UsersService);
private authService = inject(AuthService);
profileImage = signal<string>(null);
username = signal<string>(null);
bio = signal<string>(null);
editingUsername = signal(false);
editingBio = signal(false);
usernameError = signal<string>(null);
loading = signal(false);
ngOnInit() {
const user = this.authService.currentUser();
this.profileImage.set(user?.profilePicture ?? null);
this.username.set(user?.username ?? null);
this.bio.set(user?.description ?? null);
}
// --- Username ---
toggleEditUsername() {
if (this.editingUsername()) {
this.submitUsername();
} else {
this.usernameError.set(null);
this.editingUsername.set(true);
}
}
async submitUsername() {
const value = this.username()?.trim();
if (!value) {
this.usernameError.set('Le pseudo ne peut pas être vide.');
return;
}
if (value === this.authService.currentUser()?.username) {
this.editingUsername.set(false);
return;
}
this.loading.set(true);
const user = this.authService.currentUser();
if (!user) return;
try {
await firstValueFrom(this.usersService.patchUsernameEndpoint(
String(user.id), { username: value }
));
this.authService.updateCurrentUser({ username: value }); // 👈 maj locale
this.usernameError.set(null);
this.editingUsername.set(false);
} catch (e: any) {
if (e?.status === 400) {
this.usernameError.set('Ce nom d\'utilisateur est déjà pris.');
} else {
this.usernameError.set('Erreur lors de la mise à jour.');
}
}
this.loading.set(false);
}
// --- Bio ---
toggleEditBio() {
if (this.editingBio()) {
this.submitBio();
} else {
this.editingBio.set(true);
}
}
async submitBio() {
this.loading.set(true);
const user = this.authService.currentUser();
if (!user) return;
try {
await firstValueFrom(this.usersService.patchUserDescriptionEndpoint(
String(user.id), { description: this.bio() }
));
this.authService.updateCurrentUser({ description: this.bio() }); // 👈 maj locale
this.editingBio.set(false);
} catch (e) {
console.error('Erreur lors de la mise à jour de la bio', e);
}
this.loading.set(false);
}
// --- Photo ---
triggerFileInput() {
document.getElementById('photoInput')?.click();
}
async onPhotoChange(event: Event) {
const file = (event.target as HTMLInputElement).files?.[0];
if (!file) return;
const reader = new FileReader();
reader.onload = async () => {
const base64 = reader.result as string;
this.profileImage.set(base64);
this.loading.set(true);
const user = this.authService.currentUser();
if (!user) return;
try {
await firstValueFrom(this.usersService.patchUserProfilePictureEndpoint(
String(user.id), { profilePicture: base64 }
));
this.authService.updateCurrentUser({ profilePicture: base64 }); // 👈 maj locale
} catch (e) {
console.error('Erreur lors de la mise à jour de la photo', e);
}
this.loading.set(false);
};
reader.readAsDataURL(file);
}
}
@@ -0,0 +1,160 @@
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');
/* ---- Page background ---- */
ion-content.bg {
--background: transparent;
--overflow: hidden;
&::before {
content: '';
position: fixed;
inset: 0;
background: linear-gradient(
160deg,
#f9e8e8 0%,
#f2c4c4 35%,
#e89898 70%,
#d97070 100%
);
z-index: -1;
}
}
/* ---- Centered container ---- */
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100%;
padding: 40px 24px;
font-family: 'Nunito', sans-serif;
gap: 10px;
}
/* ---- Logo box ---- */
.logo-box {
width: 80px;
height: 80px;
background: #ffffff;
border-radius: 22px;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 18px rgba(180, 80, 80, 0.18);
overflow: hidden;
margin-bottom: 4px;
img {
width: 52px;
height: 52px;
object-fit: contain;
}
}
/* ---- App title ---- */
h1 {
font-family: 'Nunito', sans-serif;
font-size: 28px;
font-weight: 800;
color: #b05050;
margin: 0 0 10px;
letter-spacing: 0.5px;
}
/* ---- White card ---- */
.card {
width: 100%;
max-width: 340px;
background: rgba(255, 255, 255, 0.88);
border-radius: 24px;
padding: 28px 24px 32px;
box-shadow: 0 8px 32px rgba(180, 80, 80, 0.12);
display: flex;
flex-direction: column;
gap: 14px;
h3 {
font-family: 'Nunito', sans-serif;
font-size: 16px;
font-weight: 700;
color: #b05050;
text-align: center;
margin: 0;
}
.subtitle {
font-family: 'Nunito', sans-serif;
font-size: 13px;
font-weight: 600;
color: #c98080;
text-align: center;
margin: -6px 0 4px;
}
}
/* ---- Inputs ---- */
.input {
--background: rgba(255, 255, 255, 0.95);
--border-radius: 50px;
--padding-start: 18px;
--padding-end: 18px;
--inner-padding-end: 0;
--highlight-color-focused: #d97070;
border-radius: 50px;
box-shadow: 0 2px 8px rgba(180, 80, 80, 0.10);
overflow: hidden;
ion-input {
--placeholder-color: #c9a0a0;
--placeholder-opacity: 1;
--color: #6b3030;
font-family: 'Nunito', sans-serif;
font-size: 15px;
font-weight: 600;
caret-color: #d97070;
}
}
/* ---- Register button ---- */
.btn {
--background: #b05050;
--background-activated: #903838;
--border-radius: 50px;
--box-shadow: 0 4px 16px rgba(176, 80, 80, 0.35);
--color: #ffffff;
font-family: 'Nunito', sans-serif;
font-size: 16px;
font-weight: 700;
letter-spacing: 0.3px;
margin-top: 6px;
height: 48px;
transition: transform 0.15s ease, box-shadow 0.15s ease;
&:active {
transform: scale(0.97);
--box-shadow: 0 2px 8px rgba(176, 80, 80, 0.25);
}
}
/* ---- Login link ---- */
.signup {
text-align: center;
font-family: 'Nunito', sans-serif;
font-size: 14px;
font-weight: 700;
color: #b05050;
line-height: 1.7;
margin-top: 6px;
a {
color: #b05050;
font-weight: 800;
text-decoration: underline;
text-underline-offset: 2px;
&:hover {
color: #903838;
}
}
}
@@ -1,22 +1,52 @@
<ion-card>
<ion-card-header>
<ion-card-title>Inscrivez-vous à Knots !</ion-card-title><br>
<ion-card-subtitle>Commencez à nouer des liens !</ion-card-subtitle><br>
</ion-card-header>
<ion-content [fullscreen]="true" class="bg">
<div class="container">
<ion-card-content>
Nom d'utilisateur
<br>
<input type="text">
<br><br>
Mot de Passe
<br>
<input type="password" id="password">
<br><br>
Confirmez votre mot de passe
<br>
<input type="password" id="confirmPassword">
</ion-card-content><br>
<div class="logo-box">
<img src="assets/icon/logo.png" alt="logo">
</div>
<ion-button fill="clear">Créer son compte</ion-button>
</ion-card>
<h1>Knots</h1>
<div class="card" [formGroup]="registerForm">
<h3>Inscrivez-vous à Knots !</h3>
<p class="subtitle">Commencez à nouer des liens !</p>
<ion-item lines="none" class="input">
<ion-input placeholder="Nom d'utilisateur..." formControlName="username"></ion-input>
</ion-item>
<ion-item lines="none" class="input">
<ion-input type="email" placeholder="Email..." formControlName="email"></ion-input>
</ion-item>
<ion-item lines="none" class="input">
<ion-input type="tel" placeholder="Téléphone (10 chiffres)..." formControlName="tel"></ion-input>
</ion-item>
<ion-item lines="none" class="input">
<ion-input type="password" placeholder="Mot de passe..." formControlName="password"></ion-input>
</ion-item>
<ion-item lines="none" class="input">
<ion-input type="password" placeholder="Confirmez votre mot de passe..." formControlName="confirmPassword"></ion-input>
</ion-item>
<p *ngIf="registerForm.hasError('passwordMismatch')"
style="color:#d97070; font-size:13px; text-align:center; margin:0;">
Les mots de passe ne correspondent pas.
</p>
<ion-button expand="block" class="btn" (click)="submitForm()" [disabled]="isLoading">
{{ isLoading ? 'Création...' : 'Créer son compte' }}
</ion-button>
</div>
<div class="signup">
Déjà un compte ?<br>
<a (click)="goToLogin()">Connectez-vous ici</a>
</div>
</div>
</ion-content>
@@ -1,26 +1,73 @@
import { Component } from '@angular/core';
import {
IonButton,
IonCard,
IonCardContent,
IonCardHeader,
IonCardSubtitle,
IonCardTitle
} from "@ionic/angular/standalone";
import { Component, inject } from '@angular/core';
import { IonButton, IonContent, IonInput, IonItem } from "@ionic/angular/standalone";
import { Router } from "@angular/router";
import { FormBuilder, ReactiveFormsModule, Validators } from "@angular/forms";
import { CommonModule } from "@angular/common";
import { AuthService } from "../../core/auth/auth.service";
@Component({
selector: 'app-register-form',
imports: [
IonButton,
IonCard,
IonCardContent,
IonCardHeader,
IonCardTitle,
IonCardSubtitle
],
templateUrl: './register-form.component.html',
styleUrl: './register-form.component.css'
selector: 'app-register-form',
imports: [IonButton, IonInput, IonContent, IonItem, ReactiveFormsModule, CommonModule],
templateUrl: './register-form.component.html',
styleUrl: './register-form.component.css'
})
export class RegisterFormComponent {
}
private router = inject(Router);
private fb = inject(FormBuilder);
private authService = inject(AuthService);
isLoading = false;
registerForm = this.fb.group({
username: ['', [Validators.required, Validators.maxLength(50)]],
email: ['', [Validators.required, Validators.email, Validators.maxLength(70)]],
tel: ['', [Validators.required, Validators.minLength(10), Validators.maxLength(10)]],
password: ['', [Validators.required, Validators.minLength(12), Validators.maxLength(50)]],
confirmPassword: ['', [Validators.required]],
description: ['', [Validators.maxLength(200)]],
}, { validators: this.passwordMatchValidator });
passwordMatchValidator(form: any) {
const password = form.get('password')?.value;
const confirm = form.get('confirmPassword')?.value;
return password === confirm ? null : { passwordMismatch: true };
}
goToLogin() {
this.router.navigate(['/login']);
}
async submitForm() {
console.log('form valid:', this.registerForm.valid);
console.log('form errors:', this.registerForm.errors);
console.log('form values:', this.registerForm.value);
if (this.registerForm.valid) {
this.isLoading = true;
try {
await this.authService.register(
this.registerForm.value.username!,
this.registerForm.value.password!,
this.registerForm.value.email!,
this.registerForm.value.tel!,
this.registerForm.value.description ?? null,
);
} catch (err: any) {
if (err.status === 409) {
console.error('Ce nom d\'utilisateur est déjà pris.');
} else {
console.error('Impossible de contacter le serveur.');
}
} finally {
this.isLoading = false;
}
} else {
Object.values(this.registerForm.controls).forEach(control => {
if (control.invalid) {
control.markAsDirty();
control.updateValueAndValidity({ onlySelf: true });
}
});
}
}
}
+4
View File
@@ -0,0 +1,4 @@
wwwroot/*.js
node_modules
typings
dist
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
@@ -0,0 +1,51 @@
.gitignore
.openapi-generator-ignore
README.md
api.base.service.ts
api.module.ts
api/api.ts
api/discussions.service.ts
api/groups.service.ts
api/keys.service.ts
api/messages.service.ts
api/roles.service.ts
api/users.service.ts
configuration.ts
encoder.ts
git_push.sh
index.ts
model/fast-endpoints-error-response.ts
model/knots-dto-discussion-create-discussion-dto.ts
model/knots-dto-discussion-delete-discussion-dto.ts
model/knots-dto-group-create-group-dto.ts
model/knots-dto-group-delete-group-dto.ts
model/knots-dto-group-update-group-members-amount-dto.ts
model/knots-dto-group-update-group-name-dto.ts
model/knots-dto-group-update-group-profile-picture-dto.ts
model/knots-dto-key-create-key-dto.ts
model/knots-dto-key-delete-key-dto.ts
model/knots-dto-message-create-message-dto.ts
model/knots-dto-message-delete-message-dto.ts
model/knots-dto-message-get-message-details-dto.ts
model/knots-dto-role-delete-role-dto.ts
model/knots-dto-user-create-user-dto.ts
model/knots-dto-user-delete-user-dto.ts
model/knots-dto-user-get-user-dto.ts
model/knots-dto-user-login-response-dto.ts
model/knots-dto-user-login-user-dto.ts
model/knots-dto-user-update-user-contact-dto.ts
model/knots-dto-user-update-user-description-dto.ts
model/knots-dto-user-update-user-password-dto.ts
model/knots-dto-user-update-user-profile-picture-dto.ts
model/knots-dto-user-update-username-dto.ts
model/knots-endpoints-discussion-create-group-discussion-request.ts
model/knots-endpoints-discussion-create-private-discussion-request.ts
model/knots-endpoints-discussion-member-with-role-dto.ts
model/knots-endpoints-role-assign-role-request.ts
model/knots-endpoints-role-create-role-request.ts
model/knots-endpoints-role-role-dto.ts
model/models.ts
param.ts
provide-api.ts
query.params.ts
variables.ts
@@ -0,0 +1 @@
7.22.0
+185
View File
@@ -0,0 +1,185 @@
# @
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 1.0.0
## Building
To install the required dependencies and to build the typescript sources run:
```console
npm install
npm run build
```
## Publishing
First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!)
## Consuming
Navigate to the folder of your consuming project and run one of next commands.
_published:_
```console
npm install @ --save
```
_without publishing (not recommended):_
```console
npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save
```
_It's important to take the tgz file, otherwise you'll get trouble with links on windows_
_using `npm link`:_
In PATH_TO_GENERATED_PACKAGE/dist:
```console
npm link
```
In your project:
```console
npm link
```
__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages.
Please refer to this issue <https://github.com/angular/angular-cli/issues/8284> for a solution / workaround.
Published packages are not effected by this issue.
### General usage
In your Angular project:
```typescript
import { ApplicationConfig } from '@angular/core';
import { provideHttpClient } from '@angular/common/http';
import { provideApi } from '';
export const appConfig: ApplicationConfig = {
providers: [
// ...
provideHttpClient(),
provideApi()
],
};
```
**NOTE**
If you're still using `AppModule` and haven't [migrated](https://angular.dev/reference/migrations/standalone) yet, you can still import an Angular module:
```typescript
import { ApiModule } from '';
```
If different from the generated base path, during app bootstrap, you can provide the base path to your service.
```typescript
import { ApplicationConfig } from '@angular/core';
import { provideHttpClient } from '@angular/common/http';
import { provideApi } from '';
export const appConfig: ApplicationConfig = {
providers: [
// ...
provideHttpClient(),
provideApi('http://localhost:9999')
],
};
```
```typescript
// with a custom configuration
import { ApplicationConfig } from '@angular/core';
import { provideHttpClient } from '@angular/common/http';
import { provideApi } from '';
export const appConfig: ApplicationConfig = {
providers: [
// ...
provideHttpClient(),
provideApi({
withCredentials: true,
username: 'user',
password: 'password'
})
],
};
```
```typescript
// with factory building a custom configuration
import { ApplicationConfig } from '@angular/core';
import { provideHttpClient } from '@angular/common/http';
import { provideApi, Configuration } from '';
export const appConfig: ApplicationConfig = {
providers: [
// ...
provideHttpClient(),
{
provide: Configuration,
useFactory: (authService: AuthService) => new Configuration({
basePath: 'http://localhost:9999',
withCredentials: true,
username: authService.getUsername(),
password: authService.getPassword(),
}),
deps: [AuthService],
multi: false
}
],
};
```
### Using multiple OpenAPI files / APIs
In order to use multiple APIs generated from different OpenAPI files,
you can create an alias name when importing the modules
in order to avoid naming conflicts:
```typescript
import { provideApi as provideUserApi } from 'my-user-api-path';
import { provideApi as provideAdminApi } from 'my-admin-api-path';
import { HttpClientModule } from '@angular/common/http';
import { environment } from '../environments/environment';
export const appConfig: ApplicationConfig = {
providers: [
// ...
provideHttpClient(),
provideUserApi(environment.basePath),
provideAdminApi(environment.basePath),
],
};
```
### Customizing path parameter encoding
Without further customization, only [path-parameters][parameter-locations-url] of [style][style-values-url] 'simple'
and Dates for format 'date-time' are encoded correctly.
Other styles (e.g. "matrix") are not that easy to encode
and thus are best delegated to other libraries (e.g.: [@honoluluhenk/http-param-expander]).
To implement your own parameter encoding (or call another library),
pass an arrow-function or method-reference to the `encodeParam` property of the Configuration-object
(see [General Usage](#general-usage) above).
Example value for use in your Configuration-Provider:
```typescript
new Configuration({
encodeParam: (param: Param) => myFancyParamEncoder(param),
})
```
[parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations
[style-values-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values
[@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander
+96
View File
@@ -0,0 +1,96 @@
/**
* Knots
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http';
import { CustomHttpParameterCodec } from './encoder';
import { Configuration } from './configuration';
import { OpenApiHttpParams, QueryParamStyle, concatHttpParamsObject} from './query.params';
export class BaseService {
protected basePath = 'http://localhost:5250';
public defaultHeaders = new HttpHeaders();
public configuration: Configuration;
public encoder: HttpParameterCodec;
constructor(basePath?: string|string[], configuration?: Configuration) {
this.configuration = configuration || new Configuration();
if (typeof this.configuration.basePath !== 'string') {
const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined;
if (firstBasePath != undefined) {
basePath = firstBasePath;
}
if (typeof basePath !== 'string') {
basePath = this.basePath;
}
this.configuration.basePath = basePath;
}
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
}
protected canConsumeForm(consumes: string[]): boolean {
return consumes.indexOf('multipart/form-data') !== -1;
}
protected addToHttpParams(httpParams: OpenApiHttpParams, key: string, value: any | null | undefined, paramStyle: QueryParamStyle, explode: boolean): OpenApiHttpParams {
if (value === null || value === undefined) {
return httpParams;
}
if (paramStyle === QueryParamStyle.DeepObject) {
if (typeof value !== 'object') {
throw Error(`An object must be provided for key ${key} as it is a deep object`);
}
return Object.keys(value as Record<string, any>).reduce(
(hp, k) => hp.append(`${key}[${k}]`, value[k]),
httpParams,
);
} else if (paramStyle === QueryParamStyle.Json) {
return httpParams.append(key, JSON.stringify(value));
} else {
// Form-style, SpaceDelimited or PipeDelimited
if (Object(value) !== value) {
// If it is a primitive type, add its string representation
return httpParams.append(key, value.toString());
} else if (value instanceof Date) {
return httpParams.append(key, value.toISOString());
} else if (Array.isArray(value) || value instanceof Set) {
// Otherwise, if it's an array or set, add each element.
const array = Array.isArray(value) ? value : Array.from(value);
if (paramStyle === QueryParamStyle.Form) {
return httpParams.set(key, array, {explode: explode, delimiter: ','});
} else if (paramStyle === QueryParamStyle.SpaceDelimited) {
return httpParams.set(key, array, {explode: explode, delimiter: ' '});
} else {
// PipeDelimited
return httpParams.set(key, array, {explode: explode, delimiter: '|'});
}
} else {
// Otherwise, if it's an object, add each field.
if (paramStyle === QueryParamStyle.Form) {
if (explode) {
Object.keys(value).forEach(k => {
httpParams = this.addToHttpParams(httpParams, k, value[k], paramStyle, explode);
});
return httpParams;
} else {
return concatHttpParamsObject(httpParams, key, value, ',');
}
} else if (paramStyle === QueryParamStyle.SpaceDelimited) {
return concatHttpParamsObject(httpParams, key, value, ' ');
} else {
// PipeDelimited
return concatHttpParamsObject(httpParams, key, value, '|');
}
}
}
}
}
+30
View File
@@ -0,0 +1,30 @@
import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core';
import { Configuration } from './configuration';
import { HttpClient } from '@angular/common/http';
@NgModule({
imports: [],
declarations: [],
exports: [],
providers: []
})
export class ApiModule {
public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders<ApiModule> {
return {
ngModule: ApiModule,
providers: [ { provide: Configuration, useFactory: configurationFactory } ]
};
}
constructor( @Optional() @SkipSelf() parentModule: ApiModule,
@Optional() http: HttpClient) {
if (parentModule) {
throw new Error('ApiModule is already loaded. Import in your base AppModule only.');
}
if (!http) {
throw new Error('You need to import the HttpClientModule in your AppModule! \n' +
'See also https://github.com/angular/angular/issues/20575');
}
}
}
+13
View File
@@ -0,0 +1,13 @@
export * from './discussions.service';
import { DiscussionsService } from './discussions.service';
export * from './groups.service';
import { GroupsService } from './groups.service';
export * from './keys.service';
import { KeysService } from './keys.service';
export * from './messages.service';
import { MessagesService } from './messages.service';
export * from './roles.service';
import { RolesService } from './roles.service';
export * from './users.service';
import { UsersService } from './users.service';
export const APIS = [DiscussionsService, GroupsService, KeysService, MessagesService, RolesService, UsersService];
@@ -0,0 +1,653 @@
/**
* Knots
*
*
*
* 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, HttpContext
} from '@angular/common/http';
import { Observable } from 'rxjs';
import { OpenApiHttpParams, QueryParamStyle } from '../query.params';
// @ts-ignore
import { FastEndpointsErrorResponse } from '../model/fast-endpoints-error-response';
// @ts-ignore
import { KnotsDTODiscussionCreateDiscussionDto } from '../model/knots-dto-discussion-create-discussion-dto';
// @ts-ignore
import { KnotsDTODiscussionDeleteDiscussionDto } from '../model/knots-dto-discussion-delete-discussion-dto';
// @ts-ignore
import { KnotsDTOMessageGetMessageDetailsDto } from '../model/knots-dto-message-get-message-details-dto';
// @ts-ignore
import { KnotsEndpointsDiscussionCreateGroupDiscussionRequest } from '../model/knots-endpoints-discussion-create-group-discussion-request';
// @ts-ignore
import { KnotsEndpointsDiscussionCreatePrivateDiscussionRequest } from '../model/knots-endpoints-discussion-create-private-discussion-request';
// @ts-ignore
import { KnotsEndpointsDiscussionMemberWithRoleDto } from '../model/knots-endpoints-discussion-member-with-role-dto';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root'
})
export class DiscussionsService extends BaseService {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
/**
* @endpoint post /API/discussions
* @param knotsDTODiscussionCreateDiscussionDto
* @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.
* @param options additional options
*/
public createDiscussionEndpoint(knotsDTODiscussionCreateDiscussionDto: KnotsDTODiscussionCreateDiscussionDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any>;
public createDiscussionEndpoint(knotsDTODiscussionCreateDiscussionDto: KnotsDTODiscussionCreateDiscussionDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public createDiscussionEndpoint(knotsDTODiscussionCreateDiscussionDto: KnotsDTODiscussionCreateDiscussionDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public createDiscussionEndpoint(knotsDTODiscussionCreateDiscussionDto: KnotsDTODiscussionCreateDiscussionDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (knotsDTODiscussionCreateDiscussionDto === null || knotsDTODiscussionCreateDiscussionDto === undefined) {
throw new Error('Required parameter knotsDTODiscussionCreateDiscussionDto was null or undefined when calling createDiscussionEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/problem+json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/discussions`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsDTODiscussionCreateDiscussionDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint post /API/discussions/group
* @param knotsEndpointsDiscussionCreateGroupDiscussionRequest
* @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.
* @param options additional options
*/
public createGroupDiscussionEndpoint(knotsEndpointsDiscussionCreateGroupDiscussionRequest: KnotsEndpointsDiscussionCreateGroupDiscussionRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<object>;
public createGroupDiscussionEndpoint(knotsEndpointsDiscussionCreateGroupDiscussionRequest: KnotsEndpointsDiscussionCreateGroupDiscussionRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<object>>;
public createGroupDiscussionEndpoint(knotsEndpointsDiscussionCreateGroupDiscussionRequest: KnotsEndpointsDiscussionCreateGroupDiscussionRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<object>>;
public createGroupDiscussionEndpoint(knotsEndpointsDiscussionCreateGroupDiscussionRequest: KnotsEndpointsDiscussionCreateGroupDiscussionRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (knotsEndpointsDiscussionCreateGroupDiscussionRequest === null || knotsEndpointsDiscussionCreateGroupDiscussionRequest === undefined) {
throw new Error('Required parameter knotsEndpointsDiscussionCreateGroupDiscussionRequest was null or undefined when calling createGroupDiscussionEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/discussions/group`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<object>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsEndpointsDiscussionCreateGroupDiscussionRequest,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint post /API/discussions/private
* @param knotsEndpointsDiscussionCreatePrivateDiscussionRequest
* @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.
* @param options additional options
*/
public createPrivateDiscussionEndpoint(knotsEndpointsDiscussionCreatePrivateDiscussionRequest: KnotsEndpointsDiscussionCreatePrivateDiscussionRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<object>;
public createPrivateDiscussionEndpoint(knotsEndpointsDiscussionCreatePrivateDiscussionRequest: KnotsEndpointsDiscussionCreatePrivateDiscussionRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<object>>;
public createPrivateDiscussionEndpoint(knotsEndpointsDiscussionCreatePrivateDiscussionRequest: KnotsEndpointsDiscussionCreatePrivateDiscussionRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<object>>;
public createPrivateDiscussionEndpoint(knotsEndpointsDiscussionCreatePrivateDiscussionRequest: KnotsEndpointsDiscussionCreatePrivateDiscussionRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (knotsEndpointsDiscussionCreatePrivateDiscussionRequest === null || knotsEndpointsDiscussionCreatePrivateDiscussionRequest === undefined) {
throw new Error('Required parameter knotsEndpointsDiscussionCreatePrivateDiscussionRequest was null or undefined when calling createPrivateDiscussionEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/discussions/private`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<object>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsEndpointsDiscussionCreatePrivateDiscussionRequest,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint delete /API/discussions
* @param knotsDTODiscussionDeleteDiscussionDto
* @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.
* @param options additional options
*/
public deleteDiscussionEndpoint(knotsDTODiscussionDeleteDiscussionDto: KnotsDTODiscussionDeleteDiscussionDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any>;
public deleteDiscussionEndpoint(knotsDTODiscussionDeleteDiscussionDto: KnotsDTODiscussionDeleteDiscussionDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public deleteDiscussionEndpoint(knotsDTODiscussionDeleteDiscussionDto: KnotsDTODiscussionDeleteDiscussionDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public deleteDiscussionEndpoint(knotsDTODiscussionDeleteDiscussionDto: KnotsDTODiscussionDeleteDiscussionDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (knotsDTODiscussionDeleteDiscussionDto === null || knotsDTODiscussionDeleteDiscussionDto === undefined) {
throw new Error('Required parameter knotsDTODiscussionDeleteDiscussionDto was null or undefined when calling deleteDiscussionEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/problem+json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/discussions`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsDTODiscussionDeleteDiscussionDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint get /API/discussions
* @param id
* @param name
* @param isGroup
* @param membersCount
* @param groupId
* @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.
* @param options additional options
*/
public getDiscussionEndpoint(id: number, name: string, isGroup: boolean, membersCount?: number, groupId?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
public getDiscussionEndpoint(id: number, name: string, isGroup: boolean, membersCount?: number, groupId?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public getDiscussionEndpoint(id: number, name: string, isGroup: boolean, membersCount?: number, groupId?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public getDiscussionEndpoint(id: number, name: string, isGroup: boolean, membersCount?: number, groupId?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling getDiscussionEndpoint.');
}
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling getDiscussionEndpoint.');
}
if (isGroup === null || isGroup === undefined) {
throw new Error('Required parameter isGroup was null or undefined when calling getDiscussionEndpoint.');
}
let localVarQueryParameters = new OpenApiHttpParams(this.encoder);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
'id',
<any>id,
QueryParamStyle.Form,
true,
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
'name',
<any>name,
QueryParamStyle.Form,
true,
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
'isGroup',
<any>isGroup,
QueryParamStyle.Form,
true,
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
'membersCount',
<any>membersCount,
QueryParamStyle.Form,
true,
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
'groupId',
<any>groupId,
QueryParamStyle.Form,
true,
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/discussions`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters.toHttpParams(),
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint get /API/discussions/{discussionId}/members
* @param discussionId
* @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.
* @param options additional options
*/
public getDiscussionMembersEndpoint(discussionId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<string>>;
public getDiscussionMembersEndpoint(discussionId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<string>>>;
public getDiscussionMembersEndpoint(discussionId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<string>>>;
public getDiscussionMembersEndpoint(discussionId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (discussionId === null || discussionId === undefined) {
throw new Error('Required parameter discussionId was null or undefined when calling getDiscussionMembersEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/discussions/${this.configuration.encodeParam({name: "discussionId", value: discussionId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/members`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<string>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint get /API/discussions/{discussionId}/members/roles
* @param discussionId
* @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.
* @param options additional options
*/
public getDiscussionMembersWithRolesEndpoint(discussionId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<KnotsEndpointsDiscussionMemberWithRoleDto>>;
public getDiscussionMembersWithRolesEndpoint(discussionId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<KnotsEndpointsDiscussionMemberWithRoleDto>>>;
public getDiscussionMembersWithRolesEndpoint(discussionId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<KnotsEndpointsDiscussionMemberWithRoleDto>>>;
public getDiscussionMembersWithRolesEndpoint(discussionId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (discussionId === null || discussionId === undefined) {
throw new Error('Required parameter discussionId was null or undefined when calling getDiscussionMembersWithRolesEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/discussions/${this.configuration.encodeParam({name: "discussionId", value: discussionId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/members/roles`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<KnotsEndpointsDiscussionMemberWithRoleDto>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint get /API/discussions/{discussionId}/messages
* @param discussionId
* @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.
* @param options additional options
*/
public getMessageEndpoint(discussionId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<KnotsDTOMessageGetMessageDetailsDto>>;
public getMessageEndpoint(discussionId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<KnotsDTOMessageGetMessageDetailsDto>>>;
public getMessageEndpoint(discussionId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<KnotsDTOMessageGetMessageDetailsDto>>>;
public getMessageEndpoint(discussionId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (discussionId === null || discussionId === undefined) {
throw new Error('Required parameter discussionId was null or undefined when calling getMessageEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/discussions/${this.configuration.encodeParam({name: "discussionId", value: discussionId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/messages`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<KnotsDTOMessageGetMessageDetailsDto>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint get /API/discussions/my
* @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.
* @param options additional options
*/
public getMyDiscussionEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<object>>;
public getMyDiscussionEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<object>>>;
public getMyDiscussionEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<object>>>;
public getMyDiscussionEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/discussions/my`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<object>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
}
+560
View File
@@ -0,0 +1,560 @@
/**
* Knots
*
*
*
* 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, HttpContext
} from '@angular/common/http';
import { Observable } from 'rxjs';
import { OpenApiHttpParams, QueryParamStyle } from '../query.params';
// @ts-ignore
import { FastEndpointsErrorResponse } from '../model/fast-endpoints-error-response';
// @ts-ignore
import { KnotsDTOGroupCreateGroupDto } from '../model/knots-dto-group-create-group-dto';
// @ts-ignore
import { KnotsDTOGroupDeleteGroupDto } from '../model/knots-dto-group-delete-group-dto';
// @ts-ignore
import { KnotsDTOGroupUpdateGroupMembersAmountDto } from '../model/knots-dto-group-update-group-members-amount-dto';
// @ts-ignore
import { KnotsDTOGroupUpdateGroupNameDto } from '../model/knots-dto-group-update-group-name-dto';
// @ts-ignore
import { KnotsDTOGroupUpdateGroupProfilePictureDto } from '../model/knots-dto-group-update-group-profile-picture-dto';
// @ts-ignore
import { KnotsEndpointsRoleAssignRoleRequest } from '../model/knots-endpoints-role-assign-role-request';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root'
})
export class GroupsService extends BaseService {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
/**
* @endpoint post /API/groups/{groupId}/members/{userId}/role
* @param groupId
* @param userId
* @param knotsEndpointsRoleAssignRoleRequest
* @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.
* @param options additional options
*/
public assignRoleEndpoint(groupId: string, userId: string, knotsEndpointsRoleAssignRoleRequest: KnotsEndpointsRoleAssignRoleRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
public assignRoleEndpoint(groupId: string, userId: string, knotsEndpointsRoleAssignRoleRequest: KnotsEndpointsRoleAssignRoleRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public assignRoleEndpoint(groupId: string, userId: string, knotsEndpointsRoleAssignRoleRequest: KnotsEndpointsRoleAssignRoleRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public assignRoleEndpoint(groupId: string, userId: string, knotsEndpointsRoleAssignRoleRequest: KnotsEndpointsRoleAssignRoleRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (groupId === null || groupId === undefined) {
throw new Error('Required parameter groupId was null or undefined when calling assignRoleEndpoint.');
}
if (userId === null || userId === undefined) {
throw new Error('Required parameter userId was null or undefined when calling assignRoleEndpoint.');
}
if (knotsEndpointsRoleAssignRoleRequest === null || knotsEndpointsRoleAssignRoleRequest === undefined) {
throw new Error('Required parameter knotsEndpointsRoleAssignRoleRequest was null or undefined when calling assignRoleEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/groups/${this.configuration.encodeParam({name: "groupId", value: groupId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/members/${this.configuration.encodeParam({name: "userId", value: userId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/role`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsEndpointsRoleAssignRoleRequest,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint post /API/groups
* @param knotsDTOGroupCreateGroupDto
* @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.
* @param options additional options
*/
public createGroupEndpoint(knotsDTOGroupCreateGroupDto: KnotsDTOGroupCreateGroupDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any>;
public createGroupEndpoint(knotsDTOGroupCreateGroupDto: KnotsDTOGroupCreateGroupDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public createGroupEndpoint(knotsDTOGroupCreateGroupDto: KnotsDTOGroupCreateGroupDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public createGroupEndpoint(knotsDTOGroupCreateGroupDto: KnotsDTOGroupCreateGroupDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (knotsDTOGroupCreateGroupDto === null || knotsDTOGroupCreateGroupDto === undefined) {
throw new Error('Required parameter knotsDTOGroupCreateGroupDto was null or undefined when calling createGroupEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/problem+json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/groups`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsDTOGroupCreateGroupDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint delete /API/groups
* @param knotsDTOGroupDeleteGroupDto
* @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.
* @param options additional options
*/
public deleteGroupEndpoint(knotsDTOGroupDeleteGroupDto: KnotsDTOGroupDeleteGroupDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any>;
public deleteGroupEndpoint(knotsDTOGroupDeleteGroupDto: KnotsDTOGroupDeleteGroupDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public deleteGroupEndpoint(knotsDTOGroupDeleteGroupDto: KnotsDTOGroupDeleteGroupDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public deleteGroupEndpoint(knotsDTOGroupDeleteGroupDto: KnotsDTOGroupDeleteGroupDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (knotsDTOGroupDeleteGroupDto === null || knotsDTOGroupDeleteGroupDto === undefined) {
throw new Error('Required parameter knotsDTOGroupDeleteGroupDto was null or undefined when calling deleteGroupEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/problem+json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/groups`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsDTOGroupDeleteGroupDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint get /API/groups
* @param id
* @param nombreMembres
* @param nom
* @param profilePicture
* @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.
* @param options additional options
*/
public getGroupEndpoint(id: number, nombreMembres: number, nom?: string, profilePicture?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
public getGroupEndpoint(id: number, nombreMembres: number, nom?: string, profilePicture?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public getGroupEndpoint(id: number, nombreMembres: number, nom?: string, profilePicture?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public getGroupEndpoint(id: number, nombreMembres: number, nom?: string, profilePicture?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling getGroupEndpoint.');
}
if (nombreMembres === null || nombreMembres === undefined) {
throw new Error('Required parameter nombreMembres was null or undefined when calling getGroupEndpoint.');
}
let localVarQueryParameters = new OpenApiHttpParams(this.encoder);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
'id',
<any>id,
QueryParamStyle.Form,
true,
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
'nom',
<any>nom,
QueryParamStyle.Form,
true,
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
'nombreMembres',
<any>nombreMembres,
QueryParamStyle.Form,
true,
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
'profilePicture',
<any>profilePicture,
QueryParamStyle.Form,
true,
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/groups`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters.toHttpParams(),
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint patch /API/groups/{id}/membersAmount
* @param id
* @param knotsDTOGroupUpdateGroupMembersAmountDto
* @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.
* @param options additional options
*/
public patchGroupMembersAmountEndpoint(id: number, knotsDTOGroupUpdateGroupMembersAmountDto: KnotsDTOGroupUpdateGroupMembersAmountDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any>;
public patchGroupMembersAmountEndpoint(id: number, knotsDTOGroupUpdateGroupMembersAmountDto: KnotsDTOGroupUpdateGroupMembersAmountDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public patchGroupMembersAmountEndpoint(id: number, knotsDTOGroupUpdateGroupMembersAmountDto: KnotsDTOGroupUpdateGroupMembersAmountDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public patchGroupMembersAmountEndpoint(id: number, knotsDTOGroupUpdateGroupMembersAmountDto: KnotsDTOGroupUpdateGroupMembersAmountDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling patchGroupMembersAmountEndpoint.');
}
if (knotsDTOGroupUpdateGroupMembersAmountDto === null || knotsDTOGroupUpdateGroupMembersAmountDto === undefined) {
throw new Error('Required parameter knotsDTOGroupUpdateGroupMembersAmountDto was null or undefined when calling patchGroupMembersAmountEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/problem+json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/groups/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/membersAmount`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsDTOGroupUpdateGroupMembersAmountDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint patch /API/groups/{id}/name
* @param id
* @param knotsDTOGroupUpdateGroupNameDto
* @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.
* @param options additional options
*/
public patchGroupNameEndpoint(id: number, knotsDTOGroupUpdateGroupNameDto: KnotsDTOGroupUpdateGroupNameDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any>;
public patchGroupNameEndpoint(id: number, knotsDTOGroupUpdateGroupNameDto: KnotsDTOGroupUpdateGroupNameDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public patchGroupNameEndpoint(id: number, knotsDTOGroupUpdateGroupNameDto: KnotsDTOGroupUpdateGroupNameDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public patchGroupNameEndpoint(id: number, knotsDTOGroupUpdateGroupNameDto: KnotsDTOGroupUpdateGroupNameDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling patchGroupNameEndpoint.');
}
if (knotsDTOGroupUpdateGroupNameDto === null || knotsDTOGroupUpdateGroupNameDto === undefined) {
throw new Error('Required parameter knotsDTOGroupUpdateGroupNameDto was null or undefined when calling patchGroupNameEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/problem+json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/groups/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/name`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsDTOGroupUpdateGroupNameDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint patch /API/groups/{id}/profilePicture
* @param id
* @param knotsDTOGroupUpdateGroupProfilePictureDto
* @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.
* @param options additional options
*/
public patchGroupProfilePictureEndpoint(id: number, knotsDTOGroupUpdateGroupProfilePictureDto: KnotsDTOGroupUpdateGroupProfilePictureDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
public patchGroupProfilePictureEndpoint(id: number, knotsDTOGroupUpdateGroupProfilePictureDto: KnotsDTOGroupUpdateGroupProfilePictureDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public patchGroupProfilePictureEndpoint(id: number, knotsDTOGroupUpdateGroupProfilePictureDto: KnotsDTOGroupUpdateGroupProfilePictureDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public patchGroupProfilePictureEndpoint(id: number, knotsDTOGroupUpdateGroupProfilePictureDto: KnotsDTOGroupUpdateGroupProfilePictureDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling patchGroupProfilePictureEndpoint.');
}
if (knotsDTOGroupUpdateGroupProfilePictureDto === null || knotsDTOGroupUpdateGroupProfilePictureDto === undefined) {
throw new Error('Required parameter knotsDTOGroupUpdateGroupProfilePictureDto was null or undefined when calling patchGroupProfilePictureEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/groups/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/profilePicture`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsDTOGroupUpdateGroupProfilePictureDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
}
+252
View File
@@ -0,0 +1,252 @@
/**
* Knots
*
*
*
* 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, HttpContext
} from '@angular/common/http';
import { Observable } from 'rxjs';
import { OpenApiHttpParams, QueryParamStyle } from '../query.params';
// @ts-ignore
import { FastEndpointsErrorResponse } from '../model/fast-endpoints-error-response';
// @ts-ignore
import { KnotsDTOKeyCreateKeyDto } from '../model/knots-dto-key-create-key-dto';
// @ts-ignore
import { KnotsDTOKeyDeleteKeyDto } from '../model/knots-dto-key-delete-key-dto';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root'
})
export class KeysService extends BaseService {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
/**
* @endpoint post /API/keys
* @param knotsDTOKeyCreateKeyDto
* @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.
* @param options additional options
*/
public createKeyEndpoint(knotsDTOKeyCreateKeyDto: KnotsDTOKeyCreateKeyDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any>;
public createKeyEndpoint(knotsDTOKeyCreateKeyDto: KnotsDTOKeyCreateKeyDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public createKeyEndpoint(knotsDTOKeyCreateKeyDto: KnotsDTOKeyCreateKeyDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public createKeyEndpoint(knotsDTOKeyCreateKeyDto: KnotsDTOKeyCreateKeyDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (knotsDTOKeyCreateKeyDto === null || knotsDTOKeyCreateKeyDto === undefined) {
throw new Error('Required parameter knotsDTOKeyCreateKeyDto was null or undefined when calling createKeyEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/problem+json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/keys`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsDTOKeyCreateKeyDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint delete /API/keys
* @param knotsDTOKeyDeleteKeyDto
* @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.
* @param options additional options
*/
public deleteKeyEndpoint(knotsDTOKeyDeleteKeyDto: KnotsDTOKeyDeleteKeyDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any>;
public deleteKeyEndpoint(knotsDTOKeyDeleteKeyDto: KnotsDTOKeyDeleteKeyDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public deleteKeyEndpoint(knotsDTOKeyDeleteKeyDto: KnotsDTOKeyDeleteKeyDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public deleteKeyEndpoint(knotsDTOKeyDeleteKeyDto: KnotsDTOKeyDeleteKeyDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (knotsDTOKeyDeleteKeyDto === null || knotsDTOKeyDeleteKeyDto === undefined) {
throw new Error('Required parameter knotsDTOKeyDeleteKeyDto was null or undefined when calling deleteKeyEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/problem+json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/keys`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsDTOKeyDeleteKeyDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint get /API/keys/{@Id}
* @param id
* @param id2
* @param enKey
* @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.
* @param options additional options
*/
public getKeyEndpoint(id: string, id2: number, enKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
public getKeyEndpoint(id: string, id2: number, enKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public getKeyEndpoint(id: string, id2: number, enKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public getKeyEndpoint(id: string, id2: number, enKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling getKeyEndpoint.');
}
if (id2 === null || id2 === undefined) {
throw new Error('Required parameter id2 was null or undefined when calling getKeyEndpoint.');
}
let localVarQueryParameters = new OpenApiHttpParams(this.encoder);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
'id',
<any>id2,
QueryParamStyle.Form,
true,
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
'enKey',
<any>enKey,
QueryParamStyle.Form,
true,
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/keys/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters.toHttpParams(),
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
}
@@ -0,0 +1,171 @@
/**
* Knots
*
*
*
* 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, HttpContext
} from '@angular/common/http';
import { Observable } from 'rxjs';
import { OpenApiHttpParams, QueryParamStyle } from '../query.params';
// @ts-ignore
import { FastEndpointsErrorResponse } from '../model/fast-endpoints-error-response';
// @ts-ignore
import { KnotsDTOMessageCreateMessageDto } from '../model/knots-dto-message-create-message-dto';
// @ts-ignore
import { KnotsDTOMessageDeleteMessageDto } from '../model/knots-dto-message-delete-message-dto';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root'
})
export class MessagesService extends BaseService {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
/**
* @endpoint post /API/messages
* @param knotsDTOMessageCreateMessageDto
* @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.
* @param options additional options
*/
public createMessageEndpoint(knotsDTOMessageCreateMessageDto: KnotsDTOMessageCreateMessageDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any>;
public createMessageEndpoint(knotsDTOMessageCreateMessageDto: KnotsDTOMessageCreateMessageDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public createMessageEndpoint(knotsDTOMessageCreateMessageDto: KnotsDTOMessageCreateMessageDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public createMessageEndpoint(knotsDTOMessageCreateMessageDto: KnotsDTOMessageCreateMessageDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (knotsDTOMessageCreateMessageDto === null || knotsDTOMessageCreateMessageDto === undefined) {
throw new Error('Required parameter knotsDTOMessageCreateMessageDto was null or undefined when calling createMessageEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/problem+json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/messages`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsDTOMessageCreateMessageDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint delete /API/messages
* @param knotsDTOMessageDeleteMessageDto
* @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.
* @param options additional options
*/
public deleteMessageEndpoint(knotsDTOMessageDeleteMessageDto: KnotsDTOMessageDeleteMessageDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
public deleteMessageEndpoint(knotsDTOMessageDeleteMessageDto: KnotsDTOMessageDeleteMessageDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public deleteMessageEndpoint(knotsDTOMessageDeleteMessageDto: KnotsDTOMessageDeleteMessageDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public deleteMessageEndpoint(knotsDTOMessageDeleteMessageDto: KnotsDTOMessageDeleteMessageDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (knotsDTOMessageDeleteMessageDto === null || knotsDTOMessageDeleteMessageDto === undefined) {
throw new Error('Required parameter knotsDTOMessageDeleteMessageDto was null or undefined when calling deleteMessageEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/messages`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsDTOMessageDeleteMessageDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
}
+232
View File
@@ -0,0 +1,232 @@
/**
* Knots
*
*
*
* 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, HttpContext
} from '@angular/common/http';
import { Observable } from 'rxjs';
import { OpenApiHttpParams, QueryParamStyle } from '../query.params';
// @ts-ignore
import { FastEndpointsErrorResponse } from '../model/fast-endpoints-error-response';
// @ts-ignore
import { KnotsDTORoleDeleteRoleDto } from '../model/knots-dto-role-delete-role-dto';
// @ts-ignore
import { KnotsEndpointsRoleCreateRoleRequest } from '../model/knots-endpoints-role-create-role-request';
// @ts-ignore
import { KnotsEndpointsRoleRoleDto } from '../model/knots-endpoints-role-role-dto';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root'
})
export class RolesService extends BaseService {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
/**
* @endpoint post /API/roles
* @param knotsEndpointsRoleCreateRoleRequest
* @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.
* @param options additional options
*/
public createRoleEndpoint(knotsEndpointsRoleCreateRoleRequest: KnotsEndpointsRoleCreateRoleRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<KnotsEndpointsRoleRoleDto>;
public createRoleEndpoint(knotsEndpointsRoleCreateRoleRequest: KnotsEndpointsRoleCreateRoleRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<KnotsEndpointsRoleRoleDto>>;
public createRoleEndpoint(knotsEndpointsRoleCreateRoleRequest: KnotsEndpointsRoleCreateRoleRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<KnotsEndpointsRoleRoleDto>>;
public createRoleEndpoint(knotsEndpointsRoleCreateRoleRequest: KnotsEndpointsRoleCreateRoleRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (knotsEndpointsRoleCreateRoleRequest === null || knotsEndpointsRoleCreateRoleRequest === undefined) {
throw new Error('Required parameter knotsEndpointsRoleCreateRoleRequest was null or undefined when calling createRoleEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/roles`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<KnotsEndpointsRoleRoleDto>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsEndpointsRoleCreateRoleRequest,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint delete /API/roles
* @param knotsDTORoleDeleteRoleDto
* @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.
* @param options additional options
*/
public deleteRoleEndpoint(knotsDTORoleDeleteRoleDto: KnotsDTORoleDeleteRoleDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any>;
public deleteRoleEndpoint(knotsDTORoleDeleteRoleDto: KnotsDTORoleDeleteRoleDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public deleteRoleEndpoint(knotsDTORoleDeleteRoleDto: KnotsDTORoleDeleteRoleDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public deleteRoleEndpoint(knotsDTORoleDeleteRoleDto: KnotsDTORoleDeleteRoleDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (knotsDTORoleDeleteRoleDto === null || knotsDTORoleDeleteRoleDto === undefined) {
throw new Error('Required parameter knotsDTORoleDeleteRoleDto was null or undefined when calling deleteRoleEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/problem+json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/roles`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsDTORoleDeleteRoleDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint get /API/roles/{libelle}
* @param libelle
* @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.
* @param options additional options
*/
public getRoleEndpoint(libelle: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any>;
public getRoleEndpoint(libelle: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public getRoleEndpoint(libelle: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public getRoleEndpoint(libelle: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (libelle === null || libelle === undefined) {
throw new Error('Required parameter libelle was null or undefined when calling getRoleEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/problem+json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/roles/${this.configuration.encodeParam({name: "libelle", value: libelle, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
}
+761
View File
@@ -0,0 +1,761 @@
/**
* Knots
*
*
*
* 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, HttpContext
} from '@angular/common/http';
import { Observable } from 'rxjs';
import { OpenApiHttpParams, QueryParamStyle } from '../query.params';
// @ts-ignore
import { FastEndpointsErrorResponse } from '../model/fast-endpoints-error-response';
// @ts-ignore
import { KnotsDTOUserCreateUserDto } from '../model/knots-dto-user-create-user-dto';
// @ts-ignore
import { KnotsDTOUserDeleteUserDto } from '../model/knots-dto-user-delete-user-dto';
// @ts-ignore
import { KnotsDTOUserGetUserDto } from '../model/knots-dto-user-get-user-dto';
// @ts-ignore
import { KnotsDTOUserLoginResponseDto } from '../model/knots-dto-user-login-response-dto';
// @ts-ignore
import { KnotsDTOUserLoginUserDto } from '../model/knots-dto-user-login-user-dto';
// @ts-ignore
import { KnotsDTOUserUpdateUserContactDto } from '../model/knots-dto-user-update-user-contact-dto';
// @ts-ignore
import { KnotsDTOUserUpdateUserDescriptionDto } from '../model/knots-dto-user-update-user-description-dto';
// @ts-ignore
import { KnotsDTOUserUpdateUserPasswordDto } from '../model/knots-dto-user-update-user-password-dto';
// @ts-ignore
import { KnotsDTOUserUpdateUserProfilePictureDto } from '../model/knots-dto-user-update-user-profile-picture-dto';
// @ts-ignore
import { KnotsDTOUserUpdateUsernameDto } from '../model/knots-dto-user-update-username-dto';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root'
})
export class UsersService extends BaseService {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
/**
* @endpoint post /API/users
* @param knotsDTOUserCreateUserDto
* @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.
* @param options additional options
*/
public createUserEndpoint(knotsDTOUserCreateUserDto: KnotsDTOUserCreateUserDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<KnotsDTOUserGetUserDto>;
public createUserEndpoint(knotsDTOUserCreateUserDto: KnotsDTOUserCreateUserDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<KnotsDTOUserGetUserDto>>;
public createUserEndpoint(knotsDTOUserCreateUserDto: KnotsDTOUserCreateUserDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<KnotsDTOUserGetUserDto>>;
public createUserEndpoint(knotsDTOUserCreateUserDto: KnotsDTOUserCreateUserDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (knotsDTOUserCreateUserDto === null || knotsDTOUserCreateUserDto === undefined) {
throw new Error('Required parameter knotsDTOUserCreateUserDto was null or undefined when calling createUserEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/users`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<KnotsDTOUserGetUserDto>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsDTOUserCreateUserDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint delete /API/users/{@Id}
* @param id
* @param knotsDTOUserDeleteUserDto
* @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.
* @param options additional options
*/
public deleteUserEndpoint(id: string, knotsDTOUserDeleteUserDto: KnotsDTOUserDeleteUserDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
public deleteUserEndpoint(id: string, knotsDTOUserDeleteUserDto: KnotsDTOUserDeleteUserDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public deleteUserEndpoint(id: string, knotsDTOUserDeleteUserDto: KnotsDTOUserDeleteUserDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public deleteUserEndpoint(id: string, knotsDTOUserDeleteUserDto: KnotsDTOUserDeleteUserDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling deleteUserEndpoint.');
}
if (knotsDTOUserDeleteUserDto === null || knotsDTOUserDeleteUserDto === undefined) {
throw new Error('Required parameter knotsDTOUserDeleteUserDto was null or undefined when calling deleteUserEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/users/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsDTOUserDeleteUserDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint get /API/users
* @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.
* @param options additional options
*/
public getAllUsersEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<object>>;
public getAllUsersEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<object>>>;
public getAllUsersEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<object>>>;
public getAllUsersEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/users`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<object>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint get /API/users/{username}
* @param username
* @param description
* @param password
* @param email
* @param tel
* @param profilePicture
* @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.
* @param options additional options
*/
public getUserEndpoint(username: string, description?: string, password?: string, email?: string, tel?: string, profilePicture?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
public getUserEndpoint(username: string, description?: string, password?: string, email?: string, tel?: string, profilePicture?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public getUserEndpoint(username: string, description?: string, password?: string, email?: string, tel?: string, profilePicture?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public getUserEndpoint(username: string, description?: string, password?: string, email?: string, tel?: string, profilePicture?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (username === null || username === undefined) {
throw new Error('Required parameter username was null or undefined when calling getUserEndpoint.');
}
let localVarQueryParameters = new OpenApiHttpParams(this.encoder);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
'description',
<any>description,
QueryParamStyle.Form,
true,
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
'password',
<any>password,
QueryParamStyle.Form,
true,
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
'email',
<any>email,
QueryParamStyle.Form,
true,
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
'tel',
<any>tel,
QueryParamStyle.Form,
true,
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
'profilePicture',
<any>profilePicture,
QueryParamStyle.Form,
true,
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/users/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters.toHttpParams(),
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint post /API/users/login
* @param knotsDTOUserLoginUserDto
* @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.
* @param options additional options
*/
public loginEndpoint(knotsDTOUserLoginUserDto: KnotsDTOUserLoginUserDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<KnotsDTOUserLoginResponseDto>;
public loginEndpoint(knotsDTOUserLoginUserDto: KnotsDTOUserLoginUserDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<KnotsDTOUserLoginResponseDto>>;
public loginEndpoint(knotsDTOUserLoginUserDto: KnotsDTOUserLoginUserDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<KnotsDTOUserLoginResponseDto>>;
public loginEndpoint(knotsDTOUserLoginUserDto: KnotsDTOUserLoginUserDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (knotsDTOUserLoginUserDto === null || knotsDTOUserLoginUserDto === undefined) {
throw new Error('Required parameter knotsDTOUserLoginUserDto was null or undefined when calling loginEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/users/login`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<KnotsDTOUserLoginResponseDto>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsDTOUserLoginUserDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint patch /API/users/{id}/contact
* @param id
* @param knotsDTOUserUpdateUserContactDto
* @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.
* @param options additional options
*/
public patchUserContactEndpoint(id: number, knotsDTOUserUpdateUserContactDto: KnotsDTOUserUpdateUserContactDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any>;
public patchUserContactEndpoint(id: number, knotsDTOUserUpdateUserContactDto: KnotsDTOUserUpdateUserContactDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public patchUserContactEndpoint(id: number, knotsDTOUserUpdateUserContactDto: KnotsDTOUserUpdateUserContactDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public patchUserContactEndpoint(id: number, knotsDTOUserUpdateUserContactDto: KnotsDTOUserUpdateUserContactDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling patchUserContactEndpoint.');
}
if (knotsDTOUserUpdateUserContactDto === null || knotsDTOUserUpdateUserContactDto === undefined) {
throw new Error('Required parameter knotsDTOUserUpdateUserContactDto was null or undefined when calling patchUserContactEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/problem+json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/users/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/contact`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsDTOUserUpdateUserContactDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint patch /API/users/{@Id}/description
* @param id
* @param knotsDTOUserUpdateUserDescriptionDto
* @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.
* @param options additional options
*/
public patchUserDescriptionEndpoint(id: string, knotsDTOUserUpdateUserDescriptionDto: KnotsDTOUserUpdateUserDescriptionDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any>;
public patchUserDescriptionEndpoint(id: string, knotsDTOUserUpdateUserDescriptionDto: KnotsDTOUserUpdateUserDescriptionDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public patchUserDescriptionEndpoint(id: string, knotsDTOUserUpdateUserDescriptionDto: KnotsDTOUserUpdateUserDescriptionDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public patchUserDescriptionEndpoint(id: string, knotsDTOUserUpdateUserDescriptionDto: KnotsDTOUserUpdateUserDescriptionDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling patchUserDescriptionEndpoint.');
}
if (knotsDTOUserUpdateUserDescriptionDto === null || knotsDTOUserUpdateUserDescriptionDto === undefined) {
throw new Error('Required parameter knotsDTOUserUpdateUserDescriptionDto was null or undefined when calling patchUserDescriptionEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/problem+json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/users/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/description`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsDTOUserUpdateUserDescriptionDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint patch /API/users/{id}/password
* @param id
* @param knotsDTOUserUpdateUserPasswordDto
* @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.
* @param options additional options
*/
public patchUserPasswordEndpoint(id: number, knotsDTOUserUpdateUserPasswordDto: KnotsDTOUserUpdateUserPasswordDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
public patchUserPasswordEndpoint(id: number, knotsDTOUserUpdateUserPasswordDto: KnotsDTOUserUpdateUserPasswordDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public patchUserPasswordEndpoint(id: number, knotsDTOUserUpdateUserPasswordDto: KnotsDTOUserUpdateUserPasswordDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public patchUserPasswordEndpoint(id: number, knotsDTOUserUpdateUserPasswordDto: KnotsDTOUserUpdateUserPasswordDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling patchUserPasswordEndpoint.');
}
if (knotsDTOUserUpdateUserPasswordDto === null || knotsDTOUserUpdateUserPasswordDto === undefined) {
throw new Error('Required parameter knotsDTOUserUpdateUserPasswordDto was null or undefined when calling patchUserPasswordEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/users/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/password`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsDTOUserUpdateUserPasswordDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint patch /API/users/{@Id}/profilepicture
* @param id
* @param knotsDTOUserUpdateUserProfilePictureDto
* @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.
* @param options additional options
*/
public patchUserProfilePictureEndpoint(id: string, knotsDTOUserUpdateUserProfilePictureDto: KnotsDTOUserUpdateUserProfilePictureDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any>;
public patchUserProfilePictureEndpoint(id: string, knotsDTOUserUpdateUserProfilePictureDto: KnotsDTOUserUpdateUserProfilePictureDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public patchUserProfilePictureEndpoint(id: string, knotsDTOUserUpdateUserProfilePictureDto: KnotsDTOUserUpdateUserProfilePictureDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public patchUserProfilePictureEndpoint(id: string, knotsDTOUserUpdateUserProfilePictureDto: KnotsDTOUserUpdateUserProfilePictureDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling patchUserProfilePictureEndpoint.');
}
if (knotsDTOUserUpdateUserProfilePictureDto === null || knotsDTOUserUpdateUserProfilePictureDto === undefined) {
throw new Error('Required parameter knotsDTOUserUpdateUserProfilePictureDto was null or undefined when calling patchUserProfilePictureEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/problem+json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/users/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/profilepicture`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsDTOUserUpdateUserProfilePictureDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint patch /API/users/{@Id}/username
* @param id
* @param knotsDTOUserUpdateUsernameDto
* @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.
* @param options additional options
*/
public patchUsernameEndpoint(id: string, knotsDTOUserUpdateUsernameDto: KnotsDTOUserUpdateUsernameDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any>;
public patchUsernameEndpoint(id: string, knotsDTOUserUpdateUsernameDto: KnotsDTOUserUpdateUsernameDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public patchUsernameEndpoint(id: string, knotsDTOUserUpdateUsernameDto: KnotsDTOUserUpdateUsernameDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public patchUsernameEndpoint(id: string, knotsDTOUserUpdateUsernameDto: KnotsDTOUserUpdateUsernameDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/problem+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling patchUsernameEndpoint.');
}
if (knotsDTOUserUpdateUsernameDto === null || knotsDTOUserUpdateUsernameDto === undefined) {
throw new Error('Required parameter knotsDTOUserUpdateUsernameDto was null or undefined when calling patchUsernameEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/problem+json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/users/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/username`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: knotsDTOUserUpdateUsernameDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
}
+194
View File
@@ -0,0 +1,194 @@
import { HttpHeaders, HttpParameterCodec } from '@angular/common/http';
import { Param } from './param';
import { OpenApiHttpParams } from './query.params';
export interface ConfigurationParameters {
/**
* @deprecated Since 5.0. Use credentials instead
*/
apiKeys?: {[ key: string ]: string};
username?: string;
password?: string;
/**
* @deprecated Since 5.0. Use credentials instead
*/
accessToken?: string | (() => string);
basePath?: string;
withCredentials?: boolean;
/**
* Takes care of encoding query- and form-parameters.
*/
encoder?: HttpParameterCodec;
/**
* Override the default method for encoding path parameters in various
* <a href="https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values">styles</a>.
* <p>
* See {@link README.md} for more details
* </p>
*/
encodeParam?: (param: Param) => string;
/**
* The keys are the names in the securitySchemes section of the OpenAPI
* document. They should map to the value used for authentication
* minus any standard prefixes such as 'Basic' or 'Bearer'.
*/
credentials?: {[ key: string ]: string | (() => string | undefined)};
}
export class Configuration {
/**
* @deprecated Since 5.0. Use credentials instead
*/
apiKeys?: {[ key: string ]: string};
username?: string;
password?: string;
/**
* @deprecated Since 5.0. Use credentials instead
*/
accessToken?: string | (() => string);
basePath?: string;
withCredentials?: boolean;
/**
* Takes care of encoding query- and form-parameters.
*/
encoder?: HttpParameterCodec;
/**
* Encoding of various path parameter
* <a href="https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values">styles</a>.
* <p>
* See {@link README.md} for more details
* </p>
*/
encodeParam: (param: Param) => string;
/**
* The keys are the names in the securitySchemes section of the OpenAPI
* document. They should map to the value used for authentication
* minus any standard prefixes such as 'Basic' or 'Bearer'.
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
if (username !== undefined) {
this.username = username;
}
if (password !== undefined) {
this.password = password;
}
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
// init default JWTBearerAuth credential
if (!this.credentials['JWTBearerAuth']) {
this.credentials['JWTBearerAuth'] = () => {
return typeof this.accessToken === 'function'
? this.accessToken()
: this.accessToken;
};
}
}
/**
* Select the correct content-type to use for a request.
* Uses {@link Configuration#isJsonMime} to determine the correct content-type.
* If no content type is found return the first found type if the contentTypes is not empty
* @param contentTypes - the array of content types that are available for selection
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
*/
public selectHeaderContentType (contentTypes: string[]): string | undefined {
if (contentTypes.length === 0) {
return undefined;
}
const type = contentTypes.find((x: string) => this.isJsonMime(x));
if (type === undefined) {
return contentTypes[0];
}
return type;
}
/**
* Select the correct accept content-type to use for a request.
* Uses {@link Configuration#isJsonMime} to determine the correct accept content-type.
* If no content type is found return the first found type if the contentTypes is not empty
* @param accepts - the array of content types that are available for selection.
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
*/
public selectHeaderAccept(accepts: string[]): string | undefined {
if (accepts.length === 0) {
return undefined;
}
const type = accepts.find((x: string) => this.isJsonMime(x));
if (type === undefined) {
return accepts[0];
}
return type;
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
public isJsonMime(mime: string): boolean {
const jsonMime: RegExp = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
return mime !== null && jsonMime.test(mime);
}
public lookupCredential(key: string): string | undefined {
const value = this.credentials[key];
return typeof value === 'function'
? value()
: value;
}
public addCredentialToHeaders(credentialKey: string, headerName: string, headers: HttpHeaders, prefix?: string): HttpHeaders {
const value = this.lookupCredential(credentialKey);
return value
? headers.set(headerName, (prefix ?? '') + value)
: headers;
}
public addCredentialToQuery(credentialKey: string, paramName: string, query: OpenApiHttpParams): OpenApiHttpParams {
const value = this.lookupCredential(credentialKey);
return value
? query.set(paramName, value)
: query;
}
private defaultEncodeParam(param: Param): string {
// This implementation exists as fallback for missing configuration
// and for backwards compatibility to older typescript-angular generator versions.
// It only works for the 'simple' parameter style.
// Date-handling only works for the 'date-time' format.
// All other styles and Date-formats are probably handled incorrectly.
//
// But: if that's all you need (i.e.: the most common use-case): no need for customization!
const value = param.dataFormat === 'date-time' && param.value instanceof Date
? (param.value as Date).toISOString()
: param.value;
return encodeURIComponent(String(value));
}
}
+35
View File
@@ -0,0 +1,35 @@
import { HttpParameterCodec } from '@angular/common/http';
/**
* Custom HttpParameterCodec
* Workaround for https://github.com/angular/angular/issues/18261
*/
export class CustomHttpParameterCodec implements HttpParameterCodec {
encodeKey(k: string): string {
return encodeURIComponent(k);
}
encodeValue(v: string): string {
return encodeURIComponent(v);
}
decodeKey(k: string): string {
return decodeURIComponent(k);
}
decodeValue(v: string): string {
return decodeURIComponent(v);
}
}
export class IdentityHttpParameterCodec implements HttpParameterCodec {
encodeKey(k: string): string {
return k;
}
encodeValue(v: string): string {
return v;
}
decodeKey(k: string): string {
return k;
}
decodeValue(v: string): string {
return v;
}
}
+57
View File
@@ -0,0 +1,57 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
git_user_id=$1
git_repo_id=$2
release_note=$3
git_host=$4
if [ "$git_host" = "" ]; then
git_host="github.com"
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
fi
if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=$(git remote)
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'
+7
View File
@@ -0,0 +1,7 @@
export * from './api/api';
export * from './model/models';
export * from './variables';
export * from './configuration';
export * from './api.module';
export * from './provide-api';
export * from './param';
@@ -0,0 +1,29 @@
/**
* Knots
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* the dto used to send an error response to the client
*/
export interface FastEndpointsErrorResponse {
/**
* the http status code sent to the client. default is 400.
*/
statusCode?: number;
/**
* the message for the error response
*/
message?: string;
/**
* the collection of errors for the current context
*/
errors?: { [key: string]: Array<string>; };
}
@@ -0,0 +1,15 @@
/**
* Knots
*
*
*
* 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 KnotsDTODiscussionCreateDiscussionDto {
id: number;
}
@@ -0,0 +1,15 @@
/**
* Knots
*
*
*
* 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 KnotsDTODiscussionDeleteDiscussionDto {
id: number;
}
@@ -0,0 +1,17 @@
/**
* Knots
*
*
*
* 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 KnotsDTOGroupCreateGroupDto {
nom: string;
nombreMembres: number;
profilePicture?: string | null;
}
@@ -0,0 +1,15 @@
/**
* Knots
*
*
*
* 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 KnotsDTOGroupDeleteGroupDto {
id: number;
}
@@ -0,0 +1,15 @@
/**
* Knots
*
*
*
* 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 KnotsDTOGroupUpdateGroupMembersAmountDto {
membersAmount: number;
}
@@ -0,0 +1,15 @@
/**
* Knots
*
*
*
* 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 KnotsDTOGroupUpdateGroupNameDto {
name: string;
}
@@ -0,0 +1,15 @@
/**
* Knots
*
*
*
* 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 KnotsDTOGroupUpdateGroupProfilePictureDto {
profilePicture?: string | null;
}
@@ -0,0 +1,15 @@
/**
* Knots
*
*
*
* 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 KnotsDTOKeyCreateKeyDto {
enKey: string;
}
@@ -0,0 +1,15 @@
/**
* Knots
*
*
*
* 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 KnotsDTOKeyDeleteKeyDto {
id: number;
}
@@ -0,0 +1,17 @@
/**
* Knots
*
*
*
* 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 KnotsDTOMessageCreateMessageDto {
contenu: string;
date: string;
type: boolean;
}
@@ -0,0 +1,15 @@
/**
* Knots
*
*
*
* 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 KnotsDTOMessageDeleteMessageDto {
id?: number;
}
@@ -0,0 +1,20 @@
/**
* Knots
*
*
*
* 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 KnotsDTOMessageGetMessageDetailsDto {
id?: number;
contenu?: string | null;
date?: string;
type?: boolean;
userId?: number;
authorName?: string;
}
@@ -0,0 +1,15 @@
/**
* Knots
*
*
*
* 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 KnotsDTORoleDeleteRoleDto {
id: number;
}
@@ -0,0 +1,20 @@
/**
* Knots
*
*
*
* 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 KnotsDTOUserCreateUserDto {
username?: string | null;
description?: string | null;
password?: string | null;
email?: string | null;
tel?: string | null;
profilePicture?: string | null;
}
@@ -0,0 +1,15 @@
/**
* Knots
*
*
*
* 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 KnotsDTOUserDeleteUserDto {
username?: string | null;
}
@@ -0,0 +1,15 @@
/**
* Knots
*
*
*
* 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 KnotsDTOUserGetUserDto {
username?: string | null;
}
@@ -0,0 +1,21 @@
/**
* Knots
*
*
*
* 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 KnotsDTOUserLoginResponseDto {
token?: string | null;
id?: number;
username?: string | null;
email?: string | null;
tel?: string | null;
profilePicture?: string | null;
description?: string | null;
}
@@ -0,0 +1,16 @@
/**
* Knots
*
*
*
* 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 KnotsDTOUserLoginUserDto {
username?: string | null;
password?: string | null;
}
@@ -0,0 +1,16 @@
/**
* Knots
*
*
*
* 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 KnotsDTOUserUpdateUserContactDto {
email: string;
tel: string;
}
@@ -0,0 +1,16 @@
/**
* Knots
*
*
*
* 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 KnotsDTOUserUpdateUserDescriptionDto {
id?: number;
description?: string | null;
}
@@ -0,0 +1,15 @@
/**
* Knots
*
*
*
* 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 KnotsDTOUserUpdateUserPasswordDto {
password?: string | null;
}

Some files were not shown because too many files have changed in this diff Show More