@rtsee/ngx 0.0.57 → 0.0.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 0.0.58 (2025-08-11)
7
+
8
+ **Note:** Version bump only for package @rtsee/ngx
9
+
6
10
  ## 0.0.57 (2025-07-23)
7
11
 
8
12
  **Note:** Version bump only for package @rtsee/ngx
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.57",
2
+ "version": "0.0.58",
3
3
  "name": "@rtsee/ngx",
4
4
  "module": "./dist/ngx/fesm2022/rtsee-ngx.mjs",
5
5
  "types": "./dist/ngx/index.d.ts",
@@ -30,11 +30,11 @@
30
30
  "@angular/platform-browser": "~20.1.2",
31
31
  "@angular/platform-browser-dynamic": "~20.1.2",
32
32
  "@angular/router": "~20.1.2",
33
- "@rtsee/common": "^0.0.27",
34
- "@rtsee/conference": "^0.0.28",
35
- "@rtsee/events-dashboard": "^0.0.61",
36
- "@rtsee/factory": "^0.0.70",
37
- "@rtsee/messenger": "^0.0.61",
33
+ "@rtsee/common": "^0.0.28",
34
+ "@rtsee/conference": "^0.0.29",
35
+ "@rtsee/events-dashboard": "^0.0.62",
36
+ "@rtsee/factory": "^0.0.71",
37
+ "@rtsee/messenger": "^0.0.62",
38
38
  "@rtsee/signaling-client": "^0.0.66",
39
39
  "dayjs": "^1.11.9",
40
40
  "ngx-autosize": "^2.0.4",
@@ -58,5 +58,5 @@
58
58
  "publishConfig": {
59
59
  "access": "public"
60
60
  },
61
- "gitHead": "741e30dc35daea6122d5bd94a6c070e02a31bc62"
61
+ "gitHead": "468df28ddef4b2daa3f7780c7f4efeb3fea9365c"
62
62
  }
@@ -1,9 +1,11 @@
1
- import { Component } from '@angular/core';
1
+ import {Component, Input, OnInit} from '@angular/core';
2
2
  import {SignInComponent} from "../sign-in/sign-in.component";
3
3
  import {SignUpComponent} from "../sign-up/sign-up.component";
4
4
  import {ForgotPasswordComponent} from "../forgot-password/forgot-password.component";
5
5
  import {ResetPasswordComponent} from "../reset-password/reset-password.component";
6
6
  import {NgIf} from "@angular/common";
7
+ import {RTSeeAuthService} from "../services/auth.service";
8
+ import {RTSeeAuth} from "@rtsee/auth";
7
9
 
8
10
  @Component({
9
11
  selector: 'rtsee-auth',
@@ -17,6 +19,14 @@ import {NgIf} from "@angular/common";
17
19
  ],
18
20
  standalone: true
19
21
  })
