@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.
- package/consumer/RealTimeConsumerContext.d.ts +10 -0
- package/consumer/RealTimeConsumerContext.d.ts.map +1 -0
- package/consumer/RealTimeConsumerContext.js +128 -0
- package/consumer/index.d.ts +4 -0
- package/consumer/index.d.ts.map +1 -0
- package/consumer/index.js +7 -0
- package/consumer/types.d.ts +47 -0
- package/consumer/types.d.ts.map +1 -0
- package/consumer/useRealTimeConsumer.d.ts.map +1 -0
- package/{web/consumer → consumer}/useRealTimeConsumer.js +2 -2
- package/contracts/deviceData.d.ts +19 -22
- package/contracts/deviceData.d.ts.map +1 -1
- package/contracts/deviceDetail.d.ts +0 -2
- package/contracts/deviceDetail.d.ts.map +1 -1
- package/contracts/index.d.ts +1 -1
- package/contracts/index.d.ts.map +1 -1
- package/dummy/catalogs/baseDeviceTemplate.d.ts.map +1 -1
- package/dummy/catalogs/baseDeviceTemplate.js +4 -35
- package/dummy/catalogs/blueprints.d.ts +9 -54
- package/dummy/catalogs/blueprints.d.ts.map +1 -1
- package/dummy/catalogs/blueprints.js +25 -42
- package/dummy/catalogs/departments.d.ts +10 -0
- package/dummy/catalogs/departments.d.ts.map +1 -0
- package/dummy/catalogs/departments.js +43 -0
- package/dummy/index.d.ts +3 -3
- package/dummy/index.d.ts.map +1 -1
- package/dummy/index.js +28 -28
- package/dummy/shared/types.d.ts +2 -4
- package/dummy/shared/types.d.ts.map +1 -1
- package/dummy/{runtime → simulation}/simulation.d.ts +1 -1
- package/dummy/simulation/simulation.d.ts.map +1 -0
- package/dummy/{runtime → simulation}/simulation.js +333 -423
- package/dummy/{runtime/dummy.d.ts → source-data/SourceDataDummy.d.ts} +8 -3
- package/dummy/source-data/SourceDataDummy.d.ts.map +1 -0
- package/dummy/{runtime/dummy.js → source-data/SourceDataDummy.js} +117 -128
- package/mobile/index.d.ts +4 -0
- package/mobile/index.d.ts.map +1 -0
- package/mobile/index.js +23 -0
- package/mobile/resourceTypes.d.ts +48 -0
- package/mobile/resourceTypes.d.ts.map +1 -0
- package/mobile/resourceTypes.js +54 -0
- package/mobile/runtime/atmosphere.d.ts +10 -0
- package/mobile/runtime/atmosphere.d.ts.map +1 -0
- package/mobile/runtime/atmosphere.js +16 -0
- package/mobile/runtime/dummy.d.ts +11 -0
- package/mobile/runtime/dummy.d.ts.map +1 -0
- package/mobile/runtime/dummy.js +16 -0
- package/mobile/runtime/index.d.ts +11 -0
- package/mobile/runtime/index.d.ts.map +1 -0
- package/mobile/runtime/runtimeRegistry.d.ts +17 -0
- package/mobile/runtime/runtimeRegistry.d.ts.map +1 -0
- package/mobile/runtime/runtimeRegistry.js +24 -0
- package/mobile/runtime/sourceDataFactory.d.ts +6 -0
- package/mobile/runtime/sourceDataFactory.d.ts.map +1 -0
- package/mobile/runtime/sourceDataFactory.js +29 -0
- package/mobile/runtime/types.d.ts +8 -0
- package/mobile/runtime/types.d.ts.map +1 -0
- package/package.json +37 -1
- package/payload/mergeDevicePayloadWithUpdatedAtGuard.d.ts +1 -1
- package/payload/mergeDevicePayloadWithUpdatedAtGuard.d.ts.map +1 -1
- package/rt_alarms/constants.d.ts +6 -0
- package/rt_alarms/constants.d.ts.map +1 -0
- package/rt_alarms/constants.js +7 -0
- package/rt_alarms/index.d.ts +15 -0
- package/rt_alarms/index.d.ts.map +1 -0
- package/rt_alarms/index.js +18 -0
- package/rt_devices/constants.d.ts +4 -0
- package/rt_devices/constants.d.ts.map +1 -0
- package/rt_devices/constants.js +5 -0
- package/rt_devices/index.d.ts +22 -0
- package/rt_devices/index.d.ts.map +1 -0
- package/rt_devices/index.js +150 -0
- package/rt_devices/resourceTypeMergeStrategies.d.ts +12 -0
- package/rt_devices/resourceTypeMergeStrategies.d.ts.map +1 -0
- package/rt_devices/resourceTypeMergeStrategies.js +19 -0
- package/shared/atmosphereHost.d.ts +5 -0
- package/shared/atmosphereHost.d.ts.map +1 -0
- package/shared/atmosphereHost.js +7 -0
- package/shared/index.d.ts +5 -0
- package/shared/index.d.ts.map +1 -0
- package/shared/index.js +11 -0
- package/shared/performanceMetrics.d.ts +64 -0
- package/shared/performanceMetrics.d.ts.map +1 -0
- package/shared/performanceMetrics.js +73 -0
- package/shared/runtimeRegistry.d.ts +17 -0
- package/shared/runtimeRegistry.d.ts.map +1 -0
- package/shared/runtimeRegistry.js +27 -0
- package/shared/runtimeResourceTypesKey.d.ts +14 -0
- package/shared/runtimeResourceTypesKey.d.ts.map +1 -0
- package/shared/runtimeResourceTypesKey.js +18 -0
- package/shared/startupSnapshots.d.ts +28 -0
- package/shared/startupSnapshots.d.ts.map +1 -0
- package/shared/startupSnapshots.js +29 -0
- package/web/diagnostics/performanceMetrics.d.ts +34 -0
- package/web/diagnostics/performanceMetrics.d.ts.map +1 -0
- package/web/diagnostics/performanceMetrics.js +61 -0
- package/web/host/devicesResourceType.d.ts +3 -11
- package/web/host/devicesResourceType.d.ts.map +1 -1
- package/web/host/devicesResourceType.js +58 -171
- package/web/host/hostRuntime.d.ts +6 -8
- package/web/host/hostRuntime.d.ts.map +1 -1
- package/web/host/hostRuntime.js +29 -38
- package/web/host/index.d.ts +2 -2
- package/web/host/index.d.ts.map +1 -1
- package/web/host/launchContract.d.ts +19 -13
- package/web/host/launchContract.d.ts.map +1 -1
- package/web/host/launchContract.js +82 -76
- package/web/index.d.ts +2 -7
- package/web/index.d.ts.map +1 -1
- package/web/index.js +34 -62
- package/web/runtime/atmosphere.d.ts +12 -0
- package/web/runtime/atmosphere.d.ts.map +1 -0
- package/web/runtime/atmosphere.js +22 -0
- package/web/runtime/dummy.d.ts +11 -0
- package/web/runtime/dummy.d.ts.map +1 -0
- package/web/runtime/dummy.js +22 -0
- package/web/runtime/index.d.ts +8 -9
- package/web/runtime/index.d.ts.map +1 -1
- package/web/runtime/performanceMetricReporter.d.ts +8 -0
- package/web/runtime/performanceMetricReporter.d.ts.map +1 -0
- package/web/runtime/performanceMetricReporter.js +10 -0
- package/web/runtime/runtimeRegistry.d.ts +21 -5
- package/web/runtime/runtimeRegistry.d.ts.map +1 -1
- package/web/runtime/runtimeRegistry.js +22 -7
- package/web/runtime/sourceDataFactory.d.ts +7 -0
- package/web/runtime/sourceDataFactory.d.ts.map +1 -0
- package/web/runtime/sourceDataFactory.js +26 -0
- package/web/{producer → runtime}/types.d.ts +2 -7
- package/web/runtime/types.d.ts.map +1 -0
- package/dummy/catalogs/group.d.ts +0 -10
- package/dummy/catalogs/group.d.ts.map +0 -1
- package/dummy/catalogs/group.js +0 -46
- package/dummy/runtime/dummy.d.ts.map +0 -1
- package/dummy/runtime/simulation.d.ts.map +0 -1
- package/libs/observability/mf/src/browserRuntimeHandles.js +0 -350
- package/libs/observability/mf/src/diagnosticPolicies/catalog.js +0 -12
- package/libs/observability/mf/src/diagnosticPolicies/contracts.js +0 -8
- package/libs/observability/mf/src/diagnosticPolicies/host.js +0 -127
- package/libs/observability/mf/src/diagnosticPolicies/operativeMyGpsDevices.js +0 -79
- package/web/consumer/RealTimeConsumerContext.d.ts +0 -10
- package/web/consumer/RealTimeConsumerContext.d.ts.map +0 -1
- package/web/consumer/RealTimeConsumerContext.js +0 -156
- package/web/consumer/index.d.ts +0 -6
- package/web/consumer/index.d.ts.map +0 -1
- package/web/consumer/store.d.ts +0 -10
- package/web/consumer/store.d.ts.map +0 -1
- package/web/consumer/store.helpers.d.ts +0 -62
- package/web/consumer/store.helpers.d.ts.map +0 -1
- package/web/consumer/store.helpers.js +0 -141
- package/web/consumer/store.js +0 -227
- package/web/consumer/types.d.ts +0 -161
- package/web/consumer/types.d.ts.map +0 -1
- package/web/consumer/useRealTimeConsumer.d.ts.map +0 -1
- package/web/host/startupSnapshots.d.ts +0 -45
- package/web/host/startupSnapshots.d.ts.map +0 -1
- package/web/host/startupSnapshots.js +0 -103
- package/web/producer/RealTimeProducerContext.d.ts +0 -9
- package/web/producer/RealTimeProducerContext.d.ts.map +0 -1
- package/web/producer/RealTimeProducerContext.js +0 -16
- package/web/producer/index.d.ts +0 -7
- package/web/producer/index.d.ts.map +0 -1
- package/web/producer/sourceDataFactory.d.ts +0 -13
- package/web/producer/sourceDataFactory.d.ts.map +0 -1
- package/web/producer/sourceDataFactory.js +0 -32
- package/web/producer/store.d.ts +0 -7
- package/web/producer/store.d.ts.map +0 -1
- package/web/producer/store.js +0 -5
- package/web/producer/types.d.ts.map +0 -1
- package/web/producer/useRealTimeProducer.d.ts +0 -7
- package/web/producer/useRealTimeProducer.d.ts.map +0 -1
- package/web/producer/useRealTimeProducer.js +0 -15
- package/web/runtime/resourceTypeMergeStrategies.d.ts +0 -10
- package/web/runtime/resourceTypeMergeStrategies.d.ts.map +0 -1
- package/web/runtime/resourceTypeMergeStrategies.js +0 -19
- package/web/runtime/runtime.d.ts +0 -16
- package/web/runtime/runtime.d.ts.map +0 -1
- package/web/runtime/runtime.js +0 -28
- package/web/runtime/runtimeAtmosphereOnly.d.ts +0 -11
- package/web/runtime/runtimeAtmosphereOnly.d.ts.map +0 -1
- package/web/runtime/runtimeAtmosphereOnly.js +0 -28
- package/web/runtime/runtimeRegistry.shared.d.ts +0 -23
- package/web/runtime/runtimeRegistry.shared.d.ts.map +0 -1
- package/web/runtime/runtimeRegistry.shared.js +0 -47
- package/web/runtime/runtimeRegistryAtmosphereOnly.d.ts +0 -9
- package/web/runtime/runtimeRegistryAtmosphereOnly.d.ts.map +0 -1
- package/web/runtime/runtimeRegistryAtmosphereOnly.js +0 -13
- package/web/shared/constants.d.ts +0 -11
- package/web/shared/constants.d.ts.map +0 -1
- package/web/shared/constants.js +0 -11
- package/web/shared/index.d.ts +0 -3
- package/web/shared/index.d.ts.map +0 -1
- package/web/shared/performanceMetrics.d.ts +0 -48
- package/web/shared/performanceMetrics.d.ts.map +0 -1
- package/web/shared/performanceMetrics.js +0 -70
- package/web/shared/runtimeTypes.d.ts +0 -4
- package/web/shared/runtimeTypes.d.ts.map +0 -1
- /package/{web/consumer → consumer}/useRealTimeConsumer.d.ts +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createRealtimeMobileRuntime as t } from "@m4l/realtime-runtime/mobile";
|
|
2
|
+
import { withGClickResourceTypeMergeStrategies as i } from "../../rt_devices/resourceTypeMergeStrategies.js";
|
|
3
|
+
import { createGClickRealtimeMobileSourceDataFactory as o } from "./sourceDataFactory.js";
|
|
4
|
+
function u(e) {
|
|
5
|
+
const r = i(
|
|
6
|
+
e.resourceTypesConfig
|
|
7
|
+
);
|
|
8
|
+
return t({
|
|
9
|
+
...e,
|
|
10
|
+
createSourceData: o(),
|
|
11
|
+
resourceTypesConfig: r
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
u as createGClickDummyRealtimeMobileRuntime
|
|
16
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { createGClickAtmosphereRealtimeMobileRuntime, } from './atmosphere';
|
|
2
|
+
export { createGClickDummyRealtimeMobileRuntime, } from './dummy';
|
|
3
|
+
export { createGClickRealtimeMobileSourceDataFactory, } from './sourceDataFactory';
|
|
4
|
+
export { disposeGClickRealtimeMobileRuntime, getOrCreateGClickAtmosphereRealtimeMobileRuntime, getOrCreateGClickDummyRealtimeMobileRuntime, } from './runtimeRegistry';
|
|
5
|
+
export type { CreateGClickAtmosphereRealtimeMobileRuntimeProps, GClickRealtimeMobileRuntime, } from './atmosphere';
|
|
6
|
+
export type { CreateGClickDummyRealtimeMobileRuntimeProps, } from './dummy';
|
|
7
|
+
export type { GetOrCreateGClickAtmosphereRealtimeMobileRuntimeProps, GetOrCreateGClickDummyRealtimeMobileRuntimeProps, } from './runtimeRegistry';
|
|
8
|
+
export type { GClickRealtimeMobileResourceTypeConfig, GClickRealtimeMobileSourceDataMechanism, GClickRealtimeMobileUnsupportedResourceTypeConfig, } from './types';
|
|
9
|
+
export { disposeGClickRealtimeStartupSnapshots, replayGClickRealtimeStartupSnapshotsOnReconnect, replayGClickRealtimeStartupSnapshotsOnce, } from '../../shared/startupSnapshots';
|
|
10
|
+
export type { GClickRealtimeResourceStartupSnapshotConfig, GClickRealtimeStartupSnapshotConfig, GClickRealtimeStartupSnapshotLoadContext, GClickRealtimeStartupSnapshotMessagesLoader, } from '../../shared/startupSnapshots';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick-realtime/src/mobile/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2CAA2C,GAC5C,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,sCAAsC,GACvC,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,2CAA2C,GAC5C,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,kCAAkC,EAClC,gDAAgD,EAChD,2CAA2C,GAC5C,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,gDAAgD,EAChD,2BAA2B,GAC5B,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,2CAA2C,GAC5C,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,qDAAqD,EACrD,gDAAgD,GACjD,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,sCAAsC,EACtC,uCAAuC,EACvC,iDAAiD,GAClD,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,qCAAqC,EACrC,+CAA+C,EAC/C,wCAAwC,GACzC,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,2CAA2C,EAC3C,mCAAmC,EACnC,wCAAwC,EACxC,2CAA2C,GAC5C,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CreateGClickAtmosphereRealtimeMobileRuntimeProps } from './atmosphere';
|
|
2
|
+
import { CreateGClickDummyRealtimeMobileRuntimeProps } from './dummy';
|
|
3
|
+
export type GetOrCreateGClickAtmosphereRealtimeMobileRuntimeProps = CreateGClickAtmosphereRealtimeMobileRuntimeProps;
|
|
4
|
+
export type GetOrCreateGClickDummyRealtimeMobileRuntimeProps = CreateGClickDummyRealtimeMobileRuntimeProps;
|
|
5
|
+
/**
|
|
6
|
+
* Lazily create or reuse the Atmosphere-backed GClick mobile runtime.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getOrCreateGClickAtmosphereRealtimeMobileRuntime: (publicProps: CreateGClickAtmosphereRealtimeMobileRuntimeProps) => import('@m4l/realtime-runtime/mobile').RealtimeMobileRuntime;
|
|
9
|
+
/**
|
|
10
|
+
* Lazily create or reuse the auxiliary GClick mobile dummy runtime.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getOrCreateGClickDummyRealtimeMobileRuntime: (publicProps: CreateGClickDummyRealtimeMobileRuntimeProps) => import('@m4l/realtime-runtime/mobile').RealtimeMobileRuntime;
|
|
13
|
+
/**
|
|
14
|
+
* Dispose one cached GClick mobile runtime associated with the provided public runtime key.
|
|
15
|
+
*/
|
|
16
|
+
export declare function disposeGClickRealtimeMobileRuntime(runtimeKey: string): void;
|
|
17
|
+
//# sourceMappingURL=runtimeRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeRegistry.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick-realtime/src/mobile/runtime/runtimeRegistry.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,gDAAgD,EACjD,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,KAAK,2CAA2C,EACjD,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,qDAAqD,GAC/D,gDAAgD,CAAC;AAEnD,MAAM,MAAM,gDAAgD,GAC1D,2CAA2C,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,gDAAgD,iIAWzD,CAAC;AAEL;;GAEG;AACH,eAAO,MAAM,2CAA2C,4HAWpD,CAAC;AAEL;;GAEG;AACH,wBAAgB,kCAAkC,CAAC,UAAU,EAAE,MAAM,QAEpE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createGClickRealtimeRuntimeRegistryGetter as i, disposeGClickRealtimeRuntimeByKey as m } from "../../shared/runtimeRegistry.js";
|
|
2
|
+
import { createGClickAtmosphereRealtimeMobileRuntime as r } from "./atmosphere.js";
|
|
3
|
+
import { createGClickDummyRealtimeMobileRuntime as o } from "./dummy.js";
|
|
4
|
+
const c = i({
|
|
5
|
+
createRuntime: r,
|
|
6
|
+
resolveCreateProps: (e, t) => ({
|
|
7
|
+
...e,
|
|
8
|
+
runtimeKey: t
|
|
9
|
+
})
|
|
10
|
+
}), n = i({
|
|
11
|
+
createRuntime: o,
|
|
12
|
+
resolveCreateProps: (e, t) => ({
|
|
13
|
+
...e,
|
|
14
|
+
runtimeKey: t
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
function u(e) {
|
|
18
|
+
m(e);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
u as disposeGClickRealtimeMobileRuntime,
|
|
22
|
+
c as getOrCreateGClickAtmosphereRealtimeMobileRuntime,
|
|
23
|
+
n as getOrCreateGClickDummyRealtimeMobileRuntime
|
|
24
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CreateRealtimeMobileSourceData } from '@m4l/realtime-runtime/mobile';
|
|
2
|
+
/**
|
|
3
|
+
* Create the mobile source-data factory used by one GClick realtime runtime.
|
|
4
|
+
*/
|
|
5
|
+
export declare function createGClickRealtimeMobileSourceDataFactory(): CreateRealtimeMobileSourceData;
|
|
6
|
+
//# sourceMappingURL=sourceDataFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sourceDataFactory.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick-realtime/src/mobile/runtime/sourceDataFactory.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,8BAA8B,EAE/B,MAAM,8BAA8B,CAAC;AAMtC;;GAEG;AACH,wBAAgB,2CAA2C,IACzD,8BAA8B,CAoC/B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createAtmosphereSourceDataFactoryMobile as u } from "@m4l/realtime-runtime/mobile";
|
|
2
|
+
import { SourceDataDummy as l } from "../../dummy/source-data/SourceDataDummy.js";
|
|
3
|
+
function h() {
|
|
4
|
+
const t = u();
|
|
5
|
+
return function(e, r, a, o, c, m, i) {
|
|
6
|
+
switch (e.sourceDataMechanism) {
|
|
7
|
+
case "dummy":
|
|
8
|
+
return new l(
|
|
9
|
+
e,
|
|
10
|
+
r
|
|
11
|
+
);
|
|
12
|
+
case "atmosphere":
|
|
13
|
+
return t(
|
|
14
|
+
e,
|
|
15
|
+
r,
|
|
16
|
+
a,
|
|
17
|
+
o,
|
|
18
|
+
c,
|
|
19
|
+
m,
|
|
20
|
+
i
|
|
21
|
+
);
|
|
22
|
+
default:
|
|
23
|
+
throw new Error("Unsupported GClick realtime mobile source mechanism.");
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
h as createGClickRealtimeMobileSourceDataFactory
|
|
29
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RealTimeResourceSourceMechanismConfigAtmosphere, RealTimeResourceSourceMechanismConfigBase } from '@m4l/realtime-runtime/mobile';
|
|
2
|
+
import { RealTimeResourceSourceMechanismConfigDummy } from '../../dummy/index';
|
|
3
|
+
export type GClickRealtimeMobileResourceTypeConfig = RealTimeResourceSourceMechanismConfigAtmosphere | RealTimeResourceSourceMechanismConfigDummy;
|
|
4
|
+
export type GClickRealtimeMobileSourceDataMechanism = GClickRealtimeMobileResourceTypeConfig['sourceDataMechanism'];
|
|
5
|
+
export type GClickRealtimeMobileUnsupportedResourceTypeConfig = RealTimeResourceSourceMechanismConfigBase & {
|
|
6
|
+
sourceDataMechanism: Exclude<string, GClickRealtimeMobileSourceDataMechanism>;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/gclick-realtime/src/mobile/runtime/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,+CAA+C,EAC/C,yCAAyC,EAC1C,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EACV,0CAA0C,EAC3C,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,sCAAsC,GAC9C,+CAA+C,GAC/C,0CAA0C,CAAC;AAE/C,MAAM,MAAM,uCAAuC,GACjD,sCAAsC,CAAC,qBAAqB,CAAC,CAAC;AAEhE,MAAM,MAAM,iDAAiD,GAC3D,yCAAyC,GAAG;IAC1C,mBAAmB,EAAE,OAAO,CAAC,MAAM,EAAE,uCAAuC,CAAC,CAAC;CAC/E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/gclick-realtime",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -39,12 +39,48 @@
|
|
|
39
39
|
"import": "./dummy/index.js",
|
|
40
40
|
"default": "./dummy/index.js"
|
|
41
41
|
},
|
|
42
|
+
"./consumer": {
|
|
43
|
+
"development": "./src/consumer/index.ts",
|
|
44
|
+
"types": "./consumer/index.d.ts",
|
|
45
|
+
"import": "./consumer/index.js",
|
|
46
|
+
"default": "./consumer/index.js"
|
|
47
|
+
},
|
|
42
48
|
"./payload": {
|
|
43
49
|
"development": "./src/payload/index.ts",
|
|
44
50
|
"types": "./payload/index.d.ts",
|
|
45
51
|
"import": "./payload/index.js",
|
|
46
52
|
"default": "./payload/index.js"
|
|
47
53
|
},
|
|
54
|
+
"./shared": {
|
|
55
|
+
"development": "./src/shared/index.ts",
|
|
56
|
+
"types": "./shared/index.d.ts",
|
|
57
|
+
"import": "./shared/index.js",
|
|
58
|
+
"default": "./shared/index.js"
|
|
59
|
+
},
|
|
60
|
+
"./rt_devices": {
|
|
61
|
+
"development": "./src/rt_devices/index.ts",
|
|
62
|
+
"types": "./rt_devices/index.d.ts",
|
|
63
|
+
"import": "./rt_devices/index.js",
|
|
64
|
+
"default": "./rt_devices/index.js"
|
|
65
|
+
},
|
|
66
|
+
"./rt_alarms": {
|
|
67
|
+
"development": "./src/rt_alarms/index.ts",
|
|
68
|
+
"types": "./rt_alarms/index.d.ts",
|
|
69
|
+
"import": "./rt_alarms/index.js",
|
|
70
|
+
"default": "./rt_alarms/index.js"
|
|
71
|
+
},
|
|
72
|
+
"./mobile": {
|
|
73
|
+
"development": "./src/mobile/index.ts",
|
|
74
|
+
"types": "./mobile/index.d.ts",
|
|
75
|
+
"import": "./mobile/index.js",
|
|
76
|
+
"default": "./mobile/index.js"
|
|
77
|
+
},
|
|
78
|
+
"./mobile/resourceTypes": {
|
|
79
|
+
"development": "./src/mobile/resourceTypes.ts",
|
|
80
|
+
"types": "./mobile/resourceTypes.d.ts",
|
|
81
|
+
"import": "./mobile/resourceTypes.js",
|
|
82
|
+
"default": "./mobile/resourceTypes.js"
|
|
83
|
+
},
|
|
48
84
|
"./gnss": {
|
|
49
85
|
"development": "./src/gnss/index.ts",
|
|
50
86
|
"types": "./gnss/index.d.ts",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RealTimeResourcePayloadMergeStrategy } from '@m4l/realtime-runtime';
|
|
1
|
+
import { RealTimeResourcePayloadMergeStrategy } from '@m4l/realtime-runtime/shared';
|
|
2
2
|
/**
|
|
3
3
|
* Sanitize one incoming device payload branch while preserving newer tracked wrappers already in the producer snapshot.
|
|
4
4
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeDevicePayloadWithUpdatedAtGuard.d.ts","sourceRoot":"","sources":["../../../../../packages/gclick-realtime/src/payload/mergeDevicePayloadWithUpdatedAtGuard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,oCAAoC,EACrC,MAAM,
|
|
1
|
+
{"version":3,"file":"mergeDevicePayloadWithUpdatedAtGuard.d.ts","sourceRoot":"","sources":["../../../../../packages/gclick-realtime/src/payload/mergeDevicePayloadWithUpdatedAtGuard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,oCAAoC,EACrC,MAAM,8BAA8B,CAAC;AA4DtC;;GAEG;AACH,wBAAgB,wCAAwC,CACtD,WAAW,EAAE,OAAO,EACpB,YAAY,EAAE,OAAO,GACpB,OAAO,CAqDT;AAED;;GAEG;AACH,eAAO,MAAM,oCAAoC,EAAE,oCAYlD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const RESOURCE_TYPE_ALARMS: "rt_alarms";
|
|
2
|
+
export declare const GCLICK_RT_ALARMS_RESOURCE_TYPE_ID: "rt_alarms";
|
|
3
|
+
export declare const GCLICK_RT_ALARMS_ATMOSPHERE_CONSUMER_TYPE: "batch";
|
|
4
|
+
export declare const GCLICK_RT_ALARMS_SOURCE_OF_TRUTH: "authoritative-count-endpoint";
|
|
5
|
+
export type GClickRtAlarmsResourceTypeId = typeof GCLICK_RT_ALARMS_RESOURCE_TYPE_ID;
|
|
6
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../packages/gclick-realtime/src/rt_alarms/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,EAAG,WAAoB,CAAC;AACzD,eAAO,MAAM,iCAAiC,aAAuB,CAAC;AACtE,eAAO,MAAM,yCAAyC,EAAG,OAAgB,CAAC;AAC1E,eAAO,MAAM,gCAAgC,EAAG,8BAAuC,CAAC;AAExF,MAAM,MAAM,4BAA4B,GAAG,OAAO,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RealTimeResourceTypeId } from '@m4l/realtime-runtime/shared';
|
|
2
|
+
import { GCLICK_RT_ALARMS_ATMOSPHERE_CONSUMER_TYPE, GCLICK_RT_ALARMS_RESOURCE_TYPE_ID, GCLICK_RT_ALARMS_SOURCE_OF_TRUTH } from './constants';
|
|
3
|
+
export { GCLICK_RT_ALARMS_ATMOSPHERE_CONSUMER_TYPE, GCLICK_RT_ALARMS_RESOURCE_TYPE_ID, GCLICK_RT_ALARMS_SOURCE_OF_TRUTH, RESOURCE_TYPE_ALARMS, } from './constants';
|
|
4
|
+
export type { GClickRtAlarmsResourceTypeId } from './constants';
|
|
5
|
+
export interface GClickRtAlarmsInvalidationContract {
|
|
6
|
+
consumerType: typeof GCLICK_RT_ALARMS_ATMOSPHERE_CONSUMER_TYPE;
|
|
7
|
+
resourceTypeId: typeof GCLICK_RT_ALARMS_RESOURCE_TYPE_ID;
|
|
8
|
+
sourceOfTruth: typeof GCLICK_RT_ALARMS_SOURCE_OF_TRUTH;
|
|
9
|
+
}
|
|
10
|
+
export declare const GCLICK_RT_ALARMS_INVALIDATION_CONTRACT: GClickRtAlarmsInvalidationContract;
|
|
11
|
+
/**
|
|
12
|
+
* Return whether one resource type id belongs to the GClick alarms invalidation stream.
|
|
13
|
+
*/
|
|
14
|
+
export declare function isGClickRtAlarmsResourceType(resourceTypeId: RealTimeResourceTypeId): resourceTypeId is typeof GCLICK_RT_ALARMS_RESOURCE_TYPE_ID;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/gclick-realtime/src/rt_alarms/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EACL,yCAAyC,EACzC,iCAAiC,EACjC,gCAAgC,EACjC,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,yCAAyC,EACzC,iCAAiC,EACjC,gCAAgC,EAChC,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,WAAW,kCAAkC;IACjD,YAAY,EAAE,OAAO,yCAAyC,CAAC;IAC/D,cAAc,EAAE,OAAO,iCAAiC,CAAC;IACzD,aAAa,EAAE,OAAO,gCAAgC,CAAC;CACxD;AAED,eAAO,MAAM,sCAAsC,EAAE,kCAIpD,CAAC;AAEF;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,cAAc,EAAE,sBAAsB,GACrC,cAAc,IAAI,OAAO,iCAAiC,CAE5D"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { GCLICK_RT_ALARMS_SOURCE_OF_TRUTH as T, GCLICK_RT_ALARMS_RESOURCE_TYPE_ID as _, GCLICK_RT_ALARMS_ATMOSPHERE_CONSUMER_TYPE as A } from "./constants.js";
|
|
2
|
+
import { RESOURCE_TYPE_ALARMS as L } from "./constants.js";
|
|
3
|
+
const r = {
|
|
4
|
+
consumerType: A,
|
|
5
|
+
resourceTypeId: _,
|
|
6
|
+
sourceOfTruth: T
|
|
7
|
+
};
|
|
8
|
+
function e(R) {
|
|
9
|
+
return R === _;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
A as GCLICK_RT_ALARMS_ATMOSPHERE_CONSUMER_TYPE,
|
|
13
|
+
r as GCLICK_RT_ALARMS_INVALIDATION_CONTRACT,
|
|
14
|
+
_ as GCLICK_RT_ALARMS_RESOURCE_TYPE_ID,
|
|
15
|
+
T as GCLICK_RT_ALARMS_SOURCE_OF_TRUTH,
|
|
16
|
+
L as RESOURCE_TYPE_ALARMS,
|
|
17
|
+
e as isGClickRtAlarmsResourceType
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../packages/gclick-realtime/src/rt_devices/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,EAAG,YAAqB,CAAC;AAC3D,eAAO,MAAM,kCAAkC,cAAwB,CAAC;AAExE,MAAM,MAAM,6BAA6B,GAAG,OAAO,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RealTimeMessage, RealTimeReadonlyResourceHash, RealTimeResourceMessageNormalizeStrategy, RealTimeResourceTypeId } from '@m4l/realtime-runtime/shared';
|
|
2
|
+
import { DeviceRuntimeDataType, DeviceRuntimeResourceSerialId } from '../contracts/index';
|
|
3
|
+
export type GClickRtDeviceRuntimeSerialId = DeviceRuntimeResourceSerialId;
|
|
4
|
+
export type GClickRtDeviceRuntimeSnapshot = DeviceRuntimeDataType;
|
|
5
|
+
export { GCLICK_RT_DEVICES_RESOURCE_TYPE_ID, RESOURCE_TYPE_DEVICES, } from './constants';
|
|
6
|
+
export type { GClickRtDevicesResourceTypeId } from './constants';
|
|
7
|
+
export { withGClickResourceTypeMergeStrategies, withGClickResourceTypeMergeStrategy, } from './resourceTypeMergeStrategies';
|
|
8
|
+
/**
|
|
9
|
+
* Normalize one live `rt_devices` realtime message to the shared hash-key and payload identity contract.
|
|
10
|
+
*/
|
|
11
|
+
export declare const normalizeGClickRtDevicesRealtimeMessage: RealTimeResourceMessageNormalizeStrategy;
|
|
12
|
+
/**
|
|
13
|
+
* Convert a backend devices snapshot response into replayable `rt_devices` realtime messages.
|
|
14
|
+
*/
|
|
15
|
+
export declare function createGClickRtDevicesStartupSnapshotMessages(response: unknown, resourceTypeId?: RealTimeResourceTypeId): RealTimeMessage[];
|
|
16
|
+
/**
|
|
17
|
+
* Convert a producer resource hash into the runtime device snapshot consumed by UI stores.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createGClickRtDevicesRuntimeSnapshot<TDevice extends {
|
|
20
|
+
resourceSerialId: GClickRtDeviceRuntimeSerialId;
|
|
21
|
+
} = GClickRtDeviceRuntimeSnapshot>(hasResources: RealTimeReadonlyResourceHash): TDevice[];
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/gclick-realtime/src/rt_devices/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAEf,4BAA4B,EAC5B,wCAAwC,EAExC,sBAAsB,EACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EACV,qBAAqB,EACrB,6BAA6B,EAC9B,MAAM,oBAAoB,CAAC;AAU5B,MAAM,MAAM,6BAA6B,GAAG,6BAA6B,CAAC;AAE1E,MAAM,MAAM,6BAA6B,GAAG,qBAAqB,CAAC;AAElE,OAAO,EACL,kCAAkC,EAClC,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EACL,qCAAqC,EACrC,mCAAmC,GACpC,MAAM,+BAA+B,CAAC;AAqIvC;;GAEG;AACH,eAAO,MAAM,uCAAuC,EAAE,wCAwCrD,CAAC;AAwCF;;GAEG;AACH,wBAAgB,4CAA4C,CAC1D,QAAQ,EAAE,OAAO,EACjB,cAAc,GAAE,sBAA2D,GAC1E,eAAe,EAAE,CAiCnB;AAED;;GAEG;AACH,wBAAgB,oCAAoC,CAClD,OAAO,SAAS;IACd,gBAAgB,EAAE,6BAA6B,CAAC;CACjD,GAAG,6BAA6B,EAEjC,YAAY,EAAE,4BAA4B,GACzC,OAAO,EAAE,CAmCX"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { GCLICK_RT_DEVICES_RESOURCE_TYPE_ID as p } from "./constants.js";
|
|
2
|
+
import { RESOURCE_TYPE_DEVICES as A } from "./constants.js";
|
|
3
|
+
import { withGClickResourceTypeMergeStrategies as M, withGClickResourceTypeMergeStrategy as N } from "./resourceTypeMergeStrategies.js";
|
|
4
|
+
const I = [
|
|
5
|
+
"devices",
|
|
6
|
+
"resources",
|
|
7
|
+
"items",
|
|
8
|
+
"results"
|
|
9
|
+
];
|
|
10
|
+
function u(e) {
|
|
11
|
+
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
12
|
+
}
|
|
13
|
+
function S(e) {
|
|
14
|
+
return u(e) && "data" in e ? e.data : e;
|
|
15
|
+
}
|
|
16
|
+
function l(e) {
|
|
17
|
+
return typeof e == "string" && e.trim() ? e : null;
|
|
18
|
+
}
|
|
19
|
+
function c(e) {
|
|
20
|
+
return typeof e == "number" && Number.isSafeInteger(e);
|
|
21
|
+
}
|
|
22
|
+
function y(e) {
|
|
23
|
+
return typeof e == "string" && !!e.trim();
|
|
24
|
+
}
|
|
25
|
+
function s(e) {
|
|
26
|
+
const r = Number(e);
|
|
27
|
+
return Number.isSafeInteger(r) ? r : null;
|
|
28
|
+
}
|
|
29
|
+
function d(e, r) {
|
|
30
|
+
return l(
|
|
31
|
+
e.resourceSerialId ?? e.serialId ?? r
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
function R(e, r) {
|
|
35
|
+
if ("id" in e && !c(e.id))
|
|
36
|
+
return null;
|
|
37
|
+
const t = { ...e };
|
|
38
|
+
if (delete t.resourceId, delete t.resourceSerialId, delete t.serialId, !("id" in t)) {
|
|
39
|
+
const n = s(r);
|
|
40
|
+
if (n === null)
|
|
41
|
+
return null;
|
|
42
|
+
t.id = n;
|
|
43
|
+
}
|
|
44
|
+
return t;
|
|
45
|
+
}
|
|
46
|
+
function D(e) {
|
|
47
|
+
if (!c(e.id) || !y(e.serialId))
|
|
48
|
+
return null;
|
|
49
|
+
const r = { ...e };
|
|
50
|
+
return delete r.resourceId, delete r.resourceSerialId, delete r.serialId, r.alias === null && delete r.alias, r;
|
|
51
|
+
}
|
|
52
|
+
const v = (e) => {
|
|
53
|
+
const r = l(e.resourceSerialId);
|
|
54
|
+
if (!r)
|
|
55
|
+
return null;
|
|
56
|
+
if (e.type === "delete")
|
|
57
|
+
return e.resourceSerialId === r ? e : {
|
|
58
|
+
...e,
|
|
59
|
+
resourceSerialId: r
|
|
60
|
+
};
|
|
61
|
+
if (!u(e.payload))
|
|
62
|
+
return null;
|
|
63
|
+
const t = R(
|
|
64
|
+
e.payload,
|
|
65
|
+
r
|
|
66
|
+
);
|
|
67
|
+
return t ? r === e.resourceSerialId && t === e.payload ? e : {
|
|
68
|
+
...e,
|
|
69
|
+
payload: t,
|
|
70
|
+
resourceSerialId: r
|
|
71
|
+
} : null;
|
|
72
|
+
};
|
|
73
|
+
function E(e) {
|
|
74
|
+
const r = S(e);
|
|
75
|
+
if (Array.isArray(r))
|
|
76
|
+
return r.map((t) => ({
|
|
77
|
+
deviceCandidate: t
|
|
78
|
+
}));
|
|
79
|
+
if (!u(r))
|
|
80
|
+
return [];
|
|
81
|
+
if (d(r))
|
|
82
|
+
return [{ deviceCandidate: r }];
|
|
83
|
+
for (const t of I) {
|
|
84
|
+
const n = r[t];
|
|
85
|
+
if (Array.isArray(n))
|
|
86
|
+
return n.map((i) => ({
|
|
87
|
+
deviceCandidate: i
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
return Object.entries(r).map(([t, n]) => ({
|
|
91
|
+
deviceCandidate: n,
|
|
92
|
+
resourceSerialId: t
|
|
93
|
+
}));
|
|
94
|
+
}
|
|
95
|
+
function C(e, r = p) {
|
|
96
|
+
return E(e).flatMap(({
|
|
97
|
+
deviceCandidate: t,
|
|
98
|
+
resourceSerialId: n
|
|
99
|
+
}) => {
|
|
100
|
+
if (!u(t))
|
|
101
|
+
return [];
|
|
102
|
+
const i = d(
|
|
103
|
+
t,
|
|
104
|
+
n
|
|
105
|
+
);
|
|
106
|
+
if (i === null)
|
|
107
|
+
return [];
|
|
108
|
+
const o = D(t);
|
|
109
|
+
return o === null ? [] : [
|
|
110
|
+
{
|
|
111
|
+
payload: o,
|
|
112
|
+
resourceSerialId: i,
|
|
113
|
+
resourceTypeId: r,
|
|
114
|
+
type: "update"
|
|
115
|
+
}
|
|
116
|
+
];
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function _(e) {
|
|
120
|
+
return Object.entries(e).flatMap(([r, t]) => {
|
|
121
|
+
if (!u(t))
|
|
122
|
+
return [];
|
|
123
|
+
const n = l(t.resourceSerialId) ?? l(r);
|
|
124
|
+
if (n === null)
|
|
125
|
+
return [];
|
|
126
|
+
const i = { ...t };
|
|
127
|
+
if (!c(i.id)) {
|
|
128
|
+
const a = s(n);
|
|
129
|
+
if (a === null)
|
|
130
|
+
return [];
|
|
131
|
+
i.id = a;
|
|
132
|
+
}
|
|
133
|
+
const o = u(t.current) ? t.current : {}, f = u(t.settings) ? t.settings : {};
|
|
134
|
+
return [{
|
|
135
|
+
...i,
|
|
136
|
+
current: o,
|
|
137
|
+
resourceSerialId: n,
|
|
138
|
+
settings: f
|
|
139
|
+
}];
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
export {
|
|
143
|
+
p as GCLICK_RT_DEVICES_RESOURCE_TYPE_ID,
|
|
144
|
+
A as RESOURCE_TYPE_DEVICES,
|
|
145
|
+
_ as createGClickRtDevicesRuntimeSnapshot,
|
|
146
|
+
C as createGClickRtDevicesStartupSnapshotMessages,
|
|
147
|
+
v as normalizeGClickRtDevicesRealtimeMessage,
|
|
148
|
+
M as withGClickResourceTypeMergeStrategies,
|
|
149
|
+
N as withGClickResourceTypeMergeStrategy
|
|
150
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RealTimeResourceSourceMechanismConfigBase } from '@m4l/realtime-runtime/shared';
|
|
2
|
+
type GClickResourceTypeConfigWithMergeStrategy<TConfig extends RealTimeResourceSourceMechanismConfigBase> = TConfig & Pick<RealTimeResourceSourceMechanismConfigBase, 'mergePayloadStrategy'>;
|
|
3
|
+
/**
|
|
4
|
+
* Attach the default GClick merge strategy for one resource type when the caller did not provide one.
|
|
5
|
+
*/
|
|
6
|
+
export declare function withGClickResourceTypeMergeStrategy<TConfig extends RealTimeResourceSourceMechanismConfigBase>(config: TConfig): GClickResourceTypeConfigWithMergeStrategy<TConfig>;
|
|
7
|
+
/**
|
|
8
|
+
* Attach default GClick merge strategies to all configured realtime resource types.
|
|
9
|
+
*/
|
|
10
|
+
export declare function withGClickResourceTypeMergeStrategies<TConfig extends RealTimeResourceSourceMechanismConfigBase>(resourceTypesConfig: TConfig[]): GClickResourceTypeConfigWithMergeStrategy<TConfig>[];
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=resourceTypeMergeStrategies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceTypeMergeStrategies.d.ts","sourceRoot":"","sources":["../../../../../packages/gclick-realtime/src/rt_devices/resourceTypeMergeStrategies.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,yCAAyC,EAE1C,MAAM,8BAA8B,CAAC;AAUtC,KAAK,yCAAyC,CAC5C,OAAO,SAAS,yCAAyC,IACvD,OAAO,GAAG,IAAI,CAChB,yCAAyC,EACzC,sBAAsB,CACvB,CAAC;AAEF;;GAEG;AACH,wBAAgB,mCAAmC,CACjD,OAAO,SAAS,yCAAyC,EACzD,MAAM,EAAE,OAAO,GAAG,yCAAyC,CAAC,OAAO,CAAC,CAYrE;AAED;;GAEG;AACH,wBAAgB,qCAAqC,CACnD,OAAO,SAAS,yCAAyC,EAEzD,mBAAmB,EAAE,OAAO,EAAE,GAC7B,yCAAyC,CAAC,OAAO,CAAC,EAAE,CAEtD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { mergeDevicePayloadWithUpdatedAtGuard as t } from "../payload/mergeDevicePayloadWithUpdatedAtGuard.js";
|
|
2
|
+
import { RESOURCE_TYPE_DEVICES as a } from "./constants.js";
|
|
3
|
+
const o = {
|
|
4
|
+
[a]: t
|
|
5
|
+
};
|
|
6
|
+
function E(e) {
|
|
7
|
+
const r = o[e.resourceTypeId];
|
|
8
|
+
return !r || e.mergePayloadStrategy ? e : {
|
|
9
|
+
...e,
|
|
10
|
+
mergePayloadStrategy: r
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function y(e) {
|
|
14
|
+
return e.map(E);
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
y as withGClickResourceTypeMergeStrategies,
|
|
18
|
+
E as withGClickResourceTypeMergeStrategy
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atmosphereHost.d.ts","sourceRoot":"","sources":["../../../../../packages/gclick-realtime/src/shared/atmosphereHost.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,mCAAmC,CAAC,aAAa,EAAE,MAAM,UAMxE"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { REALTIME_PERFORMANCE_WINDOW_MS, createRealtimePerformanceMetric, createRealtimePerformanceMetricsAccumulator, createRealtimePerformanceMetricsState, normalizeRealtimePerformanceMetricValue, rollRealtimePerformanceWindow, } from './performanceMetrics';
|
|
2
|
+
export type { CreateRealtimePerformanceMetricsAccumulatorProps, RealtimePerformanceMetric, RealtimePerformanceMetricId, RealtimePerformanceMetricsAccumulator, RealtimePerformanceMetricsState, ResetRealtimePerformanceMetricsAccumulatorOptions, } from './performanceMetrics';
|
|
3
|
+
export { createGClickRealtimeResourceTypesKeySegment, } from './runtimeResourceTypesKey';
|
|
4
|
+
export type { GClickRealtimeRuntimeResourceTypeKeyInput, } from './runtimeResourceTypesKey';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/gclick-realtime/src/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,+BAA+B,EAC/B,2CAA2C,EAC3C,qCAAqC,EACrC,uCAAuC,EACvC,6BAA6B,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,gDAAgD,EAChD,yBAAyB,EACzB,2BAA2B,EAC3B,qCAAqC,EACrC,+BAA+B,EAC/B,iDAAiD,GAClD,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,2CAA2C,GAC5C,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,yCAAyC,GAC1C,MAAM,2BAA2B,CAAC"}
|
package/shared/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { REALTIME_PERFORMANCE_WINDOW_MS as t, createRealtimePerformanceMetric as a, createRealtimePerformanceMetricsAccumulator as c, createRealtimePerformanceMetricsState as m, normalizeRealtimePerformanceMetricValue as o, rollRealtimePerformanceWindow as i } from "./performanceMetrics.js";
|
|
2
|
+
import { createGClickRealtimeResourceTypesKeySegment as R } from "./runtimeResourceTypesKey.js";
|
|
3
|
+
export {
|
|
4
|
+
t as REALTIME_PERFORMANCE_WINDOW_MS,
|
|
5
|
+
R as createGClickRealtimeResourceTypesKeySegment,
|
|
6
|
+
a as createRealtimePerformanceMetric,
|
|
7
|
+
c as createRealtimePerformanceMetricsAccumulator,
|
|
8
|
+
m as createRealtimePerformanceMetricsState,
|
|
9
|
+
o as normalizeRealtimePerformanceMetricValue,
|
|
10
|
+
i as rollRealtimePerformanceWindow
|
|
11
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { RealTimeProducerMetricName } from '@m4l/realtime-runtime/shared';
|
|
2
|
+
export declare const REALTIME_PERFORMANCE_WINDOW_MS = 1000;
|
|
3
|
+
export type RealtimePerformanceMetricId = RealTimeProducerMetricName | 'consumerActiveStoreCount' | 'consumerActiveSubscriptionCount' | 'consumerIncomingBatch' | 'consumerDrainSet' | 'consumerQueueLength' | 'consumerResourceCount' | 'consumerSnapshotResourceCount' | 'consumerSnapshotApplyDurationMs' | 'consumerSnapshotChunkCount' | 'consumerSnapshotChunkSize' | 'consumerSnapshotYieldCount' | 'consumerApplyNotifyDurationMs' | 'consumerProcessDurationMs';
|
|
4
|
+
export interface RealtimePerformanceMetric {
|
|
5
|
+
lastBatchSize: number;
|
|
6
|
+
lastEventAt: number;
|
|
7
|
+
lastValue: number;
|
|
8
|
+
lastWindowDurationMs: number;
|
|
9
|
+
perSecondCount: number;
|
|
10
|
+
perSecondItems: number;
|
|
11
|
+
perSecondMaxBatchSize: number;
|
|
12
|
+
perSecondMaxValue: number;
|
|
13
|
+
perSecondValue: number;
|
|
14
|
+
totalCount: number;
|
|
15
|
+
totalItems: number;
|
|
16
|
+
totalMaxBatchSize: number;
|
|
17
|
+
totalMaxValue: number;
|
|
18
|
+
totalValue: number;
|
|
19
|
+
windowCount: number;
|
|
20
|
+
windowItems: number;
|
|
21
|
+
windowMaxBatchSize: number;
|
|
22
|
+
windowMaxValue: number;
|
|
23
|
+
windowStartedAt: number;
|
|
24
|
+
windowValue: number;
|
|
25
|
+
}
|
|
26
|
+
export interface RealtimePerformanceMetricsState<TMetricId extends string = RealtimePerformanceMetricId> {
|
|
27
|
+
metrics: Partial<Record<TMetricId, RealtimePerformanceMetric>>;
|
|
28
|
+
updatedAt: number;
|
|
29
|
+
}
|
|
30
|
+
export interface CreateRealtimePerformanceMetricsAccumulatorProps<TMetricId extends string = RealtimePerformanceMetricId> {
|
|
31
|
+
initialState?: RealtimePerformanceMetricsState<TMetricId>;
|
|
32
|
+
now?: () => number;
|
|
33
|
+
onChange?: (state: RealtimePerformanceMetricsState<TMetricId>, metricId?: TMetricId) => void;
|
|
34
|
+
windowMs?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface RealtimePerformanceMetricsAccumulator<TMetricId extends string = RealtimePerformanceMetricId> {
|
|
37
|
+
getState: () => RealtimePerformanceMetricsState<TMetricId>;
|
|
38
|
+
recordMetric: (metricId: TMetricId, value?: number) => RealtimePerformanceMetricsState<TMetricId>;
|
|
39
|
+
reset: (options?: ResetRealtimePerformanceMetricsAccumulatorOptions) => RealtimePerformanceMetricsState<TMetricId>;
|
|
40
|
+
}
|
|
41
|
+
export interface ResetRealtimePerformanceMetricsAccumulatorOptions {
|
|
42
|
+
notify?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Create one empty realtime performance state for platform-specific sinks.
|
|
46
|
+
*/
|
|
47
|
+
export declare function createRealtimePerformanceMetricsState<TMetricId extends string = RealtimePerformanceMetricId>(now: number): RealtimePerformanceMetricsState<TMetricId>;
|
|
48
|
+
/**
|
|
49
|
+
* Normalize one metric sample while preserving fractional duration values.
|
|
50
|
+
*/
|
|
51
|
+
export declare function normalizeRealtimePerformanceMetricValue(value: number): number;
|
|
52
|
+
/**
|
|
53
|
+
* Create one rolling metric bucket for a realtime performance accumulator.
|
|
54
|
+
*/
|
|
55
|
+
export declare function createRealtimePerformanceMetric(now: number, windowMs?: number): RealtimePerformanceMetric;
|
|
56
|
+
/**
|
|
57
|
+
* Move completed samples into the per-second fields when the active window expires.
|
|
58
|
+
*/
|
|
59
|
+
export declare function rollRealtimePerformanceWindow(metric: RealtimePerformanceMetric, now: number, windowMs?: number): void;
|
|
60
|
+
/**
|
|
61
|
+
* Create one platform-neutral rolling metrics accumulator.
|
|
62
|
+
*/
|
|
63
|
+
export declare function createRealtimePerformanceMetricsAccumulator<TMetricId extends string = RealtimePerformanceMetricId>(props?: CreateRealtimePerformanceMetricsAccumulatorProps<TMetricId>): RealtimePerformanceMetricsAccumulator<TMetricId>;
|
|
64
|
+
//# sourceMappingURL=performanceMetrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"performanceMetrics.d.ts","sourceRoot":"","sources":["../../../../../packages/gclick-realtime/src/shared/performanceMetrics.ts"],"names":[],"mappings":"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"}
|