tas-uell-sdk 0.2.0 → 0.3.0

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.
Files changed (27) hide show
  1. package/README.md +2 -0
  2. package/esm2020/lib/components/tas-btn/tas-btn.component.mjs +2 -13
  3. package/esm2020/lib/components/tas-feedback-modal/tas-feedback-modal.component.mjs +229 -0
  4. package/esm2020/lib/components/tas-floating-call/tas-floating-call.component.mjs +38 -3
  5. package/esm2020/lib/components/tas-incoming-appointment/tas-incoming-appointment.component.mjs +46 -8
  6. package/esm2020/lib/components/tas-videocall/tas-videocall.component.mjs +41 -6
  7. package/esm2020/lib/components/tas-waiting-room/tas-waiting-room.component.mjs +18 -3
  8. package/esm2020/lib/interfaces/tas.interfaces.mjs +6 -1
  9. package/esm2020/lib/services/tas.service.mjs +40 -1
  10. package/esm2020/lib/tas-uell-sdk.module.mjs +8 -3
  11. package/esm2020/public-api.mjs +2 -1
  12. package/fesm2015/tas-uell-sdk.mjs +421 -36
  13. package/fesm2015/tas-uell-sdk.mjs.map +1 -1
  14. package/fesm2020/tas-uell-sdk.mjs +416 -36
  15. package/fesm2020/tas-uell-sdk.mjs.map +1 -1
  16. package/lib/components/tas-btn/tas-btn.component.d.ts +1 -2
  17. package/lib/components/tas-feedback-modal/tas-feedback-modal.component.d.ts +101 -0
  18. package/lib/components/tas-floating-call/tas-floating-call.component.d.ts +5 -0
  19. package/lib/components/tas-incoming-appointment/tas-incoming-appointment.component.d.ts +12 -1
  20. package/lib/components/tas-videocall/tas-videocall.component.d.ts +8 -2
  21. package/lib/components/tas-waiting-room/tas-waiting-room.component.d.ts +9 -0
  22. package/lib/interfaces/tas.interfaces.d.ts +17 -0
  23. package/lib/services/tas.service.d.ts +15 -1
  24. package/lib/tas-uell-sdk.module.d.ts +5 -4
  25. package/package.json +1 -1
  26. package/public-api.d.ts +1 -0
  27. package/src/lib/styles/tas-global.scss +17 -0
