mesauth-angular 1.4.0 → 1.5.6
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/README.md +13 -0
- package/fesm2022/mesauth-angular.mjs +1135 -17
- package/fesm2022/mesauth-angular.mjs.map +1 -1
- package/index.d.ts +306 -6
- package/package.json +2 -1
package/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, NgZone, EnvironmentProviders, OnDestroy, OnInit, EventEmitter, ChangeDetectorRef, AfterViewInit } from '@angular/core';
|
|
2
|
+
import { InjectionToken, NgZone, EnvironmentProviders, OnDestroy, OnInit, EventEmitter, ChangeDetectorRef, AfterViewInit, ElementRef } from '@angular/core';
|
|
3
3
|
import { HttpClient, HttpInterceptorFn } from '@angular/common/http';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
import { Router } from '@angular/router';
|
|
6
|
-
import { SafeHtml } from '@angular/platform-browser';
|
|
6
|
+
import { SafeHtml, SafeResourceUrl } from '@angular/platform-browser';
|
|
7
7
|
|
|
8
8
|
interface MesAuthConfig {
|
|
9
9
|
apiBaseUrl: string;
|
|
@@ -127,6 +127,8 @@ declare class MesAuthService {
|
|
|
127
127
|
currentUser$: Observable<IUser | null>;
|
|
128
128
|
private _notifications;
|
|
129
129
|
notifications$: Observable<any>;
|
|
130
|
+
private _approvalEvents;
|
|
131
|
+
approvalEvents$: Observable<any>;
|
|
130
132
|
private apiBase;
|
|
131
133
|
private config;
|
|
132
134
|
private http;
|
|
@@ -196,19 +198,24 @@ declare class UserProfileComponent implements OnInit, OnDestroy {
|
|
|
196
198
|
private router;
|
|
197
199
|
private themeService;
|
|
198
200
|
private cdr;
|
|
201
|
+
private http;
|
|
199
202
|
notificationClick: EventEmitter<void>;
|
|
203
|
+
approvalClick: EventEmitter<void>;
|
|
200
204
|
get themeClass(): string;
|
|
201
205
|
currentUser: i0.WritableSignal<IUser>;
|
|
202
206
|
currentTheme: Theme;
|
|
203
207
|
unreadCount: number;
|
|
208
|
+
pendingApprovalCount: number;
|
|
204
209
|
dropdownOpen: boolean;
|
|
205
210
|
private hasUser;
|
|
206
211
|
private destroy$;
|
|
207
212
|
avatarRefresh: i0.WritableSignal<number>;
|
|
208
|
-
constructor(authService: MesAuthService, router: Router, themeService: ThemeService, cdr: ChangeDetectorRef);
|
|
213
|
+
constructor(authService: MesAuthService, router: Router, themeService: ThemeService, cdr: ChangeDetectorRef, http: HttpClient);
|
|
209
214
|
ngOnInit(): void;
|
|
210
215
|
ngOnDestroy(): void;
|
|
211
216
|
loadUnreadCount(): void;
|
|
217
|
+
loadPendingApprovalCount(): void;
|
|
218
|
+
onApprovalClick(): void;
|
|
212
219
|
getAvatarUrl(user: IUser): string;
|
|
213
220
|
getLastNameInitial(user: IUser): string;
|
|
214
221
|
toggleDropdown(): void;
|
|
@@ -218,13 +225,226 @@ declare class UserProfileComponent implements OnInit, OnDestroy {
|
|
|
218
225
|
onLogout(): void;
|
|
219
226
|
onNotificationClick(): void;
|
|
220
227
|
static ɵfac: i0.ɵɵFactoryDeclaration<UserProfileComponent, never>;
|
|
221
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<UserProfileComponent, "ma-user-profile", never, {}, { "notificationClick": "notificationClick"; }, never, never, true, never>;
|
|
228
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UserProfileComponent, "ma-user-profile", never, {}, { "notificationClick": "notificationClick"; "approvalClick": "approvalClick"; }, never, never, true, never>;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
declare enum ApprovalStepMode {
|
|
232
|
+
Sequential = 0,
|
|
233
|
+
Parallel = 1
|
|
234
|
+
}
|
|
235
|
+
declare enum ApprovalDocumentStatus {
|
|
236
|
+
Draft = 0,
|
|
237
|
+
Pending = 1,
|
|
238
|
+
Approved = 2,
|
|
239
|
+
Rejected = 3,
|
|
240
|
+
Cancelled = 4,
|
|
241
|
+
Expired = 5
|
|
242
|
+
}
|
|
243
|
+
declare enum ApprovalStepStatus {
|
|
244
|
+
Waiting = 0,
|
|
245
|
+
Active = 1,
|
|
246
|
+
Approved = 2,
|
|
247
|
+
Rejected = 3,
|
|
248
|
+
Delegated = 4,
|
|
249
|
+
Expired = 5,
|
|
250
|
+
Skipped = 6
|
|
251
|
+
}
|
|
252
|
+
declare enum ApprovalActionType {
|
|
253
|
+
Created = 0,
|
|
254
|
+
Submitted = 1,
|
|
255
|
+
Approved = 2,
|
|
256
|
+
Rejected = 3,
|
|
257
|
+
Delegated = 4,
|
|
258
|
+
Cancelled = 5,
|
|
259
|
+
Commented = 6,
|
|
260
|
+
Expired = 7,
|
|
261
|
+
StepAdvanced = 8
|
|
262
|
+
}
|
|
263
|
+
interface ApprovalDocumentSummaryDto {
|
|
264
|
+
id: string;
|
|
265
|
+
title: string;
|
|
266
|
+
description?: string;
|
|
267
|
+
thumbnailPath?: string;
|
|
268
|
+
sourceAppId: string;
|
|
269
|
+
referenceId: string;
|
|
270
|
+
requestedByUserName: string;
|
|
271
|
+
status: ApprovalDocumentStatus;
|
|
272
|
+
currentStepOrder: number;
|
|
273
|
+
totalSteps: number;
|
|
274
|
+
currentStepName?: string;
|
|
275
|
+
createdAt: string;
|
|
276
|
+
completedAt?: string;
|
|
277
|
+
}
|
|
278
|
+
interface ApprovalStepDto {
|
|
279
|
+
id: number;
|
|
280
|
+
stepOrder: number;
|
|
281
|
+
stepName: string;
|
|
282
|
+
mode: ApprovalStepMode;
|
|
283
|
+
assignedUserId: string;
|
|
284
|
+
assignedUserName: string;
|
|
285
|
+
delegatedToUserId?: string;
|
|
286
|
+
delegatedToUserName?: string;
|
|
287
|
+
status: ApprovalStepStatus;
|
|
288
|
+
comment?: string;
|
|
289
|
+
decidedAt?: string;
|
|
290
|
+
deadlineAt?: string;
|
|
291
|
+
}
|
|
292
|
+
interface ApprovalReferenceDto {
|
|
293
|
+
userId: string;
|
|
294
|
+
userName: string;
|
|
295
|
+
addedAt: string;
|
|
296
|
+
}
|
|
297
|
+
interface ApprovalDocumentDto {
|
|
298
|
+
id: string;
|
|
299
|
+
title: string;
|
|
300
|
+
description?: string;
|
|
301
|
+
contentPath: string;
|
|
302
|
+
thumbnailPath?: string;
|
|
303
|
+
sourceAppId: string;
|
|
304
|
+
referenceId: string;
|
|
305
|
+
templateId?: number;
|
|
306
|
+
requestedByUserId: string;
|
|
307
|
+
requestedByUserName: string;
|
|
308
|
+
status: ApprovalDocumentStatus;
|
|
309
|
+
currentStepOrder: number;
|
|
310
|
+
callbackUrl?: string;
|
|
311
|
+
createdAt: string;
|
|
312
|
+
updatedAt: string;
|
|
313
|
+
completedAt?: string;
|
|
314
|
+
deadlineAt?: string;
|
|
315
|
+
steps: ApprovalStepDto[];
|
|
316
|
+
references: ApprovalReferenceDto[];
|
|
317
|
+
}
|
|
318
|
+
interface ApprovalHistoryDto {
|
|
319
|
+
id: number;
|
|
320
|
+
documentId: string;
|
|
321
|
+
stepId?: number;
|
|
322
|
+
action: ApprovalActionType;
|
|
323
|
+
actorUserId: string;
|
|
324
|
+
actorUserName: string;
|
|
325
|
+
comment?: string;
|
|
326
|
+
details?: string;
|
|
327
|
+
timestamp: string;
|
|
328
|
+
}
|
|
329
|
+
interface ApprovalTemplateSummaryDto {
|
|
330
|
+
id: number;
|
|
331
|
+
name: string;
|
|
332
|
+
description?: string;
|
|
333
|
+
sourceAppId: string;
|
|
334
|
+
stepCount: number;
|
|
335
|
+
referenceCount: number;
|
|
336
|
+
isActive: boolean;
|
|
337
|
+
createdAt: string;
|
|
338
|
+
}
|
|
339
|
+
interface ApprovalTemplateStepDto {
|
|
340
|
+
id: number;
|
|
341
|
+
stepOrder: number;
|
|
342
|
+
stepName: string;
|
|
343
|
+
mode: ApprovalStepMode;
|
|
344
|
+
deadlineHours?: number;
|
|
345
|
+
assigneeUserIds: string[];
|
|
346
|
+
}
|
|
347
|
+
interface ApprovalTemplateDto {
|
|
348
|
+
id: number;
|
|
349
|
+
name: string;
|
|
350
|
+
description?: string;
|
|
351
|
+
sourceAppId: string;
|
|
352
|
+
createdByUserId: string;
|
|
353
|
+
isActive: boolean;
|
|
354
|
+
createdAt: string;
|
|
355
|
+
updatedAt: string;
|
|
356
|
+
steps: ApprovalTemplateStepDto[];
|
|
357
|
+
referenceUserIds: string[];
|
|
358
|
+
}
|
|
359
|
+
interface ApprovalDashboardDto {
|
|
360
|
+
pendingCount: number;
|
|
361
|
+
approvedTodayCount: number;
|
|
362
|
+
rejectedTodayCount: number;
|
|
363
|
+
recentActivity: ApprovalDocumentSummaryDto[];
|
|
364
|
+
}
|
|
365
|
+
interface CreateApprovalResponseDto {
|
|
366
|
+
documentId: string;
|
|
367
|
+
message: string;
|
|
368
|
+
}
|
|
369
|
+
interface ApprovalStepRequest {
|
|
370
|
+
stepOrder: number;
|
|
371
|
+
stepName: string;
|
|
372
|
+
mode?: ApprovalStepMode;
|
|
373
|
+
approverUserIds: string[];
|
|
374
|
+
deadlineHours?: number;
|
|
375
|
+
}
|
|
376
|
+
interface CreateApprovalRequest {
|
|
377
|
+
title: string;
|
|
378
|
+
description?: string;
|
|
379
|
+
contentHtml: string;
|
|
380
|
+
thumbnailBase64?: string;
|
|
381
|
+
referenceId: string;
|
|
382
|
+
templateId?: number;
|
|
383
|
+
requestedByUserId?: string;
|
|
384
|
+
callbackUrl?: string;
|
|
385
|
+
deadlineHours?: number;
|
|
386
|
+
steps?: ApprovalStepRequest[];
|
|
387
|
+
referenceUserIds?: string[];
|
|
388
|
+
}
|
|
389
|
+
interface ApproveRejectRequest {
|
|
390
|
+
comment?: string;
|
|
391
|
+
}
|
|
392
|
+
interface DelegateRequest {
|
|
393
|
+
toUserId: string;
|
|
394
|
+
reason?: string;
|
|
395
|
+
}
|
|
396
|
+
interface CreateApprovalTemplateRequest {
|
|
397
|
+
name: string;
|
|
398
|
+
description?: string;
|
|
399
|
+
sourceAppId: string;
|
|
400
|
+
steps: ApprovalStepRequest[];
|
|
401
|
+
referenceUserIds?: string[];
|
|
402
|
+
}
|
|
403
|
+
interface UpdateApprovalTemplateRequest {
|
|
404
|
+
name: string;
|
|
405
|
+
description?: string;
|
|
406
|
+
steps: ApprovalStepRequest[];
|
|
407
|
+
referenceUserIds?: string[];
|
|
408
|
+
}
|
|
409
|
+
interface ApprovalSubmitResult {
|
|
410
|
+
documentId: string;
|
|
411
|
+
message: string;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
type PanelTab = 'processing' | 'approved' | 'rejected';
|
|
415
|
+
declare class MaApprovalPanelComponent implements OnInit, OnDestroy {
|
|
416
|
+
approvalActioned: EventEmitter<void>;
|
|
417
|
+
isOpen: boolean;
|
|
418
|
+
loading: boolean;
|
|
419
|
+
activeTab: PanelTab;
|
|
420
|
+
processingItems: ApprovalDocumentSummaryDto[];
|
|
421
|
+
approvedItems: ApprovalDocumentSummaryDto[];
|
|
422
|
+
rejectedItems: ApprovalDocumentSummaryDto[];
|
|
423
|
+
private destroy$;
|
|
424
|
+
private mesAuth;
|
|
425
|
+
private http;
|
|
426
|
+
private router;
|
|
427
|
+
private approvalSvc;
|
|
428
|
+
ngOnInit(): void;
|
|
429
|
+
ngOnDestroy(): void;
|
|
430
|
+
open(): void;
|
|
431
|
+
close(): void;
|
|
432
|
+
toggle(): void;
|
|
433
|
+
switchTab(tab: PanelTab): void;
|
|
434
|
+
private loadAllTabs;
|
|
435
|
+
private loadCurrentTab;
|
|
436
|
+
navigateToDetail(id: string): void;
|
|
437
|
+
showMore(status: 'approved' | 'rejected'): void;
|
|
438
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MaApprovalPanelComponent, never>;
|
|
439
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MaApprovalPanelComponent, "ma-approval-panel", never, {}, { "approvalActioned": "approvalActioned"; }, never, never, true, never>;
|
|
222
440
|
}
|
|
223
441
|
|
|
224
442
|
declare class MaUserComponent implements AfterViewInit {
|
|
225
443
|
userProfile?: UserProfileComponent;
|
|
444
|
+
approvalPanel: MaApprovalPanelComponent;
|
|
226
445
|
ngAfterViewInit(): void;
|
|
227
446
|
onNotificationRead(): void;
|
|
447
|
+
onApprovalActioned(): void;
|
|
228
448
|
static ɵfac: i0.ɵɵFactoryDeclaration<MaUserComponent, never>;
|
|
229
449
|
static ɵcmp: i0.ɵɵComponentDeclaration<MaUserComponent, "ma-user", never, {}, {}, never, never, true, never>;
|
|
230
450
|
}
|
|
@@ -284,6 +504,7 @@ declare class NotificationPanelComponent implements OnInit, OnDestroy {
|
|
|
284
504
|
get currentNotifications(): NotificationDto[];
|
|
285
505
|
selectedNotification: NotificationDto | null;
|
|
286
506
|
selectedNotificationHtml: SafeHtml | null;
|
|
507
|
+
selectedNotificationUrl: SafeResourceUrl | null;
|
|
287
508
|
selectedNotificationDate: string;
|
|
288
509
|
getNotificationMessage(notification: NotificationDto): string;
|
|
289
510
|
typeOf(notification: {
|
|
@@ -330,5 +551,84 @@ declare class ToastContainerComponent implements OnInit, OnDestroy {
|
|
|
330
551
|
static ɵcmp: i0.ɵɵComponentDeclaration<ToastContainerComponent, "ma-toast-container", never, {}, {}, never, never, true, never>;
|
|
331
552
|
}
|
|
332
553
|
|
|
333
|
-
|
|
334
|
-
|
|
554
|
+
declare class MaApprovalService {
|
|
555
|
+
private apiBase;
|
|
556
|
+
private http;
|
|
557
|
+
private config;
|
|
558
|
+
constructor();
|
|
559
|
+
init(config: MesAuthConfig, httpClient: HttpClient): void;
|
|
560
|
+
private get opts();
|
|
561
|
+
getDashboard(): Observable<ApprovalDashboardDto>;
|
|
562
|
+
getPendingApprovals(page?: number, pageSize?: number): Observable<PagedList<ApprovalDocumentSummaryDto>>;
|
|
563
|
+
getMyRequests(page?: number, pageSize?: number, status?: ApprovalDocumentStatus): Observable<PagedList<ApprovalDocumentSummaryDto>>;
|
|
564
|
+
getDocument(id: string): Observable<ApprovalDocumentDto>;
|
|
565
|
+
getDocumentHistory(id: string): Observable<ApprovalHistoryDto[]>;
|
|
566
|
+
getDocumentContentUrl(id: string): string;
|
|
567
|
+
getDocumentThumbnailUrl(id: string): string;
|
|
568
|
+
approve(documentId: string, comment?: string): Observable<void>;
|
|
569
|
+
reject(documentId: string, comment: string): Observable<void>;
|
|
570
|
+
delegate(documentId: string, toUserId: string, reason?: string): Observable<void>;
|
|
571
|
+
cancel(documentId: string, reason?: string): Observable<void>;
|
|
572
|
+
getTemplates(appId?: string): Observable<ApprovalTemplateSummaryDto[]>;
|
|
573
|
+
getTemplate(id: number): Observable<ApprovalTemplateDto>;
|
|
574
|
+
createTemplate(request: CreateApprovalTemplateRequest): Observable<ApprovalTemplateDto>;
|
|
575
|
+
updateTemplate(id: number, request: UpdateApprovalTemplateRequest): Observable<ApprovalTemplateDto>;
|
|
576
|
+
deleteTemplate(id: number): Observable<void>;
|
|
577
|
+
createApproval(request: CreateApprovalRequest): Observable<CreateApprovalResponseDto>;
|
|
578
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MaApprovalService, never>;
|
|
579
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MaApprovalService>;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
declare class MaArvContainerComponent implements OnInit, OnDestroy {
|
|
583
|
+
title: string;
|
|
584
|
+
description?: string;
|
|
585
|
+
referenceId: string;
|
|
586
|
+
templateId?: number;
|
|
587
|
+
callbackUrl?: string;
|
|
588
|
+
deadlineHours?: number;
|
|
589
|
+
approvalSubmitted: EventEmitter<ApprovalSubmitResult>;
|
|
590
|
+
approvalSubmiting: EventEmitter<void>;
|
|
591
|
+
cancelled: EventEmitter<void>;
|
|
592
|
+
contentBody: ElementRef<HTMLElement>;
|
|
593
|
+
routingMode: 'template' | 'adhoc';
|
|
594
|
+
templates: ApprovalTemplateSummaryDto[];
|
|
595
|
+
selectedTemplateId: number | null;
|
|
596
|
+
adHocSteps: ApprovalStepRequest[];
|
|
597
|
+
referenceUserIds: string[];
|
|
598
|
+
refSearchQuery: string;
|
|
599
|
+
refSearchResults: any[];
|
|
600
|
+
userSearchQuery: string[];
|
|
601
|
+
userSearchResults: any[][];
|
|
602
|
+
submitting: boolean;
|
|
603
|
+
isSubmitted: boolean;
|
|
604
|
+
errorMessage: string;
|
|
605
|
+
userLabelMap: Record<string, string>;
|
|
606
|
+
private destroy$;
|
|
607
|
+
private mesAuth;
|
|
608
|
+
private approvalSvc;
|
|
609
|
+
private http;
|
|
610
|
+
ngOnInit(): void;
|
|
611
|
+
ngOnDestroy(): void;
|
|
612
|
+
private loadTemplates;
|
|
613
|
+
onTemplateChange(event: Event): void;
|
|
614
|
+
addStep(): void;
|
|
615
|
+
removeStep(i: number): void;
|
|
616
|
+
addApprover(stepIndex: number, userId: string): void;
|
|
617
|
+
removeApprover(stepIndex: number, approverIndex: number): void;
|
|
618
|
+
addReference(userId: string): void;
|
|
619
|
+
private storeLabelFromResults;
|
|
620
|
+
removeReference(j: number): void;
|
|
621
|
+
onUserSearchInput(stepIndex: number, query: string): void;
|
|
622
|
+
onRefSearchInput(query: string): void;
|
|
623
|
+
private searchUsers;
|
|
624
|
+
submit(): Promise<void>;
|
|
625
|
+
onCancel(): void;
|
|
626
|
+
captureContent(): Promise<string>;
|
|
627
|
+
private captureThumbnail;
|
|
628
|
+
private getStyleProperties;
|
|
629
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MaArvContainerComponent, never>;
|
|
630
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MaArvContainerComponent, "ma-arv-container", never, { "title": { "alias": "title"; "required": false; }; "description": { "alias": "description"; "required": false; }; "referenceId": { "alias": "referenceId"; "required": false; }; "templateId": { "alias": "templateId"; "required": false; }; "callbackUrl": { "alias": "callbackUrl"; "required": false; }; "deadlineHours": { "alias": "deadlineHours"; "required": false; }; }, { "approvalSubmitted": "approvalSubmitted"; "approvalSubmiting": "approvalSubmiting"; "cancelled": "cancelled"; }, never, ["*"], true, never>;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
export { ApprovalActionType, ApprovalDocumentStatus, ApprovalStepMode, ApprovalStepStatus, MES_AUTH_CONFIG, MaApprovalPanelComponent, MaApprovalService, MaArvContainerComponent, MaUserComponent, MesAuthModule, MesAuthService, NotificationBadgeComponent, NotificationPanelComponent, NotificationType, ThemeService, ToastContainerComponent, ToastService, UserProfileComponent, mesAuthInterceptor, provideMesAuth };
|
|
634
|
+
export type { ApprovalDashboardDto, ApprovalDocumentDto, ApprovalDocumentSummaryDto, ApprovalHistoryDto, ApprovalReferenceDto, ApprovalStepDto, ApprovalStepRequest, ApprovalSubmitResult, ApprovalTemplateDto, ApprovalTemplateStepDto, ApprovalTemplateSummaryDto, ApproveRejectRequest, CreateApprovalRequest, CreateApprovalResponseDto, CreateApprovalTemplateRequest, DelegateRequest, FrontEndRoute, IUser, MesAuthConfig, NotificationDto, PagedList, RealTimeNotificationDto, Theme, Toast, UpdateApprovalTemplateRequest, UserFrontEndRoutesGrouped };
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mesauth-angular",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.6",
|
|
4
4
|
"description": "Angular helper library to connect to a backend API and SignalR hub to surface the current logged-in user and incoming notifications with dark/light theme support",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
7
7
|
"signalr",
|
|
8
8
|
"notifications",
|
|
9
9
|
"auth",
|
|
10
|
+
"approval",
|
|
10
11
|
"mes"
|
|
11
12
|
],
|
|
12
13
|
"license": "MIT",
|