@servicemind.tis/tis-image-and-file-upload-and-view 1.2.24 → 1.2.25
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/fesm2022/servicemind.tis-tis-image-and-file-upload-and-view.mjs +141 -16
- package/fesm2022/servicemind.tis-tis-image-and-file-upload-and-view.mjs.map +1 -1
- package/lib/interfaces/socket-adapter.interface.d.ts +8 -1
- package/lib/services/tis-remote-upload.service.d.ts +12 -3
- package/lib/tis-qr-code-dialog/tis-qr-code-dialog.component.d.ts +15 -0
- package/package.json +1 -1
|
@@ -65,12 +65,19 @@ export interface TisSocketAdapter {
|
|
|
65
65
|
getUserId?(): string | Promise<string>;
|
|
66
66
|
/**
|
|
67
67
|
* Send a message directly via socket (for handshake and communication)
|
|
68
|
-
* @param message - The message to send { action: string
|
|
68
|
+
* @param message - The message to send { action: string; data: any }
|
|
69
69
|
*/
|
|
70
70
|
sendViaSocket?(message: {
|
|
71
71
|
action: string;
|
|
72
72
|
data: any;
|
|
73
73
|
}): void;
|
|
74
|
+
/**
|
|
75
|
+
* Call API via socket and get response as Observable
|
|
76
|
+
* @param route - The API route to call
|
|
77
|
+
* @param body - The request body
|
|
78
|
+
* @returns Observable that emits the API response
|
|
79
|
+
*/
|
|
80
|
+
callApiViaSocket?(route: string, body: any): Observable<any>;
|
|
74
81
|
}
|
|
75
82
|
/**
|
|
76
83
|
* Configuration for remote upload feature
|
|
@@ -88,7 +88,7 @@ export declare class TisRemoteUploadService implements OnDestroy {
|
|
|
88
88
|
*/
|
|
89
89
|
private buildQrUrl;
|
|
90
90
|
/**
|
|
91
|
-
* Send message to mobile device
|
|
91
|
+
* Send message to mobile device via channel
|
|
92
92
|
*/
|
|
93
93
|
sendToMobile(type: string, data: any): void;
|
|
94
94
|
/**
|
|
@@ -96,9 +96,13 @@ export declare class TisRemoteUploadService implements OnDestroy {
|
|
|
96
96
|
*/
|
|
97
97
|
private acceptMobileConnection;
|
|
98
98
|
/**
|
|
99
|
-
* Disconnect from mobile device
|
|
99
|
+
* Disconnect from mobile device - call API and clear local state
|
|
100
100
|
*/
|
|
101
|
-
disconnect(): void
|
|
101
|
+
disconnect(): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Handle disconnect initiated from remote (mobile) side
|
|
104
|
+
*/
|
|
105
|
+
private handleRemoteDisconnect;
|
|
102
106
|
/**
|
|
103
107
|
* Subscribe to channel for receiving messages from mobile
|
|
104
108
|
*/
|
|
@@ -107,6 +111,11 @@ export declare class TisRemoteUploadService implements OnDestroy {
|
|
|
107
111
|
* Handle incoming channel messages from mobile
|
|
108
112
|
*/
|
|
109
113
|
private handleChannelMessage;
|
|
114
|
+
/**
|
|
115
|
+
* Handle mobile-link-established message
|
|
116
|
+
* This is sent when mobile successfully connects via the backend
|
|
117
|
+
*/
|
|
118
|
+
private handleMobileLinkEstablished;
|
|
110
119
|
/**
|
|
111
120
|
* Handle connection state messages from mobile
|
|
112
121
|
*/
|
|
@@ -3,12 +3,23 @@ import { MatDialogRef } from '@angular/material/dialog';
|
|
|
3
3
|
import { TisRemoteUploadService } from '../services/tis-remote-upload.service';
|
|
4
4
|
import { TisRemoteUploadEvent } from '../interfaces/socket-adapter.interface';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
+
export interface FieldInfo {
|
|
7
|
+
label?: string;
|
|
8
|
+
accept?: string;
|
|
9
|
+
type?: 'image' | 'file';
|
|
10
|
+
entityType?: string;
|
|
11
|
+
entityId?: any;
|
|
12
|
+
isMultiple?: boolean;
|
|
13
|
+
limit?: number;
|
|
14
|
+
isCompressed?: boolean;
|
|
15
|
+
}
|
|
6
16
|
export interface TisQrCodeDialogData {
|
|
7
17
|
title?: string;
|
|
8
18
|
subtitle?: string;
|
|
9
19
|
qrSize?: number;
|
|
10
20
|
showCountdown?: boolean;
|
|
11
21
|
autoCloseOnUpload?: boolean;
|
|
22
|
+
fieldInfo?: FieldInfo;
|
|
12
23
|
}
|
|
13
24
|
export declare class TisQrCodeDialogComponent implements OnInit, OnDestroy {
|
|
14
25
|
dialogRef: MatDialogRef<TisQrCodeDialogComponent>;
|
|
@@ -36,6 +47,10 @@ export declare class TisQrCodeDialogComponent implements OnInit, OnDestroy {
|
|
|
36
47
|
private checkExistingConnection;
|
|
37
48
|
private generateQrCode;
|
|
38
49
|
private subscribeToEvents;
|
|
50
|
+
/**
|
|
51
|
+
* Send field configuration to mobile device
|
|
52
|
+
*/
|
|
53
|
+
private sendFieldInfoToMobile;
|
|
39
54
|
private startCountdown;
|
|
40
55
|
/**
|
|
41
56
|
* Format device ID for display
|