@techextensor/tab-core-utility 2.2.180 → 2.2.184
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/esm2022/index.mjs +5 -1
- package/esm2022/lib/tab-core-utility/app/constants/api-constants.mjs +24 -13
- package/esm2022/lib/tab-core-utility/app/constants/common.mjs +14 -50
- package/esm2022/lib/tab-core-utility/app/constants/storage-constants.mjs +2 -2
- package/esm2022/lib/tab-core-utility/app/crud/tab-crud.service.mjs +38 -49
- package/esm2022/lib/tab-core-utility/app/crud/tab-delete.service.mjs +81 -30
- package/esm2022/lib/tab-core-utility/app/crud/tab-formio.service.mjs +141 -12
- package/esm2022/lib/tab-core-utility/app/crud/tab-get.service.mjs +136 -35
- package/esm2022/lib/tab-core-utility/app/crud/tab-insert.service.mjs +89 -38
- package/esm2022/lib/tab-core-utility/app/crud/tab-update.service.mjs +152 -131
- package/esm2022/lib/tab-core-utility/app/crud/tab-workflow.service.mjs +7 -9
- package/esm2022/lib/tab-core-utility/app/enums/query.enum.mjs +7 -7
- package/esm2022/lib/tab-core-utility/app/helpers/common/app.helpers.mjs +6 -17
- package/esm2022/lib/tab-core-utility/app/helpers/common/dsq.helpers.mjs +9 -11
- package/esm2022/lib/tab-core-utility/app/helpers/common/meta-data.helpers.mjs +13 -13
- package/esm2022/lib/tab-core-utility/app/helpers/common/req-res.helpers.mjs +7 -45
- package/esm2022/lib/tab-core-utility/app/helpers/common/where-clause.helpers.mjs +79 -76
- package/esm2022/lib/tab-core-utility/app/helpers/response.adapter.mjs +38 -0
- package/esm2022/lib/tab-core-utility/app/helpers/screen/grid.helpers.mjs +8 -4
- package/esm2022/lib/tab-core-utility/app/helpers/screen/screen.helpers.mjs +8 -33
- package/esm2022/lib/tab-core-utility/app/interfaces/common.interface.mjs +1 -1
- package/esm2022/lib/tab-core-utility/app/interfaces/signalr.interface.mjs +42 -0
- package/esm2022/lib/tab-core-utility/app/models/api-query.class.mjs +39 -1
- package/esm2022/lib/tab-core-utility/app/models/app-field.model.mjs +36 -7
- package/esm2022/lib/tab-core-utility/app/models/app-object.model.mjs +84 -47
- package/esm2022/lib/tab-core-utility/app/models/app-screen.model.mjs +24 -13
- package/esm2022/lib/tab-core-utility/app/models/data-source-query.model.mjs +57 -23
- package/esm2022/lib/tab-core-utility/app/models/filter.model.mjs +21 -10
- package/esm2022/lib/tab-core-utility/app/models/parameter.model.mjs +12 -6
- package/esm2022/lib/tab-core-utility/app/models/sort.model.mjs +11 -4
- package/esm2022/lib/tab-core-utility/app/utils/json.util.mjs +17 -16
- package/esm2022/lib/tab-core-utility/app/utils/req-res.util.mjs +1 -55
- package/esm2022/lib/tab-core-utility/app/utils/tab-app.util.mjs +1 -164
- package/esm2022/lib/tab-core-utility/core/http-client/api.service.mjs +64 -15
- package/esm2022/lib/tab-core-utility/core/service/signalr/operation-tracker.service.mjs +82 -0
- package/esm2022/lib/tab-core-utility/core/service/signalr/signalr-infrastructure.service.mjs +252 -0
- package/esm2022/lib/tab-core-utility/core/service/signalr/signalr.service.mjs +207 -0
- package/index.d.ts +4 -0
- package/lib/tab-core-utility/app/constants/api-constants.d.ts +13 -10
- package/lib/tab-core-utility/app/constants/common.d.ts +9 -0
- package/lib/tab-core-utility/app/constants/storage-constants.d.ts +1 -1
- package/lib/tab-core-utility/app/crud/tab-crud.service.d.ts +8 -1
- package/lib/tab-core-utility/app/crud/tab-delete.service.d.ts +20 -10
- package/lib/tab-core-utility/app/crud/tab-formio.service.d.ts +33 -6
- package/lib/tab-core-utility/app/crud/tab-get.service.d.ts +45 -3
- package/lib/tab-core-utility/app/crud/tab-insert.service.d.ts +16 -21
- package/lib/tab-core-utility/app/crud/tab-update.service.d.ts +34 -19
- package/lib/tab-core-utility/app/crud/tab-workflow.service.d.ts +3 -1
- package/lib/tab-core-utility/app/enums/query.enum.d.ts +3 -6
- package/lib/tab-core-utility/app/helpers/common/app.helpers.d.ts +3 -8
- package/lib/tab-core-utility/app/helpers/common/dsq.helpers.d.ts +3 -0
- package/lib/tab-core-utility/app/helpers/common/meta-data.helpers.d.ts +3 -3
- package/lib/tab-core-utility/app/helpers/common/req-res.helpers.d.ts +7 -51
- package/lib/tab-core-utility/app/helpers/common/where-clause.helpers.d.ts +1 -0
- package/lib/tab-core-utility/app/helpers/response.adapter.d.ts +22 -0
- package/lib/tab-core-utility/app/helpers/screen/grid.helpers.d.ts +2 -1
- package/lib/tab-core-utility/app/helpers/screen/screen.helpers.d.ts +1 -0
- package/lib/tab-core-utility/app/interfaces/common.interface.d.ts +50 -2
- package/lib/tab-core-utility/app/interfaces/signalr.interface.d.ts +80 -0
- package/lib/tab-core-utility/app/models/api-query.class.d.ts +54 -9
- package/lib/tab-core-utility/app/models/app-field.model.d.ts +4 -2
- package/lib/tab-core-utility/app/models/app-object.model.d.ts +5 -3
- package/lib/tab-core-utility/app/models/app-screen.model.d.ts +2 -2
- package/lib/tab-core-utility/app/models/data-source-query.model.d.ts +7 -2
- package/lib/tab-core-utility/app/models/filter.model.d.ts +2 -2
- package/lib/tab-core-utility/app/models/parameter.model.d.ts +2 -2
- package/lib/tab-core-utility/app/models/sort.model.d.ts +1 -1
- package/lib/tab-core-utility/app/utils/json.util.d.ts +3 -2
- package/lib/tab-core-utility/app/utils/req-res.util.d.ts +1 -9
- package/lib/tab-core-utility/app/utils/tab-app.util.d.ts +0 -61
- package/lib/tab-core-utility/core/http-client/api.service.d.ts +37 -9
- package/lib/tab-core-utility/core/service/signalr/operation-tracker.service.d.ts +40 -0
- package/lib/tab-core-utility/core/service/signalr/signalr-infrastructure.service.d.ts +68 -0
- package/lib/tab-core-utility/core/service/signalr/signalr.service.d.ts +122 -0
- package/package.json +3 -2
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { CrudNotification, NotificationCallback, PendingOperation } from '../../../app/interfaces/signalr.interface';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* SignalR Service
|
|
6
|
+
* Public API for:
|
|
7
|
+
* 1. Components to register for real-time CRUD notifications
|
|
8
|
+
* 2. Services (TabFormioService) to track async operations
|
|
9
|
+
*
|
|
10
|
+
* Usage in components:
|
|
11
|
+
* ```typescript
|
|
12
|
+
* ngOnInit() {
|
|
13
|
+
* this.signalRService.register(
|
|
14
|
+
* this.componentId,
|
|
15
|
+
* this.appObjectId,
|
|
16
|
+
* (notification) => this.handleNotification(notification)
|
|
17
|
+
* );
|
|
18
|
+
* }
|
|
19
|
+
*
|
|
20
|
+
* ngOnDestroy() {
|
|
21
|
+
* this.signalRService.unregister(this.componentId, this.appObjectId);
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* Usage in services (TabFormioService):
|
|
26
|
+
* ```typescript
|
|
27
|
+
* const correlationId = response.correlationId;
|
|
28
|
+
* this.signalRService.waitForOperation(correlationId).subscribe(notification => {
|
|
29
|
+
* // Handle completed operation
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare class SignalRService {
|
|
34
|
+
private infrastructure;
|
|
35
|
+
private operationTracker;
|
|
36
|
+
private componentRegistry;
|
|
37
|
+
/**
|
|
38
|
+
* Get connection state (for UI indicators)
|
|
39
|
+
*/
|
|
40
|
+
readonly connectionState: import("@angular/core").WritableSignal<import("../../../app/interfaces/signalr.interface").ConnectionState>;
|
|
41
|
+
/**
|
|
42
|
+
* Check if currently connected
|
|
43
|
+
*/
|
|
44
|
+
readonly isConnected: import("@angular/core").Signal<boolean>;
|
|
45
|
+
constructor();
|
|
46
|
+
/**
|
|
47
|
+
* Establish a connection to the SignalR hub
|
|
48
|
+
*
|
|
49
|
+
* This method is idempotent - if the connection is already established, it will not be re-established.
|
|
50
|
+
* Hub URL is read from Common.signalRHubUrl (set during app initialization via Common.init())
|
|
51
|
+
*/
|
|
52
|
+
connect(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Register component for real-time notifications
|
|
55
|
+
*
|
|
56
|
+
* @param componentId - Unique component identifier (generated by component)
|
|
57
|
+
* @param appObjectId - AppObject ID to subscribe to
|
|
58
|
+
* @param callback - Function to call when notification received
|
|
59
|
+
*/
|
|
60
|
+
register(componentId: string, appObjectId: string, callback: NotificationCallback): void;
|
|
61
|
+
/**
|
|
62
|
+
* Unregister component (cleanup on component destroy)
|
|
63
|
+
*
|
|
64
|
+
* @param componentId - Component identifier to remove
|
|
65
|
+
* @param appObjectId - AppObject ID to unsubscribe from
|
|
66
|
+
*/
|
|
67
|
+
unregister(componentId: string, appObjectId: string): void;
|
|
68
|
+
/**
|
|
69
|
+
* Wait for specific async operation to complete
|
|
70
|
+
* Used by TabFormioService for async processRequest operations
|
|
71
|
+
*
|
|
72
|
+
* @param correlationId - Correlation ID from backend response
|
|
73
|
+
* @param timeout - Optional timeout in milliseconds
|
|
74
|
+
* @returns Observable that emits when operation completes
|
|
75
|
+
*/
|
|
76
|
+
waitForOperation(correlationId: string, timeout?: number): Observable<CrudNotification>;
|
|
77
|
+
/**
|
|
78
|
+
* Register async operation for tracking
|
|
79
|
+
* Optional - waitForOperation handles registration automatically
|
|
80
|
+
*
|
|
81
|
+
* @param operation - Pending operation details
|
|
82
|
+
*/
|
|
83
|
+
registerOperation(operation: PendingOperation): void;
|
|
84
|
+
/**
|
|
85
|
+
* Check if operation is pending
|
|
86
|
+
*/
|
|
87
|
+
isOperationPending(correlationId: string): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Notify all registered components for an AppObject
|
|
90
|
+
* Called when notification received from SignalR hub
|
|
91
|
+
*/
|
|
92
|
+
private notifyComponents;
|
|
93
|
+
/**
|
|
94
|
+
* Get active AppObject groups (for debugging)
|
|
95
|
+
*/
|
|
96
|
+
getActiveGroups(): string[];
|
|
97
|
+
/**
|
|
98
|
+
* Get component count for an AppObject (for debugging)
|
|
99
|
+
*/
|
|
100
|
+
getComponentCount(appObjectId: string): number;
|
|
101
|
+
/**
|
|
102
|
+
* Get total registered components across all AppObjects (for debugging)
|
|
103
|
+
*/
|
|
104
|
+
getTotalComponentCount(): number;
|
|
105
|
+
/**
|
|
106
|
+
* Get registry state (for debugging)
|
|
107
|
+
*/
|
|
108
|
+
getRegistryState(): {
|
|
109
|
+
appObjectId: string;
|
|
110
|
+
componentCount: number;
|
|
111
|
+
}[];
|
|
112
|
+
/**
|
|
113
|
+
* Get pending operations count (for debugging)
|
|
114
|
+
*/
|
|
115
|
+
getPendingOperationsCount(): number;
|
|
116
|
+
/**
|
|
117
|
+
* Get all pending operations (for debugging)
|
|
118
|
+
*/
|
|
119
|
+
getPendingOperations(): PendingOperation[];
|
|
120
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SignalRService, never>;
|
|
121
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SignalRService>;
|
|
122
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@techextensor/tab-core-utility",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.184",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^19.2.15",
|
|
6
6
|
"@angular/core": "^19.2.15",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"idb": "^8.0.2",
|
|
12
12
|
"liquidjs": "^10.20.3",
|
|
13
13
|
"cypress": "^13.17.0",
|
|
14
|
-
"crypto-js": "^4.2.0"
|
|
14
|
+
"crypto-js": "^4.2.0",
|
|
15
|
+
"@microsoft/signalr": "^10.0.0"
|
|
15
16
|
},
|
|
16
17
|
"dependencies": {
|
|
17
18
|
"tslib": "^2.8.1"
|