@@ -15,7 +15,6 @@ export declare class TasButtonComponent implements OnInit, OnDestroy {
15
15
  currentUser: TasCurrentUser;
16
16
  variant: 'default' | 'teal';
17
17
  buttonLabel: string;
18
- skipStatusCheck: boolean;
19
18
  isLoading: boolean;
20
19
  isCheckingStatus: boolean;
21
20
  isStatusError: boolean;
@@ -53,5 +52,5 @@ export declare class TasButtonComponent implements OnInit, OnDestroy {
53
52
  private openWaitingRoomModal;
54
53
  private openVideoCallModal;
55
54
  static ɵfac: i0.ɵɵFactoryDeclaration<TasButtonComponent, never>;
56
- static ɵcmp: i0.ɵɵComponentDeclaration<TasButtonComponent, "tas-btn", never, { "roomType": "roomType"; "entityId": "entityId"; "tenant": "tenant"; "businessRole": "businessRole"; "currentUser": "currentUser"; "variant": "variant"; "buttonLabel": "buttonLabel"; "skipStatusCheck": "skipStatusCheck"; }, {}, never, never>;
55
+ static ɵcmp: i0.ɵɵComponentDeclaration<TasButtonComponent, "tas-btn", never, { "roomType": "roomType"; "entityId": "entityId"; "tenant": "tenant"; "businessRole": "businessRole"; "currentUser": "currentUser"; "variant": "variant"; "buttonLabel": "buttonLabel"; }, {}, never, never>;
57
56
  }
@@ -0,0 +1,101 @@
1
+ import { OnInit, OnDestroy } from '@angular/core';
2
+ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
3
+ import { TasService } from '../../services/tas.service';
4
+ import { TasBusinessRole, FeedbackMotive } from '../../interfaces/tas.interfaces';
5
+ import * as i0 from "@angular/core";
6
+ export declare class TasFeedbackModalComponent implements OnInit, OnDestroy {
7
+ activeModal: NgbActiveModal;
8
+ private tasService;
9
+ videoCallId: number;
10
+ tenant: string;
11
+ businessRole: TasBusinessRole;
12
+ motives: FeedbackMotive[];
13
+ filteredMotives: FeedbackMotive[];
14
+ selectedMotive: FeedbackMotive | null;
15
+ rating: number;
16
+ hoverRating: number;
17
+ observation: string;
18
+ isSubmitting: boolean;
19
+ showToast: boolean;
20
+ isDropdownOpen: boolean;
21
+ private subscriptions;
22
+ private toastTimeout;
23
+ constructor(activeModal: NgbActiveModal, tasService: TasService);
24
+ ngOnInit(): void;
25
+ ngOnDestroy(): void;
26
+ /**
27
+ * Check if current user can see all motives (BUSINESS + TECHNICAL)
28
+ * Only BACKOFFICE, ADMIN_MANAGER, MANAGER roles see BUSINESS motives
29
+ */
30
+ get canSeeBusinessMotives(): boolean;
31
+ /**
32
+ * Observation is required when "Otro problema tecnico" is selected
33
+ */
34
+ get isObservationRequired(): boolean;
35
+ /**
36
+ * Can submit if rating > 0 OR motive is selected
37
+ * If observation is required, it must not be empty
38
+ */
39
+ get canSubmit(): boolean;
40
+ /**
41
+ * Progress percentage for the divider line
42
+ * 0 = nothing selected, 50 = one selected, 100 = both selected
43
+ */
44
+ get feedbackProgress(): number;
45
+ /**
46
+ * Set star rating
47
+ */
48
+ setRating(value: number): void;
49
+ /**
50
+ * Set hover preview rating
51
+ */
52
+ setHoverRating(value: number): void;
53
+ /**
54
+ * Clear hover preview
55
+ */
56
+ clearHoverRating(): void;
57
+ /**
58
+ * Get the display rating (hover preview or actual)
59
+ */
60
+ getDisplayRating(): number;
61
+ /**
62
+ * Toggle dropdown open/close
63
+ */
64
+ toggleDropdown(): void;
65
+ /**
66
+ * Close dropdown
67
+ */
68
+ closeDropdown(): void;
69
+ /**
70
+ * Select a motive from dropdown
71
+ */
72
+ selectMotive(motive: FeedbackMotive): void;
73
+ /**
74
+ * Clear selected motive
75
+ */
76
+ clearMotive(): void;
77
+ /**
78
+ * Submit feedback
79
+ */
80
+ submit(): void;
81
+ /**
82
+ * Close modal without saving
83
+ */
84
+ dismiss(): void;
85
+ /**
86
+ * Load motives from API
87
+ */
88
+ private loadMotives;
89
+ /**
90
+ * Filter motives based on user role
91
+ * USERs see only TECHNICAL motives
92
+ * Owners (BACKOFFICE, ADMIN_MANAGER, MANAGER) see all motives
93
+ */
94
+ private filterMotives;
95
+ /**
96
+ * Show toast notification and auto-dismiss after 3s
97
+ */
98
+ private showToastNotification;
99
+ static ɵfac: i0.ɵɵFactoryDeclaration<TasFeedbackModalComponent, never>;
100
+ static ɵcmp: i0.ɵɵComponentDeclaration<TasFeedbackModalComponent, "tas-feedback-modal", never, { "videoCallId": "videoCallId"; "tenant": "tenant"; "businessRole": "businessRole"; }, {}, never, never>;
101
+ }
@@ -9,12 +9,17 @@ export declare class TasFloatingCallComponent implements OnInit, OnDestroy {
9
9
  isMuted: boolean;
10
10
  private subscriptions;
11
11
  private videoCallModalRef;
12
+ private feedbackShown;
12
13
  constructor(tasService: TasService, modalService: NgbModal);
13
14
  ngOnInit(): void;
14
15
  ngOnDestroy(): void;
15
16
  onExpand(): void;
16
17
  onHangUp(): void;
17
18
  toggleMute(): void;
19
+ /**
20
+ * Open feedback modal when call ends from PiP mode
21
+ */
22
+ private openFeedbackModal;
18
23
  private setupSubscriptions;
19
24
  private openVideoCallModal;
20
25
  private readonly PIP_MARGIN;
@@ -15,16 +15,27 @@ export declare class TasIncomingAppointmentComponent implements OnInit, OnDestro
15
15
  appointments: TasAppointment[];
16
16
  isLoading: boolean;
17
17
  hasError: boolean;
18
+ activeAppointmentId: number | null;
18
19
  private subscriptions;
19
20
  constructor(tasService: TasService);
20
21
  ngOnInit(): void;
21
22
  ngOnDestroy(): void;
22
23
  private loadAppointments;
24
+ /**
25
+ * Check status endpoint to get the active appointmentId
26
+ */
27
+ private checkStatus;
23
28
  onEnterCall(appointment: TasAppointment): void;
24
29
  /**
25
- * Check if tas-btn should be shown for an appointment (CONFIRMED or ACTIVE status)
30
+ * Check if tas-btn should be shown for an appointment.
31
+ * Only shows when appointment.id matches the activeAppointmentId from status API.
32
+ * tas-btn handles its own polling for joinable state.
26
33
  */
27
34
  shouldShowTasBtn(appointment: TasAppointment): boolean;
35
+ /**
36
+ * TrackBy function for ngFor
37
+ */
38
+ trackByAppointmentId(index: number, appointment: TasAppointment): number;
28
39
  /**
29
40
  * Format date to Spanish format: "Lunes 8 de diciembre"
30
41
  */
@@ -1,6 +1,6 @@
1
1
  import { OnInit, OnDestroy, ElementRef, AfterViewInit } from '@angular/core';
2
2
  import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
3
- import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
3
+ import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap';
4
4
  import { TasService } from '../../services/tas.service';
5
5
  import { GeolocationService } from '../../services/geolocation.service';
6
6
  import { CallState, TasBusinessRole, WaitingRoomUser, UserGeoInfo } from '../../interfaces/tas.interfaces';
@@ -18,6 +18,7 @@ export declare class TasVideocallComponent implements OnInit, OnDestroy, AfterVi
18
18
  private tasService;
19
19
  private geolocationService;
20
20
  private sanitizer;
21
+ private modalService;
21
22
  sessionId: string;
22
23
  token: string;
23
24
  appointmentId?: number;
@@ -47,12 +48,17 @@ export declare class TasVideocallComponent implements OnInit, OnDestroy, AfterVi
47
48
  homeIcon: SafeHtml;
48
49
  devModeEnabled: boolean;
49
50
  private geoPanelDismissed;
51
+ private feedbackShown;
50
52
  private subscriptions;
51
- constructor(activeModal: NgbActiveModal, tasService: TasService, geolocationService: GeolocationService, sanitizer: DomSanitizer);
53
+ constructor(activeModal: NgbActiveModal, tasService: TasService, geolocationService: GeolocationService, sanitizer: DomSanitizer, modalService: NgbModal);
52
54
  ngOnInit(): void;
53
55
  ngAfterViewInit(): void;
54
56
  ngOnDestroy(): void;
55
57
  hangUp(): void;
58
+ /**
59
+ * Open feedback modal when call ends
60
+ */
61
+ private openFeedbackModal;
56
62
  toggleMute(): void;
57
63
  minimize(): void;
58
64
  toggleSwap(): void;
@@ -26,6 +26,7 @@ export declare class TasWaitingRoomComponent implements OnInit, OnDestroy {
26
26
  state: WaitingRoomState;
27
27
  WaitingRoomState: typeof WaitingRoomState;
28
28
  errorMessage: string;
29
+ showErrorDetails: boolean;
29
30
  isJoinable: boolean;
30
31
  private resolvedSessionId;
31
32
  private resolvedAppointmentId;
@@ -102,6 +103,14 @@ export declare class TasWaitingRoomComponent implements OnInit, OnDestroy {
102
103
  * Resets retry count and restarts the flow.
103
104
  */
104
105
  retry(): void;
106
+ /**
107
+ * Toggle the error details dropdown visibility.
108
+ */
109
+ toggleErrorDetails(): void;
110
+ /**
111
+ * Close the waiting room modal.
112
+ */
113
+ close(): void;
105
114
  private openVideoCallModal;
106
115
  static ɵfac: i0.ɵɵFactoryDeclaration<TasWaitingRoomComponent, never>;
107
116
  static ɵcmp: i0.ɵɵComponentDeclaration<TasWaitingRoomComponent, "tas-waiting-room", never, { "roomType": "roomType"; "entityId": "entityId"; "tenant": "tenant"; "businessRole": "businessRole"; "currentUser": "currentUser"; }, {}, never, never>;
@@ -61,6 +61,10 @@ export declare enum ViewMode {
61
61
  FULLSCREEN = "FULLSCREEN",
62
62
  PIP = "PIP"
63
63
  }
64
+ export declare enum FeedbackMotiveType {
65
+ TECHNICAL = "TECHNICAL",
66
+ BUSINESS = "BUSINESS"
67
+ }
64
68
  export interface TasCurrentUser {
65
69
  id: number;
66
70
  name: string;
@@ -182,3 +186,16 @@ export interface GetAppointmentsRequest {
182
186
  toDate: string;
183
187
  entityId?: number;
184
188
  }
189
+ export interface SaveFeedbackRequest {
190
+ videoCallId: number;
191
+ motiveId: number;
192
+ motiveType?: FeedbackMotiveType;
193
+ observation: string;
194
+ rating: number;
195
+ tenant: string;
196
+ }
197
+ export interface FeedbackMotive {
198
+ id: number;
199
+ description: string;
200
+ motiveType: FeedbackMotiveType;
201
+ }
@@ -1,7 +1,7 @@
1
1
  import { TasUtilityService } from './tas-utility.service';
2
2
  import { Observable } from 'rxjs';
3
3
  import * as OT from '@opentok/client';
4
- import { GenerateTokenResponse, StartSessionRequest, FinishSessionResponse, ProxyVideoStatusRequest, ProxyVideoStatusResponse, ProxyVideoFinishRequest, ProxyVideoUserModifyRequest, UserCallAction, RoomUserStatus, GeoStatus, TasBusinessRole, CallState, ViewMode, WaitingRoomUser, UserGeoInfo, TasAppointment, GetAppointmentsRequest } from '../interfaces/tas.interfaces';
4
+ import { GenerateTokenResponse, StartSessionRequest, FinishSessionResponse, ProxyVideoStatusRequest, ProxyVideoStatusResponse, ProxyVideoFinishRequest, ProxyVideoUserModifyRequest, UserCallAction, RoomUserStatus, GeoStatus, TasBusinessRole, CallState, ViewMode, WaitingRoomUser, UserGeoInfo, TasAppointment, GetAppointmentsRequest, SaveFeedbackRequest, FeedbackMotive } from '../interfaces/tas.interfaces';
5
5
  import { TasConfig, TasHttpClient } from '../config/tas.config';
6
6
  import * as i0 from "@angular/core";
7
7
  export { CallState, ViewMode, TasBusinessRole, UserCallAction, RoomUserStatus, GeoStatus };
@@ -112,6 +112,19 @@ export declare class TasService {
112
112
  * @returns Observable of appointment array
113
113
  */
114
114
  getAppointments(params: GetAppointmentsRequest): Observable<TasAppointment[]>;
115
+ /**
116
+ * Save video call feedback.
117
+ * POST /v2/proxy/video/save/feedback
118
+ * @param payload Feedback data including videoCallId, motiveId, motiveType, observation, rating (1-5), and tenant
119
+ * @returns Observable that completes on success (HTTP 200 OK, no response body)
120
+ */
121
+ saveFeedback(payload: SaveFeedbackRequest): Observable<void>;
122
+ /**
123
+ * Get available feedback motives.
124
+ * GET /v2/proxy/video/motives
125
+ * @returns Observable of feedback motives array
126
+ */
127
+ getMotives(): Observable<FeedbackMotive[]>;
115
128
  /**
116
129
  * Start automatic status polling for the current session.
117
130
  * Status is polled every STATUS_POLL_INTERVAL_MS milliseconds.
@@ -133,6 +146,7 @@ export declare class TasService {
133
146
  admitUserFromWaitingRoom(userId: number, videoCallId: number): Observable<any>;
134
147
  get appointmentId(): number | null;
135
148
  get videoCallId(): number | null;
149
+ get tenant(): string | null;
136
150
  /**
137
151
  * Connects to a TokBox video session
138
152
  */
@@ -7,9 +7,10 @@ import * as i3 from "./components/tas-floating-call/tas-floating-call.component"
7
7
  import * as i4 from "./components/tas-waiting-room/tas-waiting-room.component";
8
8
  import * as i5 from "./components/tas-avatar/tas-avatar.component";
9
9
  import * as i6 from "./components/tas-incoming-appointment/tas-incoming-appointment.component";
10
- import * as i7 from "@angular/common";
11
- import * as i8 from "@angular/forms";
12
- import * as i9 from "@ng-bootstrap/ng-bootstrap";
10
+ import * as i7 from "./components/tas-feedback-modal/tas-feedback-modal.component";
11
+ import * as i8 from "@angular/common";
12
+ import * as i9 from "@angular/forms";
13
+ import * as i10 from "@ng-bootstrap/ng-bootstrap";
13
14
  export declare class TasUellSdkModule {
14
15
  /**
15
16
  * Use forRoot() to configure the TAS SDK module with required dependencies.
@@ -45,6 +46,6 @@ export declare class TasUellSdkModule {
45
46
  httpClient: new (...args: any[]) => TasHttpClient;
46
47
  }): ModuleWithProviders<TasUellSdkModule>;
47
48
  static ɵfac: i0.ɵɵFactoryDeclaration<TasUellSdkModule, never>;
48
- static ɵmod: i0.ɵɵNgModuleDeclaration<TasUellSdkModule, [typeof i1.TasButtonComponent, typeof i2.TasVideocallComponent, typeof i3.TasFloatingCallComponent, typeof i4.TasWaitingRoomComponent, typeof i5.TasAvatarComponent, typeof i6.TasIncomingAppointmentComponent], [typeof i7.CommonModule, typeof i8.FormsModule, typeof i9.NgbTooltipModule], [typeof i1.TasButtonComponent, typeof i2.TasVideocallComponent, typeof i3.TasFloatingCallComponent, typeof i4.TasWaitingRoomComponent, typeof i5.TasAvatarComponent, typeof i6.TasIncomingAppointmentComponent]>;
49
+ static ɵmod: i0.ɵɵNgModuleDeclaration<TasUellSdkModule, [typeof i1.TasButtonComponent, typeof i2.TasVideocallComponent, typeof i3.TasFloatingCallComponent, typeof i4.TasWaitingRoomComponent, typeof i5.TasAvatarComponent, typeof i6.TasIncomingAppointmentComponent, typeof i7.TasFeedbackModalComponent], [typeof i8.CommonModule, typeof i9.FormsModule, typeof i10.NgbTooltipModule], [typeof i1.TasButtonComponent, typeof i2.TasVideocallComponent, typeof i3.TasFloatingCallComponent, typeof i4.TasWaitingRoomComponent, typeof i5.TasAvatarComponent, typeof i6.TasIncomingAppointmentComponent, typeof i7.TasFeedbackModalComponent]>;
49
50
  static ɵinj: i0.ɵɵInjectorDeclaration<TasUellSdkModule>;
50
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tas-uell-sdk",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "TAS (Telemedicine Assistance Service) SDK for Angular applications - Video call functionality using TokBox/Vonage",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0",
package/public-api.d.ts CHANGED
@@ -9,4 +9,5 @@ export * from './lib/components/tas-videocall/tas-videocall.component';
9
9
  export * from './lib/components/tas-floating-call/tas-floating-call.component';
10
10
  export * from './lib/components/tas-avatar/tas-avatar.component';
11
11
  export * from './lib/components/tas-incoming-appointment/tas-incoming-appointment.component';
12
+ export * from './lib/components/tas-feedback-modal/tas-feedback-modal.component';
12
13
  export * from './lib/tas-uell-sdk.module';
@@ -34,3 +34,20 @@
34
34
  padding: 0;
35
35
  }
36
36
  }
37
+
38
+ /* TAS Feedback Modal - global styles for NgbModal wrapper */
39
+ .tas-feedback-modal-wrapper {
40
+ .modal-dialog {
41
+ max-width: 480px;
42
+ }
43
+ .modal-content {
44
+ border: none;
45
+ border-radius: 20px;
46
+ background: #ffffff;
47
+ overflow: hidden;
48
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
49
+ }
50
+ .modal-body {
51
+ padding: 0;
52
+ }
53
+ }