@servicemind.tis/tis-image-and-file-upload-and-view 1.2.29 → 1.2.31

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.
@@ -103,6 +103,12 @@ export interface TisRemoteUploadConfig {
103
103
  * Pairing configuration
104
104
  */
105
105
  pairing?: TisPairingConfig;
106
+ /**
107
+ * Callback when user accepts a file from mobile upload
108
+ * This allows the host app to handle the accepted file (e.g., patch a form)
109
+ * @param file - The accepted file data
110
+ */
111
+ onFileAccept?: (file: TisRemoteUploadedFile) => void;
106
112
  }
107
113
  /**
108
114
  * API endpoints configuration for remote upload
@@ -11,12 +11,47 @@ interface MobileConnectionInfo {
11
11
  connectedAt: number;
12
12
  lastActivity: number;
13
13
  }
14
+ /**
15
+ * Field request info for tracking current upload request
16
+ */
17
+ export interface FieldRequestInfo {
18
+ label: string;
19
+ accept: string;
20
+ type: 'image' | 'file';
21
+ entityType?: string;
22
+ entityId?: any;
23
+ isMultiple?: boolean;
24
+ limit?: number;
25
+ remainingSlots?: number;
26
+ isCompressed?: boolean;
27
+ requestId?: string;
28
+ requestedAt: number;
29
+ }
30
+ /**
31
+ * Device online status from health check API
32
+ */
33
+ export interface DeviceOnlineStatus {
34
+ isOnline: boolean;
35
+ deviceId: string;
36
+ lastPing?: number;
37
+ connectionId?: string;
38
+ }
39
+ /**
40
+ * Combined device status for both desktop and mobile
41
+ */
42
+ export interface DevicesOnlineStatus {
43
+ desktop: DeviceOnlineStatus;
44
+ mobile: DeviceOnlineStatus;
45
+ lastChecked: number;
46
+ isReadyForTransfer: boolean;
47
+ }
14
48
  export declare class TisRemoteUploadService implements OnDestroy {
15
49
  private http;
16
50
  private static readonly COMPONENT;
17
51
  private static readonly MOBILE_CONNECTION_KEY;
18
52
  private destroy$;
19
53
  private channelSubscription;
54
+ private healthCheckSubscription;
20
55
  private config;
21
56
  private socketAdapter;
22
57
  private deviceId;
@@ -28,6 +63,11 @@ export declare class TisRemoteUploadService implements OnDestroy {
28
63
  private mobileConnection$;
29
64
  private remoteUpload$;
30
65
  private error$;
66
+ private pendingFiles$;
67
+ private isWaitingForUpload$;
68
+ private currentFieldRequest$;
69
+ private devicesStatus$;
70
+ private isCheckingStatus$;
31
71
  constructor(http: HttpClient);
32
72
  /**
33
73
  * Configure the remote upload service
@@ -73,6 +113,50 @@ export declare class TisRemoteUploadService implements OnDestroy {
73
113
  * Alias for isConnectedToMobile - Check if paired with mobile
74
114
  */
75
115
  isPaired(): boolean;
116
+ /**
117
+ * Get devices online status (both desktop and mobile)
118
+ */
119
+ getDevicesStatus(): Observable<DevicesOnlineStatus | null>;
120
+ /**
121
+ * Get current devices status value
122
+ */
123
+ getDevicesStatusValue(): DevicesOnlineStatus | null;
124
+ /**
125
+ * Check if currently verifying connection status (for blinking indicator)
126
+ */
127
+ getIsCheckingStatus(): Observable<boolean>;
128
+ /**
129
+ * Check if both devices are online and ready for transfer
130
+ */
131
+ isReadyForTransfer(): boolean;
132
+ /**
133
+ * Get pending files from mobile (waiting to be accepted/rejected)
134
+ */
135
+ getPendingFiles(): Observable<TisRemoteUploadEvent[]>;
136
+ /**
137
+ * Get current pending files value
138
+ */
139
+ getPendingFilesValue(): TisRemoteUploadEvent[];
140
+ /**
141
+ * Check if waiting for mobile upload
142
+ */
143
+ getIsWaitingForUpload(): Observable<boolean>;
144
+ /**
145
+ * Get current field request info
146
+ */
147
+ getCurrentFieldRequest(): Observable<FieldRequestInfo | null>;
148
+ /**
149
+ * Accept a pending file (emit to remoteUpload$ and call onFileAccept callback)
150
+ */
151
+ acceptPendingFile(file: TisRemoteUploadEvent): void;
152
+ /**
153
+ * Reject/delete a pending file
154
+ */
155
+ rejectPendingFile(file: TisRemoteUploadEvent): void;
156
+ /**
157
+ * Clear all pending files
158
+ */
159
+ clearPendingFiles(): void;
76
160
  /**
77
161
  * Generate QR code data for mobile app
78
162
  * Flow:
@@ -122,6 +206,23 @@ export declare class TisRemoteUploadService implements OnDestroy {
122
206
  * Handle disconnect initiated from remote (mobile) side
123
207
  */
124
208
  private handleRemoteDisconnect;
209
+ /**
210
+ * Start periodic health check for device online status
211
+ * Should be called when connection is established
212
+ */
213
+ startHealthCheck(): void;
214
+ /**
215
+ * Stop health check
216
+ */
217
+ stopHealthCheck(): void;
218
+ /**
219
+ * Check if both devices are online via API
220
+ */
221
+ checkDevicesOnline(): Promise<DevicesOnlineStatus | null>;
222
+ /**
223
+ * Force an immediate health check
224
+ */
225
+ refreshDevicesStatus(): Promise<DevicesOnlineStatus | null>;
125
226
  /**
126
227
  * Subscribe to channel for receiving messages from mobile
127
228
  */
@@ -141,6 +242,7 @@ export declare class TisRemoteUploadService implements OnDestroy {
141
242
  private handleConnectionState;
142
243
  /**
143
244
  * Handle upload complete from mobile
245
+ * Files are added to pending queue for user to accept/reject
144
246
  */
145
247
  private handleUploadComplete;
146
248
  /**
@@ -52,6 +52,7 @@ export declare class TisImageAndFileUploadAndViewComponent implements OnDestroy
52
52
  isTab: boolean;
53
53
  isWaitingForMobileUpload: boolean;
54
54
  mobileUploadFieldLabel: string;
55
+ pendingFiles: TisRemoteUploadEvent[];
55
56
  isHandset$: Observable<boolean>;
56
57
  isTab$: Observable<boolean>;
57
58
  config: Config;
@@ -149,6 +150,23 @@ export declare class TisImageAndFileUploadAndViewComponent implements OnDestroy
149
150
  * Cancel waiting for mobile upload
150
151
  */
151
152
  cancelMobileUpload(): Promise<void>;
153
+ /**
154
+ * Accept a pending file from mobile upload
155
+ * This calls the onFileAccept callback if provided, then handles the file
156
+ */
157
+ acceptPendingFile(pendingFile: TisRemoteUploadEvent): void;
158
+ /**
159
+ * Reject a pending file from mobile upload
160
+ */
161
+ rejectPendingFile(pendingFile: TisRemoteUploadEvent): void;
162
+ /**
163
+ * Open dialog showing connection status with disconnect option
164
+ */
165
+ openViewConnectionDialog(): void;
166
+ /**
167
+ * Check if a MIME type is an image type
168
+ */
169
+ isImageMimeType(mimeType: string | undefined): boolean;
152
170
  ngOnDestroy(): void;
153
171
  static ɵfac: i0.ɵɵFactoryDeclaration<TisImageAndFileUploadAndViewComponent, never>;
154
172
  static ɵcmp: i0.ɵɵComponentDeclaration<TisImageAndFileUploadAndViewComponent, "tis-image-and-file-upload-and-view", never, { "urlConfig": { "alias": "urlConfig"; "required": true; }; "entityType": { "alias": "entityType"; "required": false; }; "entityId": { "alias": "entityId"; "required": false; }; "viewType": { "alias": "viewType"; "required": false; }; "type": { "alias": "type"; "required": false; }; "label": { "alias": "label"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "data": { "alias": "data"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; "isValidateMimeType": { "alias": "isValidateMimeType"; "required": false; }; "selectedId": { "alias": "selectedId"; "required": false; }; "options": { "alias": "options"; "required": false; }; "required": { "alias": "required"; "required": false; }; "previewOnly": { "alias": "previewOnly"; "required": false; }; "previewInFlex": { "alias": "previewInFlex"; "required": false; }; "imageItemClass": { "alias": "imageItemClass"; "required": false; }; "isAddUploadedFileInLastNode": { "alias": "isAddUploadedFileInLastNode"; "required": false; }; "isEnableDeleteConfirmation": { "alias": "isEnableDeleteConfirmation"; "required": false; }; "isEnableCapture": { "alias": "isEnableCapture"; "required": false; }; "deleteConfirmationMsg": { "alias": "deleteConfirmationMsg"; "required": false; }; "dialogConfig": { "alias": "dialogConfig"; "required": false; }; "remoteUploadConfig": { "alias": "remoteUploadConfig"; "required": false; }; "isShowImageSequence": { "alias": "isShowImageSequence"; "required": false; }; "enableDragNDrop": { "alias": "enableDragNDrop"; "required": false; }; "showDeleteButtonWhenDisabled": { "alias": "showDeleteButtonWhenDisabled"; "required": false; }; }, { "uploadInProgress": "uploadInProgress"; "onUploaded": "onUploaded"; "onFileSelect": "onFileSelect"; "onFileRemoved": "onFileRemoved"; "onError": "onError"; "onRemoteUpload": "onRemoteUpload"; "dataSequenceChange": "dataSequenceChange"; }, never, never, false, never>;
@@ -8,21 +8,23 @@ import * as i6 from "./tis-file-viewer/tis-video/tis-video.component";
8
8
  import * as i7 from "./tis-error-dialog/tis-error-dialog.component";
9
9
  import * as i8 from "./tis-confirmation-dialog/tis-confirmation-dialog.component";
10
10
  import * as i9 from "./tis-qr-code-dialog/tis-qr-code-dialog.component";
11
- import * as i10 from "@angular/common";
12
- import * as i11 from "@angular/common/http";
13
- import * as i12 from "ngx-extended-pdf-viewer";
14
- import * as i13 from "@angular/forms";
15
- import * as i14 from "angularx-qrcode";
16
- import * as i15 from "@angular/material/tooltip";
17
- import * as i16 from "@angular/material/icon";
18
- import * as i17 from "@angular/material/snack-bar";
19
- import * as i18 from "@angular/material/progress-spinner";
20
- import * as i19 from "@angular/material/input";
21
- import * as i20 from "@angular/material/button";
22
- import * as i21 from "@angular/material/dialog";
23
- import * as i22 from "@angular/cdk/drag-drop";
11
+ import * as i10 from "./tis-view-connection-dialog/tis-view-connection-dialog.component";
12
+ import * as i11 from "@angular/common";
13
+ import * as i12 from "@angular/common/http";
14
+ import * as i13 from "ngx-extended-pdf-viewer";
15
+ import * as i14 from "@angular/forms";
16
+ import * as i15 from "angularx-qrcode";
17
+ import * as i16 from "@angular/material/tooltip";
18
+ import * as i17 from "@angular/material/icon";
19
+ import * as i18 from "@angular/material/snack-bar";
20
+ import * as i19 from "@angular/material/progress-spinner";
21
+ import * as i20 from "@angular/material/input";
22
+ import * as i21 from "@angular/material/button";
23
+ import * as i22 from "@angular/material/dialog";
24
+ import * as i23 from "@angular/material/divider";
25
+ import * as i24 from "@angular/cdk/drag-drop";
24
26
  export declare class TisImageAndFileUploadAndViewModule {
25
27
  static ɵfac: i0.ɵɵFactoryDeclaration<TisImageAndFileUploadAndViewModule, never>;
26
- static ɵmod: i0.ɵɵNgModuleDeclaration<TisImageAndFileUploadAndViewModule, [typeof i1.TisImageAndFileUploadAndViewComponent, typeof i2.TisPreviewImageComponent, typeof i3.TisFileViewerComponent, typeof i4.TisExcelFileViewerComponent, typeof i5.TisPdfViewerComponent, typeof i6.TisVideoComponent, typeof i7.TisErrorDialogComponent, typeof i8.TisConfirmationDialogComponent, typeof i9.TisQrCodeDialogComponent], [typeof i10.CommonModule, typeof i11.HttpClientModule, typeof i12.NgxExtendedPdfViewerModule, typeof i13.FormsModule, typeof i13.ReactiveFormsModule, typeof i14.QRCodeComponent, typeof i15.MatTooltipModule, typeof i16.MatIconModule, typeof i17.MatSnackBarModule, typeof i18.MatProgressSpinnerModule, typeof i19.MatInputModule, typeof i20.MatButtonModule, typeof i21.MatDialogModule, typeof i22.DragDropModule], [typeof i1.TisImageAndFileUploadAndViewComponent, typeof i9.TisQrCodeDialogComponent]>;
28
+ static ɵmod: i0.ɵɵNgModuleDeclaration<TisImageAndFileUploadAndViewModule, [typeof i1.TisImageAndFileUploadAndViewComponent, typeof i2.TisPreviewImageComponent, typeof i3.TisFileViewerComponent, typeof i4.TisExcelFileViewerComponent, typeof i5.TisPdfViewerComponent, typeof i6.TisVideoComponent, typeof i7.TisErrorDialogComponent, typeof i8.TisConfirmationDialogComponent, typeof i9.TisQrCodeDialogComponent, typeof i10.TisViewConnectionDialogComponent], [typeof i11.CommonModule, typeof i12.HttpClientModule, typeof i13.NgxExtendedPdfViewerModule, typeof i14.FormsModule, typeof i14.ReactiveFormsModule, typeof i15.QRCodeComponent, typeof i16.MatTooltipModule, typeof i17.MatIconModule, typeof i18.MatSnackBarModule, typeof i19.MatProgressSpinnerModule, typeof i20.MatInputModule, typeof i21.MatButtonModule, typeof i22.MatDialogModule, typeof i23.MatDividerModule, typeof i24.DragDropModule], [typeof i1.TisImageAndFileUploadAndViewComponent, typeof i9.TisQrCodeDialogComponent]>;
27
29
  static ɵinj: i0.ɵɵInjectorDeclaration<TisImageAndFileUploadAndViewModule>;
28
30
  }
@@ -1,7 +1,6 @@
1
1
  import { OnInit, OnDestroy } from '@angular/core';
2
2
  import { MatDialogRef } from '@angular/material/dialog';
3
- import { TisRemoteUploadService } from '../services/tis-remote-upload.service';
4
- import { TisRemoteUploadEvent } from '../interfaces/socket-adapter.interface';
3
+ import { TisRemoteUploadService, DevicesOnlineStatus } from '../services/tis-remote-upload.service';
5
4
  import * as i0 from "@angular/core";
6
5
  export interface FieldInfo {
7
6
  label?: string;
@@ -18,7 +17,6 @@ export interface TisQrCodeDialogData {
18
17
  subtitle?: string;
19
18
  qrSize?: number;
20
19
  showCountdown?: boolean;
21
- autoCloseOnUpload?: boolean;
22
20
  fieldInfo?: FieldInfo;
23
21
  }
24
22
  export declare class TisQrCodeDialogComponent implements OnInit, OnDestroy {
@@ -33,9 +31,10 @@ export declare class TisQrCodeDialogComponent implements OnInit, OnDestroy {
33
31
  isConnected: boolean;
34
32
  errorMessage: string | null;
35
33
  connectionStatus: 'disconnected' | 'pending' | 'connected';
36
- uploadedFiles: TisRemoteUploadEvent[];
37
34
  desktopDeviceId: string;
38
35
  mobileDeviceId: string | null;
36
+ devicesStatus: DevicesOnlineStatus | null;
37
+ isCheckingStatus: boolean;
39
38
  private destroy$;
40
39
  private countdownSubscription;
41
40
  constructor(dialogRef: MatDialogRef<TisQrCodeDialogComponent>, data: TisQrCodeDialogData, remoteUploadService: TisRemoteUploadService);
@@ -64,6 +63,24 @@ export declare class TisQrCodeDialogComponent implements OnInit, OnDestroy {
64
63
  * Disconnect from mobile
65
64
  */
66
65
  disconnect(): void;
66
+ /**
67
+ * Refresh device status
68
+ */
69
+ refreshStatus(): void;
70
+ /**
71
+ * Get desktop online status indicator class
72
+ * Returns: 'online' (green), 'offline' (red), 'checking' (blinking yellow)
73
+ */
74
+ getDesktopStatusClass(): string;
75
+ /**
76
+ * Get mobile online status indicator class
77
+ * Returns: 'online' (green), 'offline' (red), 'checking' (blinking yellow)
78
+ */
79
+ getMobileStatusClass(): string;
80
+ /**
81
+ * Check if ready for transfer (both devices online)
82
+ */
83
+ isReadyForTransfer(): boolean;
67
84
  /**
68
85
  * Close dialog
69
86
  */
@@ -0,0 +1,48 @@
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
+ import { MatDialogRef } from '@angular/material/dialog';
3
+ import { TisRemoteUploadService, DevicesOnlineStatus } from '../services/tis-remote-upload.service';
4
+ import * as i0 from "@angular/core";
5
+ interface MobileConnectionInfo {
6
+ mobileDeviceId: string;
7
+ connectedAt: number;
8
+ lastActivity: number;
9
+ }
10
+ export interface TisViewConnectionDialogData {
11
+ title?: string;
12
+ }
13
+ export declare class TisViewConnectionDialogComponent implements OnInit, OnDestroy {
14
+ dialogRef: MatDialogRef<TisViewConnectionDialogComponent>;
15
+ data: TisViewConnectionDialogData;
16
+ private remoteUploadService;
17
+ private destroy$;
18
+ mobileConnection: MobileConnectionInfo | null;
19
+ devicesStatus: DevicesOnlineStatus | null;
20
+ isCheckingStatus: boolean;
21
+ disconnecting: boolean;
22
+ constructor(dialogRef: MatDialogRef<TisViewConnectionDialogComponent>, data: TisViewConnectionDialogData, remoteUploadService: TisRemoteUploadService);
23
+ ngOnInit(): void;
24
+ ngOnDestroy(): void;
25
+ /**
26
+ * Refresh device online status
27
+ */
28
+ refreshStatus(): Promise<void>;
29
+ /**
30
+ * Disconnect from mobile device
31
+ */
32
+ disconnect(): Promise<void>;
33
+ /**
34
+ * Close dialog without disconnecting
35
+ */
36
+ close(): void;
37
+ /**
38
+ * Get formatted connection time
39
+ */
40
+ getConnectionDuration(): string;
41
+ /**
42
+ * Get last ping time formatted
43
+ */
44
+ getLastPing(timestamp: number | undefined): string;
45
+ static ɵfac: i0.ɵɵFactoryDeclaration<TisViewConnectionDialogComponent, never>;
46
+ static ɵcmp: i0.ɵɵComponentDeclaration<TisViewConnectionDialogComponent, "tis-view-connection-dialog", never, {}, {}, never, never, false, never>;
47
+ }
48
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicemind.tis/tis-image-and-file-upload-and-view",
3
- "version": "1.2.29",
3
+ "version": "1.2.31",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.2.0",
6
6
  "@angular/core": "^19.2.0",