@techextensor/tab-core-utility 2.2.187 → 2.2.188

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.
Files changed (73) hide show
  1. package/esm2022/index.mjs +5 -1
  2. package/esm2022/lib/tab-core-utility/app/constants/api-constants.mjs +27 -15
  3. package/esm2022/lib/tab-core-utility/app/constants/common.mjs +14 -50
  4. package/esm2022/lib/tab-core-utility/app/constants/storage-constants.mjs +2 -2
  5. package/esm2022/lib/tab-core-utility/app/crud/tab-crud.service.mjs +38 -49
  6. package/esm2022/lib/tab-core-utility/app/crud/tab-delete.service.mjs +84 -30
  7. package/esm2022/lib/tab-core-utility/app/crud/tab-formio.service.mjs +141 -12
  8. package/esm2022/lib/tab-core-utility/app/crud/tab-get.service.mjs +136 -35
  9. package/esm2022/lib/tab-core-utility/app/crud/tab-insert.service.mjs +89 -38
  10. package/esm2022/lib/tab-core-utility/app/crud/tab-update.service.mjs +158 -131
  11. package/esm2022/lib/tab-core-utility/app/enums/query.enum.mjs +7 -7
  12. package/esm2022/lib/tab-core-utility/app/helpers/common/app.helpers.mjs +26 -19
  13. package/esm2022/lib/tab-core-utility/app/helpers/common/dsq.helpers.mjs +9 -11
  14. package/esm2022/lib/tab-core-utility/app/helpers/common/meta-data.helpers.mjs +13 -13
  15. package/esm2022/lib/tab-core-utility/app/helpers/common/req-res.helpers.mjs +7 -45
  16. package/esm2022/lib/tab-core-utility/app/helpers/common/where-clause.helpers.mjs +79 -76
  17. package/esm2022/lib/tab-core-utility/app/helpers/response.adapter.mjs +38 -0
  18. package/esm2022/lib/tab-core-utility/app/helpers/screen/grid.helpers.mjs +8 -4
  19. package/esm2022/lib/tab-core-utility/app/helpers/screen/screen.helpers.mjs +8 -33
  20. package/esm2022/lib/tab-core-utility/app/interfaces/common.interface.mjs +1 -1
  21. package/esm2022/lib/tab-core-utility/app/interfaces/signalr.interface.mjs +42 -0
  22. package/esm2022/lib/tab-core-utility/app/models/api-query.class.mjs +39 -1
  23. package/esm2022/lib/tab-core-utility/app/models/app-field.model.mjs +36 -7
  24. package/esm2022/lib/tab-core-utility/app/models/app-object.model.mjs +84 -47
  25. package/esm2022/lib/tab-core-utility/app/models/app-screen.model.mjs +24 -13
  26. package/esm2022/lib/tab-core-utility/app/models/data-source-query.model.mjs +57 -23
  27. package/esm2022/lib/tab-core-utility/app/models/filter.model.mjs +21 -10
  28. package/esm2022/lib/tab-core-utility/app/models/parameter.model.mjs +12 -6
  29. package/esm2022/lib/tab-core-utility/app/models/sort.model.mjs +11 -4
  30. package/esm2022/lib/tab-core-utility/app/utils/json.util.mjs +17 -16
  31. package/esm2022/lib/tab-core-utility/app/utils/req-res.util.mjs +1 -55
  32. package/esm2022/lib/tab-core-utility/app/utils/tab-app.util.mjs +1 -164
  33. package/esm2022/lib/tab-core-utility/core/http-client/api.service.mjs +78 -1
  34. package/esm2022/lib/tab-core-utility/core/service/signalr/operation-tracker.service.mjs +90 -0
  35. package/esm2022/lib/tab-core-utility/core/service/signalr/signalr-infrastructure.service.mjs +268 -0
  36. package/esm2022/lib/tab-core-utility/core/service/signalr/signalr.service.mjs +207 -0
  37. package/index.d.ts +4 -0
  38. package/lib/tab-core-utility/app/constants/api-constants.d.ts +15 -12
  39. package/lib/tab-core-utility/app/constants/common.d.ts +9 -0
  40. package/lib/tab-core-utility/app/constants/storage-constants.d.ts +1 -1
  41. package/lib/tab-core-utility/app/crud/tab-crud.service.d.ts +8 -1
  42. package/lib/tab-core-utility/app/crud/tab-delete.service.d.ts +20 -10
  43. package/lib/tab-core-utility/app/crud/tab-formio.service.d.ts +33 -6
  44. package/lib/tab-core-utility/app/crud/tab-get.service.d.ts +45 -3
  45. package/lib/tab-core-utility/app/crud/tab-insert.service.d.ts +16 -21
  46. package/lib/tab-core-utility/app/crud/tab-update.service.d.ts +34 -19
  47. package/lib/tab-core-utility/app/enums/query.enum.d.ts +3 -6
  48. package/lib/tab-core-utility/app/helpers/common/app.helpers.d.ts +5 -8
  49. package/lib/tab-core-utility/app/helpers/common/dsq.helpers.d.ts +3 -0
  50. package/lib/tab-core-utility/app/helpers/common/meta-data.helpers.d.ts +3 -3
  51. package/lib/tab-core-utility/app/helpers/common/req-res.helpers.d.ts +7 -51
  52. package/lib/tab-core-utility/app/helpers/common/where-clause.helpers.d.ts +1 -0
  53. package/lib/tab-core-utility/app/helpers/response.adapter.d.ts +22 -0
  54. package/lib/tab-core-utility/app/helpers/screen/grid.helpers.d.ts +2 -1
  55. package/lib/tab-core-utility/app/helpers/screen/screen.helpers.d.ts +1 -0
  56. package/lib/tab-core-utility/app/interfaces/common.interface.d.ts +51 -2
  57. package/lib/tab-core-utility/app/interfaces/signalr.interface.d.ts +84 -0
  58. package/lib/tab-core-utility/app/models/api-query.class.d.ts +54 -9
  59. package/lib/tab-core-utility/app/models/app-field.model.d.ts +4 -2
  60. package/lib/tab-core-utility/app/models/app-object.model.d.ts +5 -3
  61. package/lib/tab-core-utility/app/models/app-screen.model.d.ts +2 -2
  62. package/lib/tab-core-utility/app/models/data-source-query.model.d.ts +7 -2
  63. package/lib/tab-core-utility/app/models/filter.model.d.ts +2 -2
  64. package/lib/tab-core-utility/app/models/parameter.model.d.ts +2 -2
  65. package/lib/tab-core-utility/app/models/sort.model.d.ts +1 -1
  66. package/lib/tab-core-utility/app/utils/json.util.d.ts +3 -2
  67. package/lib/tab-core-utility/app/utils/req-res.util.d.ts +1 -9
  68. package/lib/tab-core-utility/app/utils/tab-app.util.d.ts +0 -61
  69. package/lib/tab-core-utility/core/http-client/api.service.d.ts +46 -0
  70. package/lib/tab-core-utility/core/service/signalr/operation-tracker.service.d.ts +40 -0
  71. package/lib/tab-core-utility/core/service/signalr/signalr-infrastructure.service.d.ts +73 -0
  72. package/lib/tab-core-utility/core/service/signalr/signalr.service.d.ts +122 -0
  73. 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.187",
3
+ "version": "2.2.188",
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"