20
- export class AuthComponent {
22
+ export class RTSeeAuthComponent implements OnInit {
23
+ @Input() auth!: RTSeeAuth<any>;
24
+
21
25
  activeComponent: 'reset-password' | 'sign-up' | 'sign-in' | 'forgot-password' = 'sign-in' ;
26
+
27
+ constructor(private authService: RTSeeAuthService) {}
28
+
29
+ ngOnInit() {
30
+ this.authService.init(this.auth);
31
+ }
22
32
  }
@@ -20,11 +20,10 @@ export class ForgotPasswordComponent {
20
20
  constructor(
21
21
  private readonly formBuilder: FormBuilder
22
22
  ) {
23
- this.emailForm= this.formBuilder.group<TypedReactiveForm<ForgotPasswordForm>>({
23
+ this.emailForm= this.formBuilder.group<TypedReactiveForm<ForgotPasswordForm>>({
24
24
  email: this.formBuilder.control(null, { validators: [Validators.required, Validators.email] }),
25
25
  });
26
- this.forgotPasswordFormKeys = UtilsService.getKeysAsValueObject(this.emailForm.getRawValue());
27
-
26
+ this.forgotPasswordFormKeys = UtilsService.getKeysAsValueObject(this.emailForm.getRawValue());
28
27
  }
29
28
 
30
29
  public submitEmail(): void {
@@ -0,0 +1,37 @@
1
+ import { Injectable } from '@angular/core';
2
+ import {HttpClient} from "@angular/common/http";
3
+ import {
4
+ RTSeeAuth,
5
+ IRtseeSignInRequestOptions,
6
+ IRTSeeSignInResponse,
7
+ IRtseeSignUpRequestOptions,
8
+ IRTSeeSignUpResponse,
9
+ } from "@rtsee/auth";
10
+ import { Observable, tap } from "rxjs";
11
+
12
+ @Injectable({
13
+ providedIn: 'root'
14
+ })
15
+ export class RTSeeAuthService {
16
+ rtseeAuth!: RTSeeAuth<any>;
17
+
18
+ constructor(
19
+ private http: HttpClient,
20
+ ) {}
21
+
22
+ init(auth: RTSeeAuth<any>) {
23
+ console.log('init');
24
+ this.rtseeAuth = auth;
25
+ }
26
+
27
+ signIn(credentials: IRtseeSignInRequestOptions): Observable<IRTSeeSignInResponse> {
28
+ return this.http
29
+ .post<IRTSeeSignInResponse>(`${this.rtseeAuth.baseUrl}/${this.rtseeAuth.endpoints.signIn}`, credentials)
30
+ .pipe(tap((res) => this.rtseeAuth.authenticate(res)))
31
+ }
32
+
33
+ signUp(credentials: IRtseeSignUpRequestOptions): Observable<IRTSeeSignUpResponse> {
34
+ return this.http
35
+ .post<IRTSeeSignUpResponse>(`${this.rtseeAuth.baseUrl}/${this.rtseeAuth.endpoints.signUp}`, credentials)
36
+ }
37
+ }
@@ -5,7 +5,7 @@
5
5
  height="38"
6
6
  width="37"
7
7
  />
8
- <h2 class="auth-title">Вхід в Особистий Кабінет</h2>
8
+ <h2 class="auth-title">Вйоб в Особистий Кабінет</h2>
9
9
  <p class="auth-title-description">Аби переглядати казки, увійдіть в свій особистий кабінет</p>
10
10
 
11
11
  <form class="auth-form" [formGroup]="signInForm" (ngSubmit)="login()">
@@ -4,6 +4,7 @@ import {FormBuilder, FormGroup, ReactiveFormsModule, Validators} from '@angular/
4
4
  import { UtilsService } from '../services/utils.service';
5
5
  import { SignInForm, TypedReactiveForm } from '../types/auth-form.type';
6
6
  import {NgOptimizedImage} from "@angular/common";
7
+ import { RTSeeAuthService } from "../services/auth.service";
7
8
 
8
9
  @Component({
9
10
  selector: 'rtsee-sign-in',
@@ -21,24 +22,27 @@ export class SignInComponent {
21
22
 
22
23
  constructor(
23
24
  private readonly formBuilder: FormBuilder,
24
- private readonly router: Router
25
+ private readonly router: Router,
26
+ private authService: RTSeeAuthService
25
27
  ) {
26
28
  this.signInForm = this.formBuilder.group<TypedReactiveForm<SignInForm>>({
27
29
  username: this.formBuilder.control(null, {validators: [Validators.required, Validators.email]}),
28
- password: this.formBuilder.control(null, {validators: [Validators.required]}),
29
- remember: this.formBuilder.control(false, {nonNullable: true})
30
+ password: this.formBuilder.control(null, {validators: [Validators.required]})
30
31
  });
31
32
  this.signInFormKeys = UtilsService.getKeysAsValueObject(this.signInForm.getRawValue());
32
33
  }
33
34
 
34
35
  public login(): void {
35
36
  if (this.signInForm.valid) {
36
- // this.authService.signIn(this.signInForm.getRawValue())
37
- // .subscribe((success) => {
38
- // if (success) {
39
- // this.router.navigate(['/']);
40
- // }
41
- // });
37
+ const username: string = this.signInForm.getRawValue().username!;
38
+ const password: string = this.signInForm.getRawValue().password!;
39
+
40
+ this.authService.signIn({username, password})
41
+ .subscribe((success) => {
42
+ if (success) {
43
+ void this.router.navigate(this.authService.rtseeAuth.defaultPostLoginRoute);
44
+ }
45
+ });
42
46
  }
43
47
  }
44
48
  }
@@ -5,6 +5,7 @@ import { UtilsService } from '../services/utils.service';
5
5
  import {ConfirmPasswordValidator} from "../validators/form-fields-validators";
6
6
  import {RouterLink} from "@angular/router";
7
7
  import {NgOptimizedImage} from "@angular/common";
8
+ import {RTSeeAuthService} from "../services/auth.service";
8
9
 
9
10
  @Component({
10
11
  selector: 'rtsee-sign-up',
@@ -21,7 +22,8 @@ export class SignUpComponent {
21
22
  public readonly signUpFormKeys: Record<keyof SignUpForm, string>;
22
23
 
23
24
  constructor(
24
- private readonly formBuilder: FormBuilder
25
+ private readonly formBuilder: FormBuilder,
26
+ private authService: RTSeeAuthService
25
27
  ) {
26
28
  this.signUpForm = this.formBuilder.group<TypedReactiveForm<SignUpForm>>({
27
29
  email: this.formBuilder.control('', { validators: [Validators.required, Validators.email] }),
@@ -41,7 +43,16 @@ export class SignUpComponent {
41
43
 
42
44
  public signUp(): void {
43
45
  if (this.signUpForm.valid) {
44
- const formValue = this.signUpForm.getRawValue();
46
+ const formValues: SignUpForm = this.signUpForm.getRawValue();
47
+
48
+
49
+
50
+ this.authService.signUp({
51
+ email: formValues.email!,
52
+ password: formValues.password!,
53
+ terms: formValues.terms!
54
+ })
55
+
45
56
 
46
57
 
47
58
  // Call sign-up API
@@ -32,5 +32,4 @@ export type ForgotPasswordForm = {
32
32
  export type SignInForm = {
33
33
  username: string | null;
34
34
  password: string | null;
35
- remember: boolean;
36
35
  };
@@ -41,7 +41,7 @@ import { SignUpComponent } from "./components/rtsee-auth/sign-up/sign-up.compone
41
41
  import { SignInComponent } from "./components/rtsee-auth/sign-in/sign-in.component";
42
42
  import { ForgotPasswordComponent } from "./components/rtsee-auth/forgot-password/forgot-password.component";
43
43
  import { VendorsComponent } from "./components/rtsee-auth/vendors/vendors.component";
44
- import { AuthComponent } from './components/rtsee-auth/auth/auth.component';
44
+ import { RTSeeAuthComponent } from './components/rtsee-auth/auth/auth.component';
45
45
  import { RtseeSidenavComponent } from './components/rtsee-container/rtsee-sidenav/rtsee-sidenav.component';
46
46
  import { RtseeBottomNavComponent } from './components/rtsee-container/rtsee-bottom-nav/rtsee-bottom-nav.component';
47
47
  import { RouterLink, RouterLinkActive } from "@angular/router";
@@ -51,7 +51,7 @@ import { PresentationHeaderComponent } from './components/rtsee-presentation/pre
51
51
  @NgModule({
52
52
  declarations: [],
53
53
  imports: [
54
- AuthComponent,
54
+ RTSeeAuthComponent,
55
55
  VendorsComponent,
56
56
  ForgotPasswordComponent,
57
57
  SignInComponent,
@@ -109,7 +109,7 @@ import { PresentationHeaderComponent } from './components/rtsee-presentation/pre
109
109
  RtseeEventsDashboardComponent,
110
110
  RTSeeContainerComponent,
111
111
  PresentationComponent,
112
- AuthComponent
112
+ RTSeeAuthComponent
113
113
  ],
114
114
  schemas: [
115
115
  CUSTOM_ELEMENTS_SCHEMA,
package/tsconfig.json CHANGED
@@ -26,11 +26,7 @@
26
26
  "typeCheckHostBindings": true,
27
27
  "strictTemplates": true
28
28
  },
29
- "files": [],
30
29
  "references": [
31
- {
32
- "path": "./projects/ngx/tsconfig.lib.json"
33
- },
34
30
  {
35
31
  "path": "./projects/ngx/tsconfig.spec.json"
36
32
  }