@noatgnu/cupcake-core 1.2.17 → 1.3.1

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { InjectionToken, OnInit, ModuleWithProviders } from '@angular/core';
2
+ import { InjectionToken, OnDestroy, OnInit, ModuleWithProviders } from '@angular/core';
3
3
  import * as rxjs from 'rxjs';
4
4
  import { Observable, Subject, BehaviorSubject } from 'rxjs';
5
5
  import * as i3 from '@angular/common/http';
@@ -545,6 +545,145 @@ interface ConnectionEstablishedNotification {
545
545
  }
546
546
  type WebSocketNotification = TranscriptionStartedNotification | TranscriptionCompletedNotification | TranscriptionFailedNotification | SystemNotification | AsyncTaskUpdateNotification | MetadataTableUpdateNotification | LabGroupUpdateNotification | ConnectionEstablishedNotification;
547
547
 
548
+ declare enum TaskStatus {
549
+ QUEUED = "QUEUED",
550
+ STARTED = "STARTED",
551
+ SUCCESS = "SUCCESS",
552
+ FAILURE = "FAILURE",
553
+ CANCELLED = "CANCELLED"
554
+ }
555
+ declare enum TaskType {
556
+ EXPORT_EXCEL = "EXPORT_EXCEL",
557
+ EXPORT_SDRF = "EXPORT_SDRF",
558
+ IMPORT_SDRF = "IMPORT_SDRF",
559
+ IMPORT_EXCEL = "IMPORT_EXCEL",
560
+ EXPORT_MULTIPLE_SDRF = "EXPORT_MULTIPLE_SDRF",
561
+ EXPORT_MULTIPLE_EXCEL = "EXPORT_MULTIPLE_EXCEL",
562
+ VALIDATE_TABLE = "VALIDATE_TABLE",
563
+ REORDER_TABLE_COLUMNS = "REORDER_TABLE_COLUMNS",
564
+ REORDER_TEMPLATE_COLUMNS = "REORDER_TEMPLATE_COLUMNS",
565
+ TRANSCRIBE_AUDIO = "TRANSCRIBE_AUDIO",
566
+ TRANSCRIBE_VIDEO = "TRANSCRIBE_VIDEO"
567
+ }
568
+ interface AsyncTaskStatus {
569
+ id: string;
570
+ taskType: TaskType;
571
+ status: TaskStatus;
572
+ user: number;
573
+ userUsername?: string;
574
+ metadataTable?: number;
575
+ metadataTableName?: string;
576
+ taskTypeDisplay?: string;
577
+ statusDisplay?: string;
578
+ parameters?: any;
579
+ result?: any;
580
+ errorMessage?: string;
581
+ traceback?: string;
582
+ createdAt: string;
583
+ startedAt?: string;
584
+ completedAt?: string;
585
+ rqJobId?: string;
586
+ queueName?: string;
587
+ progressCurrent?: number;
588
+ progressTotal?: number;
589
+ progressDescription?: string;
590
+ duration?: number;
591
+ progressPercentage?: number;
592
+ }
593
+ interface TaskListItem {
594
+ id: string;
595
+ taskType: TaskType;
596
+ taskTypeDisplay: string;
597
+ status: TaskStatus;
598
+ statusDisplay: string;
599
+ user: number;
600
+ userUsername: string;
601
+ metadataTable: number | null;
602
+ metadataTableName: string | null;
603
+ progressPercentage: number;
604
+ progressDescription: string;
605
+ createdAt: string;
606
+ startedAt: string | null;
607
+ completedAt: string | null;
608
+ duration: number | null;
609
+ errorMessage: string | null;
610
+ }
611
+ interface TaskResult {
612
+ id: number;
613
+ task: string;
614
+ file?: string;
615
+ fileName?: string;
616
+ contentType?: string;
617
+ fileSize?: number;
618
+ expiresAt: string;
619
+ downloadCount?: number;
620
+ lastDownloadedAt?: string;
621
+ createdAt: string;
622
+ }
623
+ interface MetadataExportRequest {
624
+ metadataTableId: number;
625
+ includePools?: boolean;
626
+ metadataColumnIds?: number[];
627
+ sampleNumber?: number;
628
+ exportFormat?: string;
629
+ labGroupIds?: number[];
630
+ }
631
+ interface BulkExportRequest {
632
+ metadataTableIds: number[];
633
+ includePools?: boolean;
634
+ validateSdrf?: boolean;
635
+ }
636
+ interface BulkExcelExportRequest extends BulkExportRequest {
637
+ metadataColumnIds?: number[];
638
+ labGroupIds?: number[];
639
+ }
640
+ interface MetadataImportRequest {
641
+ metadataTableId: number;
642
+ file: File;
643
+ replaceExisting?: boolean;
644
+ validateOntologies?: boolean;
645
+ }
646
+ interface ChunkedImportRequest {
647
+ metadataTableId: number;
648
+ chunkedUploadId: string;
649
+ replaceExisting?: boolean;
650
+ validateOntologies?: boolean;
651
+ createPools?: boolean;
652
+ }
653
+ interface MetadataValidationRequest {
654
+ metadataTableId: number;
655
+ validateSdrfFormat?: boolean;
656
+ includePools?: boolean;
657
+ }
658
+ interface MetadataValidationConfig {
659
+ metadataTableId: number;
660
+ metadataTableName: string;
661
+ }
662
+ interface AsyncTaskCreateResponse {
663
+ taskId: string;
664
+ message: string;
665
+ }
666
+ interface DownloadUrlResponse {
667
+ downloadUrl: string;
668
+ filename: string;
669
+ contentType: string;
670
+ fileSize: number;
671
+ expiresAt: string;
672
+ expiresInHours: number;
673
+ }
674
+ interface AsyncTaskQueryParams {
675
+ taskType?: string;
676
+ status?: string;
677
+ metadataTable?: number;
678
+ search?: string;
679
+ limit?: number;
680
+ offset?: number;
681
+ ordering?: string;
682
+ }
683
+ declare const TASK_TYPE_LABELS: Record<TaskType, string>;
684
+ declare const TASK_STATUS_LABELS: Record<TaskStatus, string>;
685
+ declare const TASK_STATUS_COLORS: Record<TaskStatus, string>;
686
+
548
687
  interface CupcakeCoreConfig {
549
688
  apiUrl: string;
550
689
  }
@@ -851,6 +990,22 @@ declare class BaseApiService {
851
990
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<BaseApiService>;
852
991
  }
853
992
 
993
+ declare class AsyncTaskMonitorService extends BaseApiService implements OnDestroy {
994
+ private destroy$;
995
+ private tasksSubject;
996
+ private isSubscribed;
997
+ private websocket;
998
+ tasks$: Observable<AsyncTaskStatus[]>;
999
+ activeTasks$: Observable<AsyncTaskStatus[]>;
1000
+ ngOnDestroy(): void;
1001
+ startRealtimeUpdates(): void;
1002
+ stopRealtimeUpdates(): void;
1003
+ loadAllTasks(): void;
1004
+ private handleTaskUpdate;
1005
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AsyncTaskMonitorService, never>;
1006
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<AsyncTaskMonitorService>;
1007
+ }
1008
+
854
1009
  interface ToastMessage {
855
1010
  id: string;
856
1011
  message: string;
@@ -1081,11 +1236,6 @@ declare const WEBSOCKET_ENDPOINTS: InjectionToken<WebSocketEndpointConfig[]>;
1081
1236
  declare class WebSocketEndpoints {
1082
1237
  static readonly CORE_NOTIFICATIONS = "notifications";
1083
1238
  static readonly CORE_ADMIN = "admin";
1084
- static readonly CCV_NOTIFICATIONS = "ccv/notifications";
1085
- static readonly CCV_ADMIN = "ccv/admin";
1086
- static readonly CCM_NOTIFICATIONS = "ccm/notifications";
1087
- static readonly CCRV_NOTIFICATIONS = "ccrv/notifications";
1088
- static readonly CCSC_NOTIFICATIONS = "ccsc/notifications";
1089
1239
  }
1090
1240
  declare class WebSocketConfigService {
1091
1241
  private readonly endpoints;
@@ -1544,5 +1694,5 @@ declare class CupcakeCoreModule {
1544
1694
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<CupcakeCoreModule>;
1545
1695
  }
1546
1696
 
1547
- export { AnnotationType, ApiService, AuthService, BaseApiService, CUPCAKE_CORE_CONFIG, CupcakeCoreModule, InvitationStatus, InvitationStatusLabels, LabGroupService, LabGroupsComponent, LoginComponent, NotificationService, PoweredByFooterComponent, RegisterComponent, ResourceRole, ResourceRoleLabels, ResourceService, ResourceType, ResourceTypeLabels, ResourceVisibility, ResourceVisibilityLabels, SiteConfigComponent, SiteConfigService, ThemeService, ToastContainerComponent, ToastService, UserManagementComponent, UserManagementService, UserProfileComponent, WEBSOCKET_ENDPOINT, WEBSOCKET_ENDPOINTS, WebSocketConfigService, WebSocketEndpoints, WebSocketService, adminGuard, authGuard, authInterceptor, resetRefreshState };
1548
- export type { AccountMergeRequest, AdminPasswordResetRequest, Annotation, AnnotationCreateRequest, AnnotationFolder, AnnotationFolderCreateRequest, AnnotationFolderUpdateRequest, AnnotationUpdateRequest, ApiResponse, AsyncTaskUpdateNotification, AuthConfig, AuthResponse, AuthStatus, BaseNotification, BaseResource, BaseTimestampedModel, BulkPermissionRequest, ConnectionEstablishedNotification, CupcakeCoreConfig, EmailChangeConfirmRequest, EmailChangeConfirmResponse, EmailChangeRequest, InvitationResponseRequest, LabGroup, LabGroupCreateRequest, LabGroupInvitation, LabGroupInvitationCreateRequest, LabGroupInvitationQueryParams, LabGroupInvitationQueryResponse, LabGroupInviteRequest, LabGroupMember, LabGroupPathItem, LabGroupPermission, LabGroupPermissionCreateRequest, LabGroupPermissionQueryParams, LabGroupPermissionQueryResponse, LabGroupPermissionUpdateRequest, LabGroupQueryParams, LabGroupQueryResponse, LabGroupUpdateNotification, LabGroupUpdateRequest, MetadataTableUpdateNotification, NotificationAction, NotificationItem, PaginatedResponse, PasswordChangeRequest, PasswordChangeResponse, PasswordResetConfirmRequest, PasswordResetRequest, RegistrationStatus, RemoteHost, RemoteHostCreateRequest, RemoteHostUpdateRequest, ResourcePermission, ResourcePermissionCreateRequest, ResourcePermissionUpdateRequest, ResourceQueryParams, SiteConfig, SiteConfigUpdateRequest, SystemNotification, Theme, ToastMessage, TranscriptionCompletedNotification, TranscriptionFailedNotification, TranscriptionStartedNotification, User, UserCreateRequest, UserListResponse, UserOrcidProfile, UserProfileUpdateRequest, UserRegistrationRequest, UserResponse, WebSocketConfig, WebSocketEndpointConfig, WebSocketMessage, WebSocketNotification };
1697
+ export { AnnotationType, ApiService, AsyncTaskMonitorService, AuthService, BaseApiService, CUPCAKE_CORE_CONFIG, CupcakeCoreModule, InvitationStatus, InvitationStatusLabels, LabGroupService, LabGroupsComponent, LoginComponent, NotificationService, PoweredByFooterComponent, RegisterComponent, ResourceRole, ResourceRoleLabels, ResourceService, ResourceType, ResourceTypeLabels, ResourceVisibility, ResourceVisibilityLabels, SiteConfigComponent, SiteConfigService, TASK_STATUS_COLORS, TASK_STATUS_LABELS, TASK_TYPE_LABELS, TaskStatus, TaskType, ThemeService, ToastContainerComponent, ToastService, UserManagementComponent, UserManagementService, UserProfileComponent, WEBSOCKET_ENDPOINT, WEBSOCKET_ENDPOINTS, WebSocketConfigService, WebSocketEndpoints, WebSocketService, adminGuard, authGuard, authInterceptor, resetRefreshState };
1698
+ export type { AccountMergeRequest, AdminPasswordResetRequest, Annotation, AnnotationCreateRequest, AnnotationFolder, AnnotationFolderCreateRequest, AnnotationFolderUpdateRequest, AnnotationUpdateRequest, ApiResponse, AsyncTaskCreateResponse, AsyncTaskQueryParams, AsyncTaskStatus, AsyncTaskUpdateNotification, AuthConfig, AuthResponse, AuthStatus, BaseNotification, BaseResource, BaseTimestampedModel, BulkExcelExportRequest, BulkExportRequest, BulkPermissionRequest, ChunkedImportRequest, ConnectionEstablishedNotification, CupcakeCoreConfig, DownloadUrlResponse, EmailChangeConfirmRequest, EmailChangeConfirmResponse, EmailChangeRequest, InvitationResponseRequest, LabGroup, LabGroupCreateRequest, LabGroupInvitation, LabGroupInvitationCreateRequest, LabGroupInvitationQueryParams, LabGroupInvitationQueryResponse, LabGroupInviteRequest, LabGroupMember, LabGroupPathItem, LabGroupPermission, LabGroupPermissionCreateRequest, LabGroupPermissionQueryParams, LabGroupPermissionQueryResponse, LabGroupPermissionUpdateRequest, LabGroupQueryParams, LabGroupQueryResponse, LabGroupUpdateNotification, LabGroupUpdateRequest, MetadataExportRequest, MetadataImportRequest, MetadataTableUpdateNotification, MetadataValidationConfig, MetadataValidationRequest, NotificationAction, NotificationItem, PaginatedResponse, PasswordChangeRequest, PasswordChangeResponse, PasswordResetConfirmRequest, PasswordResetRequest, RegistrationStatus, RemoteHost, RemoteHostCreateRequest, RemoteHostUpdateRequest, ResourcePermission, ResourcePermissionCreateRequest, ResourcePermissionUpdateRequest, ResourceQueryParams, SiteConfig, SiteConfigUpdateRequest, SystemNotification, TaskListItem, TaskResult, Theme, ToastMessage, TranscriptionCompletedNotification, TranscriptionFailedNotification, TranscriptionStartedNotification, User, UserCreateRequest, UserListResponse, UserOrcidProfile, UserProfileUpdateRequest, UserRegistrationRequest, UserResponse, WebSocketConfig, WebSocketEndpointConfig, WebSocketMessage, WebSocketNotification };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noatgnu/cupcake-core",
3
- "version": "1.2.17",
3
+ "version": "1.3.1",
4
4
  "description": "A reusable Angular library that provides user management, authentication, and site configuration functionality for cupcake applications.",
5
5
  "keywords": [
6
6
  "angular",