@m4l/gclick-realtime 1.10.0 → 1.11.0

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 (197) hide show
  1. package/consumer/RealTimeConsumerContext.d.ts +10 -0
  2. package/consumer/RealTimeConsumerContext.d.ts.map +1 -0
  3. package/consumer/RealTimeConsumerContext.js +128 -0
  4. package/consumer/index.d.ts +4 -0
  5. package/consumer/index.d.ts.map +1 -0
  6. package/consumer/index.js +7 -0
  7. package/consumer/types.d.ts +47 -0
  8. package/consumer/types.d.ts.map +1 -0
  9. package/consumer/useRealTimeConsumer.d.ts.map +1 -0
  10. package/{web/consumer → consumer}/useRealTimeConsumer.js +2 -2
  11. package/contracts/deviceData.d.ts +19 -22
  12. package/contracts/deviceData.d.ts.map +1 -1
  13. package/contracts/deviceDetail.d.ts +0 -2
  14. package/contracts/deviceDetail.d.ts.map +1 -1
  15. package/contracts/index.d.ts +1 -1
  16. package/contracts/index.d.ts.map +1 -1
  17. package/dummy/catalogs/baseDeviceTemplate.d.ts.map +1 -1
  18. package/dummy/catalogs/baseDeviceTemplate.js +4 -35
  19. package/dummy/catalogs/blueprints.d.ts +9 -54
  20. package/dummy/catalogs/blueprints.d.ts.map +1 -1
  21. package/dummy/catalogs/blueprints.js +25 -42
  22. package/dummy/catalogs/departments.d.ts +10 -0
  23. package/dummy/catalogs/departments.d.ts.map +1 -0
  24. package/dummy/catalogs/departments.js +43 -0
  25. package/dummy/index.d.ts +3 -3
  26. package/dummy/index.d.ts.map +1 -1
  27. package/dummy/index.js +28 -28
  28. package/dummy/shared/types.d.ts +2 -4
  29. package/dummy/shared/types.d.ts.map +1 -1
  30. package/dummy/{runtime → simulation}/simulation.d.ts +1 -1
  31. package/dummy/simulation/simulation.d.ts.map +1 -0
  32. package/dummy/{runtime → simulation}/simulation.js +333 -423
  33. package/dummy/{runtime/dummy.d.ts → source-data/SourceDataDummy.d.ts} +8 -3
  34. package/dummy/source-data/SourceDataDummy.d.ts.map +1 -0
  35. package/dummy/{runtime/dummy.js → source-data/SourceDataDummy.js} +117 -128
  36. package/mobile/index.d.ts +4 -0
  37. package/mobile/index.d.ts.map +1 -0
  38. package/mobile/index.js +23 -0
  39. package/mobile/resourceTypes.d.ts +48 -0
  40. package/mobile/resourceTypes.d.ts.map +1 -0
  41. package/mobile/resourceTypes.js +54 -0
  42. package/mobile/runtime/atmosphere.d.ts +10 -0
  43. package/mobile/runtime/atmosphere.d.ts.map +1 -0
  44. package/mobile/runtime/atmosphere.js +16 -0
  45. package/mobile/runtime/dummy.d.ts +11 -0
  46. package/mobile/runtime/dummy.d.ts.map +1 -0
  47. package/mobile/runtime/dummy.js +16 -0
  48. package/mobile/runtime/index.d.ts +11 -0
  49. package/mobile/runtime/index.d.ts.map +1 -0
  50. package/mobile/runtime/runtimeRegistry.d.ts +17 -0
  51. package/mobile/runtime/runtimeRegistry.d.ts.map +1 -0
  52. package/mobile/runtime/runtimeRegistry.js +24 -0
  53. package/mobile/runtime/sourceDataFactory.d.ts +6 -0
  54. package/mobile/runtime/sourceDataFactory.d.ts.map +1 -0
  55. package/mobile/runtime/sourceDataFactory.js +29 -0
  56. package/mobile/runtime/types.d.ts +8 -0
  57. package/mobile/runtime/types.d.ts.map +1 -0
  58. package/package.json +37 -1
  59. package/payload/mergeDevicePayloadWithUpdatedAtGuard.d.ts +1 -1
  60. package/payload/mergeDevicePayloadWithUpdatedAtGuard.d.ts.map +1 -1
  61. package/rt_alarms/constants.d.ts +6 -0
  62. package/rt_alarms/constants.d.ts.map +1 -0
  63. package/rt_alarms/constants.js +7 -0
  64. package/rt_alarms/index.d.ts +15 -0
  65. package/rt_alarms/index.d.ts.map +1 -0
  66. package/rt_alarms/index.js +18 -0
  67. package/rt_devices/constants.d.ts +4 -0
  68. package/rt_devices/constants.d.ts.map +1 -0
  69. package/rt_devices/constants.js +5 -0
  70. package/rt_devices/index.d.ts +22 -0
  71. package/rt_devices/index.d.ts.map +1 -0
  72. package/rt_devices/index.js +150 -0
  73. package/rt_devices/resourceTypeMergeStrategies.d.ts +12 -0
  74. package/rt_devices/resourceTypeMergeStrategies.d.ts.map +1 -0
  75. package/rt_devices/resourceTypeMergeStrategies.js +19 -0
  76. package/shared/atmosphereHost.d.ts +5 -0
  77. package/shared/atmosphereHost.d.ts.map +1 -0
  78. package/shared/atmosphereHost.js +7 -0
  79. package/shared/index.d.ts +5 -0
  80. package/shared/index.d.ts.map +1 -0
  81. package/shared/index.js +11 -0
  82. package/shared/performanceMetrics.d.ts +64 -0
  83. package/shared/performanceMetrics.d.ts.map +1 -0
  84. package/shared/performanceMetrics.js +73 -0
  85. package/shared/runtimeRegistry.d.ts +17 -0
  86. package/shared/runtimeRegistry.d.ts.map +1 -0
  87. package/shared/runtimeRegistry.js +27 -0
  88. package/shared/runtimeResourceTypesKey.d.ts +14 -0
  89. package/shared/runtimeResourceTypesKey.d.ts.map +1 -0
  90. package/shared/runtimeResourceTypesKey.js +18 -0
  91. package/shared/startupSnapshots.d.ts +28 -0
  92. package/shared/startupSnapshots.d.ts.map +1 -0
  93. package/shared/startupSnapshots.js +29 -0
  94. package/web/diagnostics/performanceMetrics.d.ts +34 -0
  95. package/web/diagnostics/performanceMetrics.d.ts.map +1 -0
  96. package/web/diagnostics/performanceMetrics.js +61 -0
  97. package/web/host/devicesResourceType.d.ts +3 -11
  98. package/web/host/devicesResourceType.d.ts.map +1 -1
  99. package/web/host/devicesResourceType.js +58 -171
  100. package/web/host/hostRuntime.d.ts +6 -8
  101. package/web/host/hostRuntime.d.ts.map +1 -1
  102. package/web/host/hostRuntime.js +29 -38
  103. package/web/host/index.d.ts +2 -2
  104. package/web/host/index.d.ts.map +1 -1
  105. package/web/host/launchContract.d.ts +19 -13
  106. package/web/host/launchContract.d.ts.map +1 -1
  107. package/web/host/launchContract.js +82 -76
  108. package/web/index.d.ts +2 -7
  109. package/web/index.d.ts.map +1 -1
  110. package/web/index.js +34 -62
  111. package/web/runtime/atmosphere.d.ts +12 -0
  112. package/web/runtime/atmosphere.d.ts.map +1 -0
  113. package/web/runtime/atmosphere.js +22 -0
  114. package/web/runtime/dummy.d.ts +11 -0
  115. package/web/runtime/dummy.d.ts.map +1 -0
  116. package/web/runtime/dummy.js +22 -0
  117. package/web/runtime/index.d.ts +8 -9
  118. package/web/runtime/index.d.ts.map +1 -1
  119. package/web/runtime/performanceMetricReporter.d.ts +8 -0
  120. package/web/runtime/performanceMetricReporter.d.ts.map +1 -0
  121. package/web/runtime/performanceMetricReporter.js +10 -0
  122. package/web/runtime/runtimeRegistry.d.ts +21 -5
  123. package/web/runtime/runtimeRegistry.d.ts.map +1 -1
  124. package/web/runtime/runtimeRegistry.js +22 -7
  125. package/web/runtime/sourceDataFactory.d.ts +7 -0
  126. package/web/runtime/sourceDataFactory.d.ts.map +1 -0
  127. package/web/runtime/sourceDataFactory.js +26 -0
  128. package/web/{producer → runtime}/types.d.ts +2 -7
  129. package/web/runtime/types.d.ts.map +1 -0
  130. package/dummy/catalogs/group.d.ts +0 -10
  131. package/dummy/catalogs/group.d.ts.map +0 -1
  132. package/dummy/catalogs/group.js +0 -46
  133. package/dummy/runtime/dummy.d.ts.map +0 -1
  134. package/dummy/runtime/simulation.d.ts.map +0 -1
  135. package/libs/observability/mf/src/browserRuntimeHandles.js +0 -350
  136. package/libs/observability/mf/src/diagnosticPolicies/catalog.js +0 -12
  137. package/libs/observability/mf/src/diagnosticPolicies/contracts.js +0 -8
  138. package/libs/observability/mf/src/diagnosticPolicies/host.js +0 -127
  139. package/libs/observability/mf/src/diagnosticPolicies/operativeMyGpsDevices.js +0 -79
  140. package/web/consumer/RealTimeConsumerContext.d.ts +0 -10
  141. package/web/consumer/RealTimeConsumerContext.d.ts.map +0 -1
  142. package/web/consumer/RealTimeConsumerContext.js +0 -156
  143. package/web/consumer/index.d.ts +0 -6
  144. package/web/consumer/index.d.ts.map +0 -1
  145. package/web/consumer/store.d.ts +0 -10
  146. package/web/consumer/store.d.ts.map +0 -1
  147. package/web/consumer/store.helpers.d.ts +0 -62
  148. package/web/consumer/store.helpers.d.ts.map +0 -1
  149. package/web/consumer/store.helpers.js +0 -141
  150. package/web/consumer/store.js +0 -227
  151. package/web/consumer/types.d.ts +0 -161
  152. package/web/consumer/types.d.ts.map +0 -1
  153. package/web/consumer/useRealTimeConsumer.d.ts.map +0 -1
  154. package/web/host/startupSnapshots.d.ts +0 -45
  155. package/web/host/startupSnapshots.d.ts.map +0 -1
  156. package/web/host/startupSnapshots.js +0 -103
  157. package/web/producer/RealTimeProducerContext.d.ts +0 -9
  158. package/web/producer/RealTimeProducerContext.d.ts.map +0 -1
  159. package/web/producer/RealTimeProducerContext.js +0 -16
  160. package/web/producer/index.d.ts +0 -7
  161. package/web/producer/index.d.ts.map +0 -1
  162. package/web/producer/sourceDataFactory.d.ts +0 -13
  163. package/web/producer/sourceDataFactory.d.ts.map +0 -1
  164. package/web/producer/sourceDataFactory.js +0 -32
  165. package/web/producer/store.d.ts +0 -7
  166. package/web/producer/store.d.ts.map +0 -1
  167. package/web/producer/store.js +0 -5
  168. package/web/producer/types.d.ts.map +0 -1
  169. package/web/producer/useRealTimeProducer.d.ts +0 -7
  170. package/web/producer/useRealTimeProducer.d.ts.map +0 -1
  171. package/web/producer/useRealTimeProducer.js +0 -15
  172. package/web/runtime/resourceTypeMergeStrategies.d.ts +0 -10
  173. package/web/runtime/resourceTypeMergeStrategies.d.ts.map +0 -1
  174. package/web/runtime/resourceTypeMergeStrategies.js +0 -19
  175. package/web/runtime/runtime.d.ts +0 -16
  176. package/web/runtime/runtime.d.ts.map +0 -1
  177. package/web/runtime/runtime.js +0 -28
  178. package/web/runtime/runtimeAtmosphereOnly.d.ts +0 -11
  179. package/web/runtime/runtimeAtmosphereOnly.d.ts.map +0 -1
  180. package/web/runtime/runtimeAtmosphereOnly.js +0 -28
  181. package/web/runtime/runtimeRegistry.shared.d.ts +0 -23
  182. package/web/runtime/runtimeRegistry.shared.d.ts.map +0 -1
  183. package/web/runtime/runtimeRegistry.shared.js +0 -47
  184. package/web/runtime/runtimeRegistryAtmosphereOnly.d.ts +0 -9
  185. package/web/runtime/runtimeRegistryAtmosphereOnly.d.ts.map +0 -1
  186. package/web/runtime/runtimeRegistryAtmosphereOnly.js +0 -13
  187. package/web/shared/constants.d.ts +0 -11
  188. package/web/shared/constants.d.ts.map +0 -1
  189. package/web/shared/constants.js +0 -11
  190. package/web/shared/index.d.ts +0 -3
  191. package/web/shared/index.d.ts.map +0 -1
  192. package/web/shared/performanceMetrics.d.ts +0 -48
  193. package/web/shared/performanceMetrics.d.ts.map +0 -1
  194. package/web/shared/performanceMetrics.js +0 -70
  195. package/web/shared/runtimeTypes.d.ts +0 -4
  196. package/web/shared/runtimeTypes.d.ts.map +0 -1
  197. /package/{web/consumer → consumer}/useRealTimeConsumer.d.ts +0 -0
@@ -1,12 +0,0 @@
1
- import { hostDiagnosticPolicyCatalog as t } from "./host.js";
2
- import { operativeMyGpsDevicesDiagnosticPolicyCatalog as i } from "./operativeMyGpsDevices.js";
3
- const a = [
4
- ...Object.values(t),
5
- ...Object.values(i)
6
- ];
7
- Object.fromEntries(
8
- a.map((o) => [o.key, o])
9
- );
10
- export {
11
- a as diagnosticPolicyCatalogEntries
12
- };
@@ -1,8 +0,0 @@
1
- const e = "gclick-frontend-diagnostic-policies", c = [
2
- "moduleDefault",
3
- "accountOverride"
4
- ];
5
- export {
6
- e as diagnosticPolicyWebFeatureKey,
7
- c as diagnosticPolicyWebLayers
8
- };
@@ -1,127 +0,0 @@
1
- import { diagnosticPolicyWebLayers as o, diagnosticPolicyWebFeatureKey as r } from "./contracts.js";
2
- const e = {
3
- app: "gclick_host",
4
- runtime: "web",
5
- surface: "host"
6
- }, s = {
7
- diagnosticSmoke: {
8
- active: !0,
9
- codePaths: [
10
- "apps/gclick/gclick_host/src/observability/dev/smoke.ts"
11
- ],
12
- controlPlane: "remote-policy",
13
- createdAt: "2026-06-05",
14
- id: "gclickHostDiagnosticSmoke",
15
- key: "gclick_host.observability.diagnostic-smoke",
16
- notes: [
17
- "This family is primarily exercised through the browser smoke helper and support overrides."
18
- ],
19
- owner: e,
20
- purpose: "Provide one deterministic browser-log smoke signal before support investigates a live issue.",
21
- summary: "Manual host smoke proof for browser diagnostic-log delivery.",
22
- remoteRule: {
23
- featureKey: r,
24
- payloadKey: "gclick_host.observability.diagnostic-smoke",
25
- provider: "growthbook",
26
- supportedLayers: o
27
- }
28
- },
29
- realtimeConnectionRecovery: {
30
- active: !0,
31
- codePaths: [
32
- "apps/gclick/gclick_host/src/observability/host/realtime.ts"
33
- ],
34
- controlPlane: "remote-policy",
35
- createdAt: "2026-06-05",
36
- id: "gclickHostRealtimeConnectionRecovery",
37
- key: "gclick_host.realtime.connection-recovery",
38
- owner: e,
39
- purpose: "Capture host websocket transport recovery evidence without waiting for a broader outage investigation.",
40
- summary: "Host realtime reconnect recovery breadcrumbs.",
41
- remoteRule: {
42
- featureKey: r,
43
- payloadKey: "gclick_host.realtime.connection-recovery",
44
- provider: "growthbook",
45
- supportedLayers: o
46
- }
47
- },
48
- remoteDiagnosticProviderHealth: {
49
- active: !0,
50
- codePaths: [
51
- "apps/gclick/gclick_host/src/observability/diagnostic/diagnosticFeatureFlags.ts"
52
- ],
53
- controlPlane: "always-on",
54
- createdAt: "2026-06-08",
55
- id: "gclickHostRemoteDiagnosticProviderHealth",
56
- key: "gclick_host.feature-flags.remote-diagnostic-provider-health",
57
- notes: [
58
- "This family is intentionally always-on because provider outages are recoverable anomalies, not optional debug breadcrumbs."
59
- ],
60
- owner: e,
61
- purpose: "Report the first failure in a remote diagnostic-provider outage streak even when no support capture is active.",
62
- summary: "Host remote diagnostic-provider outage anomaly."
63
- },
64
- tracesRelayDisabled: {
65
- active: !0,
66
- codePaths: [
67
- "apps/gclick/gclick_host/src/observability/otlp/client.ts",
68
- "apps/gclick/gclick_host/src/observability/otlp/relayDiagnostics.ts",
69
- "libs/observability/web/src/browserOtlp.ts"
70
- ],
71
- controlPlane: "always-on",
72
- createdAt: "2026-06-16",
73
- id: "gclickHostTracesRelayDisabled",
74
- key: "gclick_host.observability.traces-relay-disabled",
75
- notes: [
76
- "This family is intentionally always-on because once the browser traces relay disables itself, trace traffic becomes silent and support needs one surviving breadcrumb in Grafana logs."
77
- ],
78
- owner: e,
79
- purpose: "Report the first permanent browser traces-relay shutdown together with the failure metadata that caused the relay to stop exporting.",
80
- summary: "Host browser traces-relay shutdown anomaly."
81
- },
82
- runtimeBoundaryCrash: {
83
- active: !0,
84
- codePaths: [
85
- "apps/gclick/gclick_host/src/observability/host/runtimeErrors.ts",
86
- "packages/layouts/src/components/MFHostApp/MFHostAppErrorBoundary.tsx",
87
- "packages/layouts/src/components/MFRuntimeErrorWrapper/MFRuntimeErrorWrapper.tsx",
88
- "apps/gclick/gclick_host/src/components/HostShellErrorBoundary/HostShellErrorBoundary.tsx"
89
- ],
90
- controlPlane: "always-on",
91
- createdAt: "2026-06-14",
92
- id: "gclickHostRuntimeBoundaryCrash",
93
- key: "gclick_host.runtime-errors.boundary-crash",
94
- notes: [
95
- "This family is intentionally always-on because React boundary crashes are rare fatal degradations that should remain countable in Grafana logs, not only in traces.",
96
- "Host-loaded MF wrapper boundaries reuse this family with `runtime.boundary_scope=wrapper` and a stable `runtime.wrapper_id` so support can group contained subtree crashes without a separate policy."
97
- ],
98
- owner: e,
99
- purpose: "Report contained host-shell and host-loaded MF boundary crashes as structured always-on diagnostic logs for dashboarding and alerting.",
100
- summary: "Host boundary crash anomaly for host shell and host-loaded MFs."
101
- },
102
- refreshDebug: {
103
- active: !0,
104
- codePaths: [
105
- "apps/gclick/gclick_host/src/observability/diagnostic/diagnosticFeatureFlags.ts"
106
- ],
107
- controlPlane: "remote-policy",
108
- createdAt: "2026-06-11",
109
- id: "gclickHostRefreshDebug",
110
- key: "gclick_host.feature-flags.refresh-debug",
111
- notes: [
112
- "Use this family when support needs to understand why the browser refreshed, queued, or applied one remote diagnostic payload."
113
- ],
114
- owner: e,
115
- purpose: "Expose host-owned GrowthBook refresh breadcrumbs such as bootstrap, context, focus, visibility, poll, and queued refreshes.",
116
- summary: "Host remote diagnostic-provider refresh debug breadcrumbs.",
117
- remoteRule: {
118
- featureKey: r,
119
- payloadKey: "gclick_host.feature-flags.refresh-debug",
120
- provider: "growthbook",
121
- supportedLayers: o
122
- }
123
- }
124
- };
125
- export {
126
- s as hostDiagnosticPolicyCatalog
127
- };
@@ -1,79 +0,0 @@
1
- import { diagnosticPolicyWebLayers as o, diagnosticPolicyWebFeatureKey as t } from "./contracts.js";
2
- const e = {
3
- app: "operative_my_gps_devices",
4
- moduleId: "operative_my_gps_devices",
5
- runtime: "web",
6
- surface: "mf"
7
- }, i = {
8
- deviceSelectionMissingPosition: {
9
- active: !0,
10
- codePaths: [
11
- "apps/gclick/mfs/operative/operative_my_gps_devices/src/components/App/subcomponents/ModuleMap/subcomponents/MapContent/subcomponents/DevicesPanel/subcomponents/DevicesPanelBody/subcomponents/DeviceCard/DeviceCard.tsx"
12
- ],
13
- controlPlane: "remote-policy",
14
- createdAt: "2026-06-05",
15
- id: "operativeMyGpsDevicesDeviceSelectionMissingPosition",
16
- key: "operative_my_gps_devices.device-selection.missing-position",
17
- owner: e,
18
- purpose: "Capture the user-visible branch where one selected device has no finite GNSS position and the map must skip focus safely.",
19
- summary: "MF selection branch for devices without finite GNSS position.",
20
- remoteRule: {
21
- featureKey: t,
22
- payloadKey: "operative_my_gps_devices.device-selection.missing-position",
23
- provider: "growthbook",
24
- supportedLayers: o
25
- }
26
- },
27
- motionCapture: {
28
- active: !0,
29
- codePaths: [
30
- "apps/gclick/mfs/operative/operative_my_gps_devices/src/components/App/subcomponents/ModuleMap/subcomponents/MapContent/subcomponents/DeviceMarker/helpers/motionCapture.ts",
31
- "apps/gclick/mfs/operative/operative_my_gps_devices/src/components/app_entries/ByIsolation/observability/smoke.ts"
32
- ],
33
- controlPlane: "remote-policy",
34
- createdAt: "2026-06-06",
35
- id: "operativeMyGpsDevicesMotionCapture",
36
- key: "operative_my_gps_devices.motion.capture",
37
- notes: [
38
- "The closing session summary is treated as the final record of a policy-authorized capture session, not as a separate always-on anomaly lane."
39
- ],
40
- owner: e,
41
- purpose: "Capture selected-device realtime ingress, motion-segment, and camera-follow evidence for support investigations.",
42
- summary: "MF targeted motion-capture diagnostic family.",
43
- remoteRule: {
44
- featureKey: t,
45
- payloadKey: "operative_my_gps_devices.motion.capture",
46
- provider: "growthbook",
47
- supportedLayers: o
48
- }
49
- },
50
- recoverableLeafletRuntime: {
51
- active: !0,
52
- codePaths: [
53
- "apps/gclick/mfs/operative/operative_my_gps_devices/src/components/App/subcomponents/ModuleMap/subcomponents/MapContent/subcomponents/DeviceMarker/helpers/reportLeafletRuntimeError.ts"
54
- ],
55
- controlPlane: "always-on",
56
- createdAt: "2026-06-05",
57
- id: "operativeMyGpsDevicesRecoverableLeafletRuntime",
58
- key: "operative_my_gps_devices.recoverable.leaflet-runtime",
59
- owner: e,
60
- purpose: "Expose recovered Leaflet runtime anomalies that should never stay silent even without one active support capture.",
61
- summary: "MF always-on recovered Leaflet runtime anomaly."
62
- },
63
- remoteDiagnosticProviderHealth: {
64
- active: !0,
65
- codePaths: [
66
- "apps/gclick/mfs/operative/operative_my_gps_devices/src/components/app_entries/ByIsolation/observability/diagnosticFeatureFlags.ts"
67
- ],
68
- controlPlane: "always-on",
69
- createdAt: "2026-06-08",
70
- id: "operativeMyGpsDevicesRemoteDiagnosticProviderHealth",
71
- key: "operative_my_gps_devices.feature-flags.remote-diagnostic-provider-health",
72
- owner: e,
73
- purpose: "Report isolation remote diagnostic-provider outages even when the active session has no support policy enabled.",
74
- summary: "MF isolation remote diagnostic-provider outage anomaly."
75
- }
76
- };
77
- export {
78
- i as operativeMyGpsDevicesDiagnosticPolicyCatalog
79
- };
@@ -1,10 +0,0 @@
1
- import { RealTimeProviderProps } from './types';
2
- declare const RealTimeConsumerContext: import('react').Context<(Omit<import('zustand').StoreApi<import('./types').RealTimeConsumerStoreStateWithActions>, "setState"> & {
3
- setState(nextStateOrUpdater: import('./types').RealTimeConsumerStoreStateWithActions | Partial<import('./types').RealTimeConsumerStoreStateWithActions> | ((state: import('immer/dist/internal.js').WritableDraft<import('./types').RealTimeConsumerStoreStateWithActions>) => void), shouldReplace?: boolean | undefined): void;
4
- }) | null>;
5
- /**
6
- * Bind one MF-local realtime consumer store to the explicit producer tools contract.
7
- */
8
- declare function RealTimeConsumerProvider(props: RealTimeProviderProps): import("react/jsx-runtime").JSX.Element;
9
- export { RealTimeConsumerProvider, RealTimeConsumerContext };
10
- //# sourceMappingURL=RealTimeConsumerContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RealTimeConsumerContext.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick-realtime/src/web/consumer/RealTimeConsumerContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAYjB,QAAA,MAAM,uBAAuB;;UAE5B,CAAC;AAyGF;;GAEG;AACH,iBAAS,wBAAwB,CAAC,KAAK,EAAE,qBAAqB,2CA2J7D;AAED,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,CAAC"}
@@ -1,156 +0,0 @@
1
- import { j as V } from "../../_virtual/jsx-runtime.js";
2
- import { r as o } from "../../_virtual/index.js";
3
- import { createRealTimeConsumerStore as W } from "./store.js";
4
- import { RESOURCE_TYPE_DEVICES as g } from "../shared/constants.js";
5
- import { recordRealtimePerformanceMetric as h } from "../shared/performanceMetrics.js";
6
- const Y = o.createContext(
7
- null
8
- );
9
- let C = 0, T = 0;
10
- function I(e) {
11
- C = Math.max(
12
- 0,
13
- C + e
14
- ), h(
15
- "consumerActiveStoreCount",
16
- C
17
- );
18
- }
19
- function k(e) {
20
- T = Math.max(
21
- 0,
22
- T + e
23
- ), h(
24
- "consumerActiveSubscriptionCount",
25
- T
26
- );
27
- }
28
- function $(e, r, s, n) {
29
- return e || [
30
- {
31
- resourceTypeId: g,
32
- hasResourcesDecorators: n[g],
33
- onMessagesCallbacks: r,
34
- onSubscribeCallbacks: s,
35
- storeMode: "full"
36
- }
37
- ];
38
- }
39
- function q(e) {
40
- return e.reduce(
41
- (r, s) => (s.hasResourcesDecorators?.length && (r[s.resourceTypeId] = s.hasResourcesDecorators), r),
42
- {}
43
- );
44
- }
45
- function z(e) {
46
- return e.reduce(
47
- (r, s) => {
48
- const { messageProjector: n, resourceTypeId: u, snapshotProjector: a, storeMode: t } = s;
49
- return !t && !n && !a || (r[u] = {
50
- mode: t,
51
- messageProjector: n,
52
- snapshotProjector: a
53
- }), r;
54
- },
55
- {}
56
- );
57
- }
58
- function L(e) {
59
- const {
60
- children: r,
61
- onMessagesCallbacks: s = [],
62
- onSubscribeCallbacks: n = [],
63
- onTransportReconnectCallbacks: u = [],
64
- hasResourcesTypesDecorators: a = {},
65
- producerTools: t,
66
- resourceSubscriptions: S,
67
- windowId: y,
68
- storeDevtoolsEnabled: x = !1,
69
- ...D
70
- } = e, i = o.useRef(null), j = o.useRef(y), H = o.useRef(
71
- `${y}:transport-reconnect`
72
- ), l = j.current, R = H.current, c = o.useMemo(
73
- () => $(
74
- S,
75
- s,
76
- n,
77
- a
78
- ),
79
- [
80
- a,
81
- s,
82
- n,
83
- S
84
- ]
85
- ), P = o.useMemo(
86
- () => q(c),
87
- [c]
88
- ), w = o.useMemo(
89
- () => z(c),
90
- [c]
91
- );
92
- return i.current || (i.current = W(
93
- {
94
- ...D,
95
- storeId: l,
96
- hasResourcesTypesDecorators: P,
97
- hasResourcesTypesStoreConfig: w
98
- },
99
- x
100
- )), o.useEffect(() => (I(1), () => {
101
- I(-1);
102
- }), []), o.useEffect(() => {
103
- if (!i.current)
104
- return;
105
- const { onMessages: d, loadResourceType: p } = i.current.getState().realTimeConsumerActions, v = [];
106
- return c.forEach((m) => {
107
- const {
108
- onMessagesCallbacks: E = [],
109
- onSubscribeCallbacks: A = [],
110
- resourceTypeId: f,
111
- storeMode: O = "full"
112
- } = m, M = O !== "callbacks-only", _ = M ? [d, ...E] : E, b = t.subscribeResourceType(
113
- f,
114
- {
115
- clientId: l,
116
- onMessageCallbacks: _
117
- }
118
- );
119
- M && p(f, b), A.forEach((U) => {
120
- U(
121
- f,
122
- b
123
- );
124
- }), h(
125
- "consumerSnapshotResourceCount",
126
- Object.keys(b).length
127
- ), k(1), v.push(f);
128
- }), () => {
129
- v.forEach((m) => {
130
- t.unsubscribe(m, l), k(-1);
131
- });
132
- };
133
- }, [t, c, l]), o.useEffect(() => {
134
- if (u.length !== 0)
135
- return t.subscribeTransportReconnect({
136
- clientId: R,
137
- onReconnectCallback: (d) => {
138
- u.forEach((p) => {
139
- p(d);
140
- });
141
- }
142
- }), () => {
143
- t.unsubscribeTransportReconnect(
144
- R
145
- );
146
- };
147
- }, [
148
- u,
149
- t,
150
- R
151
- ]), /* @__PURE__ */ V.jsx(Y.Provider, { value: i.current, children: r });
152
- }
153
- export {
154
- Y as RealTimeConsumerContext,
155
- L as RealTimeConsumerProvider
156
- };
@@ -1,6 +0,0 @@
1
- export { RealTimeConsumerContext, RealTimeConsumerProvider, } from './RealTimeConsumerContext';
2
- export { useRealTimeConsumer } from './useRealTimeConsumer';
3
- export { createRealTimeConsumerStore } from './store';
4
- export type { RealTimeConsumerStoreType } from './store';
5
- export type { InitialRealTimeStoreProps, RealTimeConsumer, RealTimeConsumerMessageProjector, RealTimeConsumerMessageProjectorContext, RealTimeConsumerResourceStoreConfig, RealTimeConsumerResourceSubscription, RealTimeConsumerSnapshotProjector, RealTimeConsumerStoreMode, RealTimeConsumerStoreState, RealTimeConsumerStoreStateWithActions, RealTimeMessageDecorator, RealTimeProviderProps, } from './types';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick-realtime/src/web/consumer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AACtD,YAAY,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACzD,YAAY,EACV,yBAAyB,EACzB,gBAAgB,EAChB,gCAAgC,EAChC,uCAAuC,EACvC,mCAAmC,EACnC,oCAAoC,EACpC,iCAAiC,EACjC,yBAAyB,EACzB,0BAA0B,EAC1B,qCAAqC,EACrC,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,SAAS,CAAC"}
@@ -1,10 +0,0 @@
1
- import { InitialRealTimeStoreProps, RealTimeConsumerStoreStateWithActions } from './types';
2
- export declare const REALTIME_CONSUMER_SNAPSHOT_CHUNK_SIZE = 200;
3
- /**
4
- * Create the consumer-side realtime store.
5
- */
6
- export declare function createRealTimeConsumerStore(initProps: InitialRealTimeStoreProps, storeDevtoolsEnabled?: boolean): Omit<import('zustand').StoreApi<RealTimeConsumerStoreStateWithActions>, "setState"> & {
7
- setState(nextStateOrUpdater: RealTimeConsumerStoreStateWithActions | Partial<RealTimeConsumerStoreStateWithActions> | ((state: import('immer/dist/internal.js').WritableDraft<RealTimeConsumerStoreStateWithActions>) => void), shouldReplace?: boolean | undefined): void;
8
- };
9
- export type RealTimeConsumerStoreType = ReturnType<typeof createRealTimeConsumerStore>;
10
- //# sourceMappingURL=store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick-realtime/src/web/consumer/store.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,yBAAyB,EAEzB,qCAAqC,EACtC,MAAM,SAAS,CAAC;AAwBjB,eAAO,MAAM,qCAAqC,MAAM,CAAC;AAkEzD;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,yBAAyB,EACpC,oBAAoB,UAAQ;;EAwU7B;AAED,MAAM,MAAM,yBAAyB,GAAG,UAAU,CAChD,OAAO,2BAA2B,CACnC,CAAC"}
@@ -1,62 +0,0 @@
1
- import { DevtoolsOptions } from 'zustand/middleware';
2
- import { StateCreator } from 'zustand';
3
- import { ObjectQueue } from '@m4l/realtime-runtime';
4
- import { MessageQueueManager, RealTimeMessage, RealTimeMessagePayload, RealTimeReadonlyResourceHash, RealTimeResourceSerialId, RealTimeResourceTypeId } from '../shared/runtimeTypes';
5
- import { RealTimeConsumerResourceStoreConfig, RealTimeConsumerStoreStateWithActions, RealTimeMessageDecorator } from './types';
6
- type ConsumerSnapshotResourceKey = string;
7
- type RealTimeConsumerSnapshotEntry = [
8
- resourceSerialId: RealTimeResourceSerialId,
9
- resource: RealTimeMessagePayload
10
- ];
11
- /**
12
- * Decorate one resource or message payload.
13
- */
14
- export declare function decorateResourceOrMessage(resourceSerialId: RealTimeResourceSerialId, resourceOrMessage: RealTimeMessagePayload, decorators?: RealTimeMessageDecorator[]): RealTimeMessagePayload;
15
- /**
16
- * Clone one consumer resource and guarantee the hash key also exists inside the stored payload.
17
- */
18
- export declare function createStoredConsumerResource(resourceSerialId: RealTimeResourceSerialId, resource: RealTimeMessagePayload): RealTimeMessagePayload;
19
- /**
20
- * Decorate and optionally project one startup snapshot resource into the local consumer shape.
21
- */
22
- export declare function buildConsumerSnapshotResource(resourceSerialId: RealTimeResourceSerialId, resource: RealTimeMessagePayload, decorators?: RealTimeMessageDecorator[], storeConfig?: RealTimeConsumerResourceStoreConfig): RealTimeMessagePayload | undefined;
23
- /**
24
- * Decorate the full resource hash for one resource type and optionally project it.
25
- */
26
- export declare function buildConsumerSnapshotResources(resources: RealTimeReadonlyResourceHash, decorators?: RealTimeMessageDecorator[], storeConfig?: RealTimeConsumerResourceStoreConfig): Record<string, RealTimeMessagePayload>;
27
- /**
28
- * Create the queue manager used by one consumer resource type.
29
- */
30
- export declare function createConsumerMessageManager(): MessageQueueManager;
31
- /**
32
- * Normalize resource ids to one key shape for race guards across string and numeric ids.
33
- */
34
- export declare function createConsumerResourceKey(resourceSerialId: RealTimeResourceSerialId): ConsumerSnapshotResourceKey;
35
- /**
36
- * Convert a read-only producer snapshot into stable entries for chunked consumer loading.
37
- */
38
- export declare function createConsumerSnapshotEntries(resources: RealTimeReadonlyResourceHash): RealTimeConsumerSnapshotEntry[];
39
- /**
40
- * Apply one startup snapshot slice to the consumer hash without overwriting live-touched resources.
41
- */
42
- export declare function applyConsumerSnapshotEntriesChunk(hasResources: Record<RealTimeResourceSerialId, RealTimeMessagePayload>, entries: RealTimeConsumerSnapshotEntry[], startIndex: number, endIndex: number, decorators?: RealTimeMessageDecorator[], storeConfig?: RealTimeConsumerResourceStoreConfig, liveTouchedResourceKeys?: Set<ConsumerSnapshotResourceKey>): void;
43
- /**
44
- * Drain all queued realtime messages while preserving arrival order.
45
- */
46
- export declare function drainQueuedMessages(messagesQueue: ObjectQueue<RealTimeMessage>): RealTimeMessage[];
47
- /**
48
- * Apply one decorated realtime payload to the consumer-side resource hash.
49
- */
50
- export declare function applyConsumerMessage(hasResources: Record<RealTimeResourceSerialId, RealTimeMessagePayload>, resourceTypeId: RealTimeResourceTypeId, message: RealTimeMessage, decorators?: Record<RealTimeResourceTypeId, RealTimeMessageDecorator[]>, storeConfig?: Record<RealTimeResourceTypeId, RealTimeConsumerResourceStoreConfig>): void;
51
- /**
52
- * Create the devtools wrapper only when the store runs in development mode.
53
- */
54
- export declare function createConsumerDevtools(immerMiddlewere: StateCreator<RealTimeConsumerStoreStateWithActions, [
55
- ], [
56
- ['zustand/immer', never]
57
- ]>, config: DevtoolsOptions): StateCreator<RealTimeConsumerStoreStateWithActions, [
58
- ], [
59
- ['zustand/immer', never]
60
- ]>;
61
- export {};
62
- //# sourceMappingURL=store.helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store.helpers.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick-realtime/src/web/consumer/store.helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,4BAA4B,EAC5B,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,mCAAmC,EACnC,qCAAqC,EACrC,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAEjB,KAAK,2BAA2B,GAAG,MAAM,CAAC;AAE1C,KAAK,6BAA6B,GAAG;IACnC,gBAAgB,EAAE,wBAAwB;IAC1C,QAAQ,EAAE,sBAAsB;CACjC,CAAC;AAEF;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,gBAAgB,EAAE,wBAAwB,EAC1C,iBAAiB,EAAE,sBAAsB,EACzC,UAAU,CAAC,EAAE,wBAAwB,EAAE,0BAWxC;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,gBAAgB,EAAE,wBAAwB,EAC1C,QAAQ,EAAE,sBAAsB,0BAYjC;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAC3C,gBAAgB,EAAE,wBAAwB,EAC1C,QAAQ,EAAE,sBAAsB,EAChC,UAAU,CAAC,EAAE,wBAAwB,EAAE,EACvC,WAAW,CAAC,EAAE,mCAAmC,sCAqBlD;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,4BAA4B,EACvC,UAAU,CAAC,EAAE,wBAAwB,EAAE,EACvC,WAAW,CAAC,EAAE,mCAAmC,0CAmBlD;AAED;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,mBAAmB,CAMlE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,gBAAgB,EAAE,wBAAwB,GACzC,2BAA2B,CAE7B;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,4BAA4B,GACtC,6BAA6B,EAAE,CAEjC;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,YAAY,EAAE,MAAM,CAAC,wBAAwB,EAAE,sBAAsB,CAAC,EACtE,OAAO,EAAE,6BAA6B,EAAE,EACxC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,wBAAwB,EAAE,EACvC,WAAW,CAAC,EAAE,mCAAmC,EACjD,uBAAuB,CAAC,EAAE,GAAG,CAAC,2BAA2B,CAAC,QAoB3D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,WAAW,CAAC,eAAe,CAAC,qBAY9E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,MAAM,CAAC,wBAAwB,EAAE,sBAAsB,CAAC,EACtE,cAAc,EAAE,sBAAsB,EACtC,OAAO,EAAE,eAAe,EACxB,UAAU,CAAC,EAAE,MAAM,CAAC,sBAAsB,EAAE,wBAAwB,EAAE,CAAC,EACvE,WAAW,CAAC,EAAE,MAAM,CAClB,sBAAsB,EACtB,mCAAmC,CACpC,QA+DF;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,YAAY,CAC3B,qCAAqC,EACrC;CAAE,EACF;IAAC,CAAC,eAAe,EAAE,KAAK,CAAC;CAAC,CAC3B,EACD,MAAM,EAAE,eAAe,GACtB,YAAY,CACb,qCAAqC,EACrC;CAAE,EACF;IAAC,CAAC,eAAe,EAAE,KAAK,CAAC;CAAC,CAC3B,CAYA"}
@@ -1,141 +0,0 @@
1
- import { devtools as g } from "../../node_modules/zustand/esm/middleware.js";
2
- import { ObjectQueue as C } from "@m4l/realtime-runtime";
3
- import a from "../../node_modules/lodash-es/merge.js";
4
- import v from "../../node_modules/lodash-es/cloneDeep.js";
5
- function l(e, t, r) {
6
- return r && t ? r.reduce(
7
- (u, o) => o(e, u),
8
- t
9
- ) : t;
10
- }
11
- function p(e, t) {
12
- const r = v(t);
13
- return r.resourceSerialId === void 0 ? {
14
- ...r,
15
- resourceSerialId: e
16
- } : r;
17
- }
18
- function m(e, t, r, u) {
19
- const o = l(
20
- e,
21
- t,
22
- r
23
- );
24
- if (u?.mode !== "projected" || !o)
25
- return p(e, o);
26
- const i = u.snapshotProjector ? u.snapshotProjector(e, o) : o;
27
- if (i != null)
28
- return p(e, i);
29
- }
30
- function x(e, t, r) {
31
- return Object.entries(e).reduce(
32
- (u, [o, i]) => {
33
- const n = m(
34
- o,
35
- i,
36
- t,
37
- r
38
- );
39
- return n && (u[o] = n), u;
40
- },
41
- {}
42
- );
43
- }
44
- function D() {
45
- return {
46
- messagesToProcces: [],
47
- messagesQueue: new C(),
48
- statusProccesing: !1
49
- };
50
- }
51
- function b(e) {
52
- return String(e);
53
- }
54
- function M(e) {
55
- return Object.entries(e);
56
- }
57
- function O(e, t, r, u, o, i, n) {
58
- for (let d = r; d < u; d += 1) {
59
- const [c, f] = t[d];
60
- if (n?.has(b(c)))
61
- continue;
62
- const s = m(
63
- c,
64
- f,
65
- o,
66
- i
67
- );
68
- s && (e[c] = s);
69
- }
70
- }
71
- function k(e) {
72
- const t = [];
73
- for (; !e.isEmpty(); ) {
74
- const r = e.dequeue();
75
- r && t.push(r);
76
- }
77
- return t;
78
- }
79
- function N(e, t, r, u, o) {
80
- const { payload: i, resourceSerialId: n, type: d } = r;
81
- if (d === "delete") {
82
- delete e[n];
83
- return;
84
- }
85
- const c = l(
86
- n,
87
- i,
88
- u?.[t]
89
- ), f = o?.[t];
90
- if (f?.mode === "projected") {
91
- const s = f.messageProjector ? f.messageProjector(n, {
92
- currentResource: e[n],
93
- message: {
94
- ...r,
95
- payload: c
96
- }
97
- }) ?? void 0 : e[n] ? a({}, e[n], c) : c;
98
- if (s === void 0) {
99
- const j = e[n] ? a({}, e[n], c) : c;
100
- e[n] = p(
101
- n,
102
- j
103
- );
104
- return;
105
- }
106
- if (s === null) {
107
- delete e[n];
108
- return;
109
- }
110
- e[n] = p(
111
- n,
112
- s
113
- );
114
- return;
115
- }
116
- if (!e[n]) {
117
- e[n] = p(
118
- n,
119
- c
120
- );
121
- return;
122
- }
123
- a(e[n], c);
124
- }
125
- function Q(e, t) {
126
- const { enabled: r = !1 } = t;
127
- return r && process.env.NODE_ENV === "development" ? g(e, t) : e;
128
- }
129
- export {
130
- N as applyConsumerMessage,
131
- O as applyConsumerSnapshotEntriesChunk,
132
- m as buildConsumerSnapshotResource,
133
- x as buildConsumerSnapshotResources,
134
- Q as createConsumerDevtools,
135
- D as createConsumerMessageManager,
136
- b as createConsumerResourceKey,
137
- M as createConsumerSnapshotEntries,
138
- p as createStoredConsumerResource,
139
- l as decorateResourceOrMessage,
140
- k as drainQueuedMessages
141
- };