@camstack/server 0.1.7 → 0.1.8
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/package.json +3 -3
- package/src/__tests__/cap-providers/cap-providers-location-import.spec.ts +186 -0
- package/src/__tests__/cap-providers/integrations-delete-cascade.spec.ts +243 -0
- package/src/__tests__/cap-routers/broker-routing.router.spec.ts +169 -0
- package/src/__tests__/cap-routers/device-link-overlay.spec.ts +132 -0
- package/src/__tests__/moleculer/uds-unowned-call.spec.ts +209 -3
- package/src/api/core/__tests__/integration-markers.spec.ts +10 -0
- package/src/api/core/cap-providers.ts +152 -3
- package/src/api/core/logs.router.ts +4 -0
- package/src/api/trpc/__tests__/client-ip.spec.ts +27 -1
- package/src/api/trpc/__tests__/webrtc-session-ua-enrich.spec.ts +128 -0
- package/src/api/trpc/cap-mount-helpers.ts +12 -1
- package/src/api/trpc/client-ip.ts +17 -0
- package/src/api/trpc/generated-cap-mounts.ts +281 -8
- package/src/api/trpc/generated-cap-routers.ts +2087 -184
- package/src/api/trpc/trpc.router.ts +43 -7
- package/src/boot/__tests__/integration-id-backfill.spec.ts +116 -0
- package/src/boot/integration-id-backfill.ts +109 -0
- package/src/core/addon/__tests__/addon-row-manifest.spec.ts +62 -0
- package/src/core/addon/addon-registry.service.ts +89 -2
- package/src/core/addon/addon-row-manifest.ts +29 -0
- package/src/core/logging/logging.service.ts +7 -2
- package/src/core/moleculer/moleculer.service.ts +28 -0
- package/src/core/network/network-quality.service.spec.ts +2 -1
- package/src/main.ts +92 -0
- package/src/core/storage/settings-store.spec.ts +0 -213
- package/src/core/storage/settings-store.ts +0 -2
- package/src/core/storage/sql-schema.spec.ts +0 -140
- package/src/core/storage/sql-schema.ts +0 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// AUTO-GENERATED by scripts/generate-cap-routers.ts — DO NOT EDIT
|
|
2
2
|
// Re-run: npx tsx scripts/generate-cap-routers.ts
|
|
3
3
|
//
|
|
4
|
-
// Capabilities:
|
|
4
|
+
// Capabilities: 129
|
|
5
5
|
/* eslint-disable */
|
|
6
6
|
|
|
7
7
|
import { TRPCError } from '@trpc/server'
|
|
@@ -23,20 +23,36 @@ import { addonWidgetsSourceCapability } from '@camstack/types'
|
|
|
23
23
|
import { addonsCapability } from '@camstack/types'
|
|
24
24
|
import { adminUiCapability } from '@camstack/types'
|
|
25
25
|
import { advancedNotifierCapability } from '@camstack/types'
|
|
26
|
+
import { airQualitySensorCapability } from '@camstack/types'
|
|
27
|
+
import { alarmPanelCapability } from '@camstack/types'
|
|
26
28
|
import { alertsCapability } from '@camstack/types'
|
|
29
|
+
import { ambientLightSensorCapability } from '@camstack/types'
|
|
27
30
|
import { audioAnalysisCapability } from '@camstack/types'
|
|
28
31
|
import { audioAnalyzerCapability } from '@camstack/types'
|
|
29
32
|
import { audioCodecCapability } from '@camstack/types'
|
|
30
33
|
import { audioMetricsCapability } from '@camstack/types'
|
|
31
34
|
import { authProviderCapability } from '@camstack/types'
|
|
35
|
+
import { automationControlCapability } from '@camstack/types'
|
|
32
36
|
import { backupCapability } from '@camstack/types'
|
|
33
37
|
import { batteryCapability } from '@camstack/types'
|
|
38
|
+
import { binaryCapability } from '@camstack/types'
|
|
34
39
|
import { brightnessCapability } from '@camstack/types'
|
|
40
|
+
import { brokerCapability } from '@camstack/types'
|
|
41
|
+
import { buttonCapability } from '@camstack/types'
|
|
35
42
|
import { cameraCredentialsCapability } from '@camstack/types'
|
|
36
43
|
import { cameraPipelineConfigCapability } from '@camstack/types'
|
|
37
44
|
import { cameraStreamsCapability } from '@camstack/types'
|
|
45
|
+
import { carbonMonoxideCapability } from '@camstack/types'
|
|
46
|
+
import { climateControlCapability } from '@camstack/types'
|
|
47
|
+
import { colorCapability } from '@camstack/types'
|
|
48
|
+
import { connectivityCapability } from '@camstack/types'
|
|
49
|
+
import { consumablesCapability } from '@camstack/types'
|
|
50
|
+
import { contactCapability } from '@camstack/types'
|
|
51
|
+
import { controlCapability } from '@camstack/types'
|
|
52
|
+
import { coverCapability } from '@camstack/types'
|
|
38
53
|
import { decoderCapability } from '@camstack/types'
|
|
39
54
|
import { detectionPipelineCapability } from '@camstack/types'
|
|
55
|
+
import { deviceAdoptionCapability } from '@camstack/types'
|
|
40
56
|
import { deviceDiscoveryCapability } from '@camstack/types'
|
|
41
57
|
import { deviceExportCapability } from '@camstack/types'
|
|
42
58
|
import { deviceManagerCapability } from '@camstack/types'
|
|
@@ -46,12 +62,23 @@ import { deviceStateCapability } from '@camstack/types'
|
|
|
46
62
|
import { deviceStatusCapability } from '@camstack/types'
|
|
47
63
|
import { doorbellCapability } from '@camstack/types'
|
|
48
64
|
import { embeddingEncoderCapability } from '@camstack/types'
|
|
65
|
+
import { enumSensorCapability } from '@camstack/types'
|
|
66
|
+
import { eventEmitterCapability } from '@camstack/types'
|
|
49
67
|
import { eventsCapability } from '@camstack/types'
|
|
68
|
+
import { fanControlCapability } from '@camstack/types'
|
|
50
69
|
import { featureProbeCapability } from '@camstack/types'
|
|
70
|
+
import { floodCapability } from '@camstack/types'
|
|
71
|
+
import { gasCapability } from '@camstack/types'
|
|
72
|
+
import { humidifierCapability } from '@camstack/types'
|
|
73
|
+
import { humiditySensorCapability } from '@camstack/types'
|
|
74
|
+
import { imageCapability } from '@camstack/types'
|
|
51
75
|
import { integrationsCapability } from '@camstack/types'
|
|
52
76
|
import { intercomCapability } from '@camstack/types'
|
|
77
|
+
import { lawnMowerControlCapability } from '@camstack/types'
|
|
53
78
|
import { localNetworkCapability } from '@camstack/types'
|
|
79
|
+
import { lockControlCapability } from '@camstack/types'
|
|
54
80
|
import { logDestinationCapability } from '@camstack/types'
|
|
81
|
+
import { mediaPlayerCapability } from '@camstack/types'
|
|
55
82
|
import { meshNetworkCapability } from '@camstack/types'
|
|
56
83
|
import { metricsProviderCapability } from '@camstack/types'
|
|
57
84
|
import { motionCapability } from '@camstack/types'
|
|
@@ -64,6 +91,8 @@ import { networkAccessCapability } from '@camstack/types'
|
|
|
64
91
|
import { networkQualityCapability } from '@camstack/types'
|
|
65
92
|
import { nodesCapability } from '@camstack/types'
|
|
66
93
|
import { notificationOutputCapability } from '@camstack/types'
|
|
94
|
+
import { notifierCapability } from '@camstack/types'
|
|
95
|
+
import { numericSensorCapability } from '@camstack/types'
|
|
67
96
|
import { oauthIntegrationCapability } from '@camstack/types'
|
|
68
97
|
import { osdCapability } from '@camstack/types'
|
|
69
98
|
import { pipelineAnalyticsCapability } from '@camstack/types'
|
|
@@ -71,19 +100,24 @@ import { pipelineExecutorCapability } from '@camstack/types'
|
|
|
71
100
|
import { pipelineOrchestratorCapability } from '@camstack/types'
|
|
72
101
|
import { pipelineRunnerCapability } from '@camstack/types'
|
|
73
102
|
import { platformProbeCapability } from '@camstack/types'
|
|
103
|
+
import { powerMeterCapability } from '@camstack/types'
|
|
104
|
+
import { presenceCapability } from '@camstack/types'
|
|
105
|
+
import { pressureSensorCapability } from '@camstack/types'
|
|
74
106
|
import { privacyMaskCapability } from '@camstack/types'
|
|
75
107
|
import { ptzCapability } from '@camstack/types'
|
|
76
108
|
import { ptzAutotrackCapability } from '@camstack/types'
|
|
77
109
|
import { rebootCapability } from '@camstack/types'
|
|
78
110
|
import { recordingCapability } from '@camstack/types'
|
|
79
|
-
import { recordingEngineCapability } from '@camstack/types'
|
|
80
111
|
import { restreamerCapability } from '@camstack/types'
|
|
112
|
+
import { scriptRunnerCapability } from '@camstack/types'
|
|
81
113
|
import { settingsStoreCapability } from '@camstack/types'
|
|
114
|
+
import { smokeCapability } from '@camstack/types'
|
|
82
115
|
import { smtpProviderCapability } from '@camstack/types'
|
|
83
116
|
import { snapshotCapability } from '@camstack/types'
|
|
84
117
|
import { snapshotProviderCapability } from '@camstack/types'
|
|
85
118
|
import { ssoBridgeCapability } from '@camstack/types'
|
|
86
119
|
import { storageCapability } from '@camstack/types'
|
|
120
|
+
import { storageEvictableCapability } from '@camstack/types'
|
|
87
121
|
import { storageProviderCapability } from '@camstack/types'
|
|
88
122
|
import { streamBrokerCapability } from '@camstack/types'
|
|
89
123
|
import { streamCatalogCapability } from '@camstack/types'
|
|
@@ -91,10 +125,18 @@ import { streamParamsCapability } from '@camstack/types'
|
|
|
91
125
|
import { streamingEngineCapability } from '@camstack/types'
|
|
92
126
|
import { switchCapability } from '@camstack/types'
|
|
93
127
|
import { systemCapability } from '@camstack/types'
|
|
128
|
+
import { tamperCapability } from '@camstack/types'
|
|
129
|
+
import { temperatureSensorCapability } from '@camstack/types'
|
|
94
130
|
import { toastCapability } from '@camstack/types'
|
|
95
131
|
import { turnProviderCapability } from '@camstack/types'
|
|
132
|
+
import { updateCapability } from '@camstack/types'
|
|
96
133
|
import { userManagementCapability } from '@camstack/types'
|
|
97
134
|
import { userPasskeysCapability } from '@camstack/types'
|
|
135
|
+
import { vacuumControlCapability } from '@camstack/types'
|
|
136
|
+
import { valveCapability } from '@camstack/types'
|
|
137
|
+
import { vibrationCapability } from '@camstack/types'
|
|
138
|
+
import { waterHeaterCapability } from '@camstack/types'
|
|
139
|
+
import { weatherCapability } from '@camstack/types'
|
|
98
140
|
import { webrtcCapability } from '@camstack/types'
|
|
99
141
|
import { webrtcSessionCapability } from '@camstack/types'
|
|
100
142
|
import { zoneAnalyticsCapability } from '@camstack/types'
|
|
@@ -191,6 +233,15 @@ export function createCapRouter_accessories(
|
|
|
191
233
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
192
234
|
return p.getStatus(methodInput as any)
|
|
193
235
|
}),
|
|
236
|
+
setChildHidden: adminProcedure
|
|
237
|
+
.input(accessoriesCapability.methods.setChildHidden.input.loose())
|
|
238
|
+
.output(accessoriesCapability.methods.setChildHidden.output)
|
|
239
|
+
.mutation(async ({ input, ctx }) => {
|
|
240
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
241
|
+
const p = resolveProvider('accessories', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
242
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
243
|
+
return p.setChildHidden(methodInput as any)
|
|
244
|
+
}),
|
|
194
245
|
})
|
|
195
246
|
}
|
|
196
247
|
|
|
@@ -707,6 +758,75 @@ export function createCapRouter_advancedNotifier(
|
|
|
707
758
|
})
|
|
708
759
|
}
|
|
709
760
|
|
|
761
|
+
// ── air-quality-sensor (singleton) ──────────────────────────────────
|
|
762
|
+
|
|
763
|
+
type AirQualitySensorProvider = InferProvider<typeof airQualitySensorCapability>
|
|
764
|
+
|
|
765
|
+
export function createCapRouter_airQualitySensor(
|
|
766
|
+
getProvider: (ctx: TrpcContext) => AirQualitySensorProvider | null,
|
|
767
|
+
createRemoteProxy?: (capName: string, nodeId: string) => AirQualitySensorProvider | null,
|
|
768
|
+
) {
|
|
769
|
+
return trpcRouter({
|
|
770
|
+
getStatus: protectedProcedure
|
|
771
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
772
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
773
|
+
.query(async ({ input, ctx }) => {
|
|
774
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
775
|
+
const p = resolveProvider('air-quality-sensor', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
776
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
777
|
+
return p.getStatus(methodInput as any)
|
|
778
|
+
}),
|
|
779
|
+
})
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
// ── alarm-panel (singleton) ─────────────────────────────────────────
|
|
783
|
+
|
|
784
|
+
type AlarmPanelProvider = InferProvider<typeof alarmPanelCapability>
|
|
785
|
+
|
|
786
|
+
export function createCapRouter_alarmPanel(
|
|
787
|
+
getProvider: (ctx: TrpcContext) => AlarmPanelProvider | null,
|
|
788
|
+
createRemoteProxy?: (capName: string, nodeId: string) => AlarmPanelProvider | null,
|
|
789
|
+
) {
|
|
790
|
+
return trpcRouter({
|
|
791
|
+
getStatus: protectedProcedure
|
|
792
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
793
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
794
|
+
.query(async ({ input, ctx }) => {
|
|
795
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
796
|
+
const p = resolveProvider('alarm-panel', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
797
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
798
|
+
return p.getStatus(methodInput as any)
|
|
799
|
+
}),
|
|
800
|
+
arm: adminProcedure
|
|
801
|
+
.input(alarmPanelCapability.methods.arm.input.loose())
|
|
802
|
+
.output(alarmPanelCapability.methods.arm.output)
|
|
803
|
+
.mutation(async ({ input, ctx }) => {
|
|
804
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
805
|
+
const p = resolveProvider('alarm-panel', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
806
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
807
|
+
return p.arm(methodInput as any)
|
|
808
|
+
}),
|
|
809
|
+
disarm: adminProcedure
|
|
810
|
+
.input(alarmPanelCapability.methods.disarm.input.loose())
|
|
811
|
+
.output(alarmPanelCapability.methods.disarm.output)
|
|
812
|
+
.mutation(async ({ input, ctx }) => {
|
|
813
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
814
|
+
const p = resolveProvider('alarm-panel', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
815
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
816
|
+
return p.disarm(methodInput as any)
|
|
817
|
+
}),
|
|
818
|
+
trigger: adminProcedure
|
|
819
|
+
.input(alarmPanelCapability.methods.trigger.input.loose())
|
|
820
|
+
.output(alarmPanelCapability.methods.trigger.output)
|
|
821
|
+
.mutation(async ({ input, ctx }) => {
|
|
822
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
823
|
+
const p = resolveProvider('alarm-panel', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
824
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
825
|
+
return p.trigger(methodInput as any)
|
|
826
|
+
}),
|
|
827
|
+
})
|
|
828
|
+
}
|
|
829
|
+
|
|
710
830
|
// ── alerts (singleton) ──────────────────────────────────────────────
|
|
711
831
|
|
|
712
832
|
type AlertsProvider = InferProvider<typeof alertsCapability>
|
|
@@ -776,6 +896,27 @@ export function createCapRouter_alerts(
|
|
|
776
896
|
})
|
|
777
897
|
}
|
|
778
898
|
|
|
899
|
+
// ── ambient-light-sensor (singleton) ────────────────────────────────
|
|
900
|
+
|
|
901
|
+
type AmbientLightSensorProvider = InferProvider<typeof ambientLightSensorCapability>
|
|
902
|
+
|
|
903
|
+
export function createCapRouter_ambientLightSensor(
|
|
904
|
+
getProvider: (ctx: TrpcContext) => AmbientLightSensorProvider | null,
|
|
905
|
+
createRemoteProxy?: (capName: string, nodeId: string) => AmbientLightSensorProvider | null,
|
|
906
|
+
) {
|
|
907
|
+
return trpcRouter({
|
|
908
|
+
getStatus: protectedProcedure
|
|
909
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
910
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
911
|
+
.query(async ({ input, ctx }) => {
|
|
912
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
913
|
+
const p = resolveProvider('ambient-light-sensor', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
914
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
915
|
+
return p.getStatus(methodInput as any)
|
|
916
|
+
}),
|
|
917
|
+
})
|
|
918
|
+
}
|
|
919
|
+
|
|
779
920
|
// ── audio-analysis (singleton) ──────────────────────────────────────
|
|
780
921
|
|
|
781
922
|
type AudioAnalysisProvider = InferProvider<typeof audioAnalysisCapability>
|
|
@@ -1058,6 +1199,54 @@ export function createCapRouter_authProvider(
|
|
|
1058
1199
|
})
|
|
1059
1200
|
}
|
|
1060
1201
|
|
|
1202
|
+
// ── automation-control (singleton) ──────────────────────────────────
|
|
1203
|
+
|
|
1204
|
+
type AutomationControlProvider = InferProvider<typeof automationControlCapability>
|
|
1205
|
+
|
|
1206
|
+
export function createCapRouter_automationControl(
|
|
1207
|
+
getProvider: (ctx: TrpcContext) => AutomationControlProvider | null,
|
|
1208
|
+
createRemoteProxy?: (capName: string, nodeId: string) => AutomationControlProvider | null,
|
|
1209
|
+
) {
|
|
1210
|
+
return trpcRouter({
|
|
1211
|
+
getStatus: protectedProcedure
|
|
1212
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
1213
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
1214
|
+
.query(async ({ input, ctx }) => {
|
|
1215
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1216
|
+
const p = resolveProvider('automation-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1217
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1218
|
+
return p.getStatus(methodInput as any)
|
|
1219
|
+
}),
|
|
1220
|
+
enable: adminProcedure
|
|
1221
|
+
.input(automationControlCapability.methods.enable.input.loose())
|
|
1222
|
+
.output(automationControlCapability.methods.enable.output)
|
|
1223
|
+
.mutation(async ({ input, ctx }) => {
|
|
1224
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1225
|
+
const p = resolveProvider('automation-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1226
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1227
|
+
return p.enable(methodInput as any)
|
|
1228
|
+
}),
|
|
1229
|
+
disable: adminProcedure
|
|
1230
|
+
.input(automationControlCapability.methods.disable.input.loose())
|
|
1231
|
+
.output(automationControlCapability.methods.disable.output)
|
|
1232
|
+
.mutation(async ({ input, ctx }) => {
|
|
1233
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1234
|
+
const p = resolveProvider('automation-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1235
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1236
|
+
return p.disable(methodInput as any)
|
|
1237
|
+
}),
|
|
1238
|
+
trigger: adminProcedure
|
|
1239
|
+
.input(automationControlCapability.methods.trigger.input.loose())
|
|
1240
|
+
.output(automationControlCapability.methods.trigger.output)
|
|
1241
|
+
.mutation(async ({ input, ctx }) => {
|
|
1242
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1243
|
+
const p = resolveProvider('automation-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1244
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1245
|
+
return p.trigger(methodInput as any)
|
|
1246
|
+
}),
|
|
1247
|
+
})
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1061
1250
|
// ── backup (singleton) ──────────────────────────────────────────────
|
|
1062
1251
|
|
|
1063
1252
|
type BackupProvider = InferProvider<typeof backupCapability>
|
|
@@ -1170,6 +1359,36 @@ export function createCapRouter_battery(
|
|
|
1170
1359
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1171
1360
|
return p.getStatus(methodInput as any)
|
|
1172
1361
|
}),
|
|
1362
|
+
wakeForStream: protectedProcedure
|
|
1363
|
+
.input(batteryCapability.methods.wakeForStream.input.loose())
|
|
1364
|
+
.output(batteryCapability.methods.wakeForStream.output)
|
|
1365
|
+
.mutation(async ({ input, ctx }) => {
|
|
1366
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1367
|
+
const p = resolveProvider('battery', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1368
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1369
|
+
return p.wakeForStream(methodInput as any)
|
|
1370
|
+
}),
|
|
1371
|
+
})
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
// ── binary (singleton) ──────────────────────────────────────────────
|
|
1375
|
+
|
|
1376
|
+
type BinaryProvider = InferProvider<typeof binaryCapability>
|
|
1377
|
+
|
|
1378
|
+
export function createCapRouter_binary(
|
|
1379
|
+
getProvider: (ctx: TrpcContext) => BinaryProvider | null,
|
|
1380
|
+
createRemoteProxy?: (capName: string, nodeId: string) => BinaryProvider | null,
|
|
1381
|
+
) {
|
|
1382
|
+
return trpcRouter({
|
|
1383
|
+
getStatus: protectedProcedure
|
|
1384
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
1385
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
1386
|
+
.query(async ({ input, ctx }) => {
|
|
1387
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1388
|
+
const p = resolveProvider('binary', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1389
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1390
|
+
return p.getStatus(methodInput as any)
|
|
1391
|
+
}),
|
|
1173
1392
|
})
|
|
1174
1393
|
}
|
|
1175
1394
|
|
|
@@ -1203,6 +1422,179 @@ export function createCapRouter_brightness(
|
|
|
1203
1422
|
})
|
|
1204
1423
|
}
|
|
1205
1424
|
|
|
1425
|
+
// ── broker (collection) ──────────────────────────────────────────────
|
|
1426
|
+
|
|
1427
|
+
type BrokerProvider = InferProvider<typeof brokerCapability>
|
|
1428
|
+
|
|
1429
|
+
export function createCapRouter_broker(
|
|
1430
|
+
getProvider: (ctx: TrpcContext, addonId?: string) => BrokerProvider | null,
|
|
1431
|
+
createRemoteProxy?: (capName: string, nodeId: string) => BrokerProvider | null,
|
|
1432
|
+
) {
|
|
1433
|
+
return trpcRouter({
|
|
1434
|
+
getStatus: protectedProcedure
|
|
1435
|
+
.input(z.object({ nodeId: z.string().optional(), addonId: z.string().optional() }).optional())
|
|
1436
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
1437
|
+
.query(async ({ input, ctx }) => {
|
|
1438
|
+
const p = resolveProvider('broker', input?.nodeId, () => getProvider(ctx, input?.addonId), createRemoteProxy)
|
|
1439
|
+
return p.getStatus()
|
|
1440
|
+
}),
|
|
1441
|
+
list: protectedProcedure
|
|
1442
|
+
.input(brokerCapability.methods.list.input.loose())
|
|
1443
|
+
.output(brokerCapability.methods.list.output)
|
|
1444
|
+
.query(async ({ input, ctx }) => {
|
|
1445
|
+
const { nodeId, addonId, ...methodInput } = input as { nodeId?: string; addonId?: string } & Record<string, unknown>
|
|
1446
|
+
const p = resolveProvider('broker', nodeId, () => getProvider(ctx, addonId), createRemoteProxy)
|
|
1447
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1448
|
+
return p.list(methodInput as any)
|
|
1449
|
+
}),
|
|
1450
|
+
get: protectedProcedure
|
|
1451
|
+
.input(brokerCapability.methods.get.input.loose())
|
|
1452
|
+
.output(brokerCapability.methods.get.output)
|
|
1453
|
+
.query(async ({ input, ctx }) => {
|
|
1454
|
+
const { nodeId, addonId, ...methodInput } = input as { nodeId?: string; addonId?: string } & Record<string, unknown>
|
|
1455
|
+
const p = resolveProvider('broker', nodeId, () => getProvider(ctx, addonId), createRemoteProxy)
|
|
1456
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1457
|
+
return p.get(methodInput as any)
|
|
1458
|
+
}),
|
|
1459
|
+
listProviders: adminProcedure
|
|
1460
|
+
.input(z.object({ nodeId: z.string().optional(), addonId: z.string().optional() }).optional())
|
|
1461
|
+
.output(brokerCapability.methods.listProviders.output)
|
|
1462
|
+
.query(async ({ input, ctx }) => {
|
|
1463
|
+
const p = resolveProvider('broker', input?.nodeId, () => getProvider(ctx, input?.addonId), createRemoteProxy)
|
|
1464
|
+
return p.listProviders()
|
|
1465
|
+
}),
|
|
1466
|
+
add: adminProcedure
|
|
1467
|
+
.input(brokerCapability.methods.add.input.loose())
|
|
1468
|
+
.output(brokerCapability.methods.add.output)
|
|
1469
|
+
.mutation(async ({ input, ctx }) => {
|
|
1470
|
+
const { nodeId, addonId, ...methodInput } = input as { nodeId?: string; addonId?: string } & Record<string, unknown>
|
|
1471
|
+
const p = resolveProvider('broker', nodeId, () => getProvider(ctx, addonId), createRemoteProxy)
|
|
1472
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1473
|
+
return p.add(methodInput as any)
|
|
1474
|
+
}),
|
|
1475
|
+
remove: adminProcedure
|
|
1476
|
+
.input(brokerCapability.methods.remove.input.loose())
|
|
1477
|
+
.output(brokerCapability.methods.remove.output)
|
|
1478
|
+
.mutation(async ({ input, ctx }) => {
|
|
1479
|
+
const { nodeId, addonId, ...methodInput } = input as { nodeId?: string; addonId?: string } & Record<string, unknown>
|
|
1480
|
+
const p = resolveProvider('broker', nodeId, () => getProvider(ctx, addonId), createRemoteProxy)
|
|
1481
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1482
|
+
return p.remove(methodInput as any)
|
|
1483
|
+
}),
|
|
1484
|
+
testConnection: adminProcedure
|
|
1485
|
+
.input(brokerCapability.methods.testConnection.input.loose())
|
|
1486
|
+
.output(brokerCapability.methods.testConnection.output)
|
|
1487
|
+
.mutation(async ({ input, ctx }) => {
|
|
1488
|
+
const { nodeId, addonId, ...methodInput } = input as { nodeId?: string; addonId?: string } & Record<string, unknown>
|
|
1489
|
+
const p = resolveProvider('broker', nodeId, () => getProvider(ctx, addonId), createRemoteProxy)
|
|
1490
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1491
|
+
return p.testConnection(methodInput as any)
|
|
1492
|
+
}),
|
|
1493
|
+
getSettings: adminProcedure
|
|
1494
|
+
.input(brokerCapability.methods.getSettings.input.loose())
|
|
1495
|
+
.output(brokerCapability.methods.getSettings.output)
|
|
1496
|
+
.query(async ({ input, ctx }) => {
|
|
1497
|
+
const { nodeId, addonId, ...methodInput } = input as { nodeId?: string; addonId?: string } & Record<string, unknown>
|
|
1498
|
+
const p = resolveProvider('broker', nodeId, () => getProvider(ctx, addonId), createRemoteProxy)
|
|
1499
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1500
|
+
return p.getSettings(methodInput as any)
|
|
1501
|
+
}),
|
|
1502
|
+
setSettings: adminProcedure
|
|
1503
|
+
.input(brokerCapability.methods.setSettings.input.loose())
|
|
1504
|
+
.output(brokerCapability.methods.setSettings.output)
|
|
1505
|
+
.mutation(async ({ input, ctx }) => {
|
|
1506
|
+
const { nodeId, addonId, ...methodInput } = input as { nodeId?: string; addonId?: string } & Record<string, unknown>
|
|
1507
|
+
const p = resolveProvider('broker', nodeId, () => getProvider(ctx, addonId), createRemoteProxy)
|
|
1508
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1509
|
+
return p.setSettings(methodInput as any)
|
|
1510
|
+
}),
|
|
1511
|
+
getBrokerConfig: adminProcedure
|
|
1512
|
+
.input(brokerCapability.methods.getBrokerConfig.input.loose())
|
|
1513
|
+
.output(brokerCapability.methods.getBrokerConfig.output)
|
|
1514
|
+
.query(async ({ input, ctx }) => {
|
|
1515
|
+
const { nodeId, addonId, ...methodInput } = input as { nodeId?: string; addonId?: string } & Record<string, unknown>
|
|
1516
|
+
const p = resolveProvider('broker', nodeId, () => getProvider(ctx, addonId), createRemoteProxy)
|
|
1517
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1518
|
+
return p.getBrokerConfig(methodInput as any)
|
|
1519
|
+
}),
|
|
1520
|
+
getSettingsSchema: adminProcedure
|
|
1521
|
+
.input(brokerCapability.methods.getSettingsSchema.input.loose())
|
|
1522
|
+
.output(brokerCapability.methods.getSettingsSchema.output)
|
|
1523
|
+
.query(async ({ input, ctx }) => {
|
|
1524
|
+
const { nodeId, addonId, ...methodInput } = input as { nodeId?: string; addonId?: string } & Record<string, unknown>
|
|
1525
|
+
const p = resolveProvider('broker', nodeId, () => getProvider(ctx, addonId), createRemoteProxy)
|
|
1526
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1527
|
+
return p.getSettingsSchema(methodInput as any)
|
|
1528
|
+
}),
|
|
1529
|
+
testSettings: adminProcedure
|
|
1530
|
+
.input(brokerCapability.methods.testSettings.input.loose())
|
|
1531
|
+
.output(brokerCapability.methods.testSettings.output)
|
|
1532
|
+
.mutation(async ({ input, ctx }) => {
|
|
1533
|
+
const { nodeId, addonId, ...methodInput } = input as { nodeId?: string; addonId?: string } & Record<string, unknown>
|
|
1534
|
+
const p = resolveProvider('broker', nodeId, () => getProvider(ctx, addonId), createRemoteProxy)
|
|
1535
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1536
|
+
return p.testSettings(methodInput as any)
|
|
1537
|
+
}),
|
|
1538
|
+
publish: adminProcedure
|
|
1539
|
+
.input(brokerCapability.methods.publish.input.loose())
|
|
1540
|
+
.output(brokerCapability.methods.publish.output)
|
|
1541
|
+
.mutation(async ({ input, ctx }) => {
|
|
1542
|
+
const { nodeId, addonId, ...methodInput } = input as { nodeId?: string; addonId?: string } & Record<string, unknown>
|
|
1543
|
+
const p = resolveProvider('broker', nodeId, () => getProvider(ctx, addonId), createRemoteProxy)
|
|
1544
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1545
|
+
return p.publish(methodInput as any)
|
|
1546
|
+
}),
|
|
1547
|
+
subscribe: adminProcedure
|
|
1548
|
+
.input(brokerCapability.methods.subscribe.input.loose())
|
|
1549
|
+
.output(brokerCapability.methods.subscribe.output)
|
|
1550
|
+
.mutation(async ({ input, ctx }) => {
|
|
1551
|
+
const { nodeId, addonId, ...methodInput } = input as { nodeId?: string; addonId?: string } & Record<string, unknown>
|
|
1552
|
+
const p = resolveProvider('broker', nodeId, () => getProvider(ctx, addonId), createRemoteProxy)
|
|
1553
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1554
|
+
return p.subscribe(methodInput as any)
|
|
1555
|
+
}),
|
|
1556
|
+
unsubscribe: adminProcedure
|
|
1557
|
+
.input(brokerCapability.methods.unsubscribe.input.loose())
|
|
1558
|
+
.output(brokerCapability.methods.unsubscribe.output)
|
|
1559
|
+
.mutation(async ({ input, ctx }) => {
|
|
1560
|
+
const { nodeId, addonId, ...methodInput } = input as { nodeId?: string; addonId?: string } & Record<string, unknown>
|
|
1561
|
+
const p = resolveProvider('broker', nodeId, () => getProvider(ctx, addonId), createRemoteProxy)
|
|
1562
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1563
|
+
return p.unsubscribe(methodInput as any)
|
|
1564
|
+
}),
|
|
1565
|
+
getState: protectedProcedure
|
|
1566
|
+
.input(brokerCapability.methods.getState.input.loose())
|
|
1567
|
+
.output(brokerCapability.methods.getState.output)
|
|
1568
|
+
.query(async ({ input, ctx }) => {
|
|
1569
|
+
const { nodeId, addonId, ...methodInput } = input as { nodeId?: string; addonId?: string } & Record<string, unknown>
|
|
1570
|
+
const p = resolveProvider('broker', nodeId, () => getProvider(ctx, addonId), createRemoteProxy)
|
|
1571
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1572
|
+
return p.getState(methodInput as any)
|
|
1573
|
+
}),
|
|
1574
|
+
})
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
// ── button (singleton) ──────────────────────────────────────────────
|
|
1578
|
+
|
|
1579
|
+
type ButtonProvider = InferProvider<typeof buttonCapability>
|
|
1580
|
+
|
|
1581
|
+
export function createCapRouter_button(
|
|
1582
|
+
getProvider: (ctx: TrpcContext) => ButtonProvider | null,
|
|
1583
|
+
createRemoteProxy?: (capName: string, nodeId: string) => ButtonProvider | null,
|
|
1584
|
+
) {
|
|
1585
|
+
return trpcRouter({
|
|
1586
|
+
press: adminProcedure
|
|
1587
|
+
.input(buttonCapability.methods.press.input.loose())
|
|
1588
|
+
.output(buttonCapability.methods.press.output)
|
|
1589
|
+
.mutation(async ({ input, ctx }) => {
|
|
1590
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1591
|
+
const p = resolveProvider('button', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1592
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1593
|
+
return p.press(methodInput as any)
|
|
1594
|
+
}),
|
|
1595
|
+
})
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1206
1598
|
// ── camera-credentials (singleton) ──────────────────────────────────
|
|
1207
1599
|
|
|
1208
1600
|
type CameraCredentialsProvider = InferProvider<typeof cameraCredentialsCapability>
|
|
@@ -1308,35 +1700,347 @@ export function createCapRouter_cameraStreams(
|
|
|
1308
1700
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1309
1701
|
return p.getRtspEntries(methodInput as any)
|
|
1310
1702
|
}),
|
|
1703
|
+
getProfileRtspEntries: protectedProcedure
|
|
1704
|
+
.input(cameraStreamsCapability.methods.getProfileRtspEntries.input.loose())
|
|
1705
|
+
.output(cameraStreamsCapability.methods.getProfileRtspEntries.output)
|
|
1706
|
+
.query(async ({ input, ctx }) => {
|
|
1707
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1708
|
+
const p = resolveProvider('camera-streams', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1709
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1710
|
+
return p.getProfileRtspEntries(methodInput as any)
|
|
1711
|
+
}),
|
|
1712
|
+
pickStream: protectedProcedure
|
|
1713
|
+
.input(cameraStreamsCapability.methods.pickStream.input.loose())
|
|
1714
|
+
.output(cameraStreamsCapability.methods.pickStream.output)
|
|
1715
|
+
.query(async ({ input, ctx }) => {
|
|
1716
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1717
|
+
const p = resolveProvider('camera-streams', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1718
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1719
|
+
return p.pickStream(methodInput as any)
|
|
1720
|
+
}),
|
|
1311
1721
|
})
|
|
1312
1722
|
}
|
|
1313
1723
|
|
|
1314
|
-
// ──
|
|
1724
|
+
// ── carbon-monoxide (singleton) ─────────────────────────────────────
|
|
1315
1725
|
|
|
1316
|
-
type
|
|
1726
|
+
type CarbonMonoxideProvider = InferProvider<typeof carbonMonoxideCapability>
|
|
1317
1727
|
|
|
1318
|
-
export function
|
|
1319
|
-
getProvider: (ctx: TrpcContext) =>
|
|
1320
|
-
createRemoteProxy?: (capName: string, nodeId: string) =>
|
|
1728
|
+
export function createCapRouter_carbonMonoxide(
|
|
1729
|
+
getProvider: (ctx: TrpcContext) => CarbonMonoxideProvider | null,
|
|
1730
|
+
createRemoteProxy?: (capName: string, nodeId: string) => CarbonMonoxideProvider | null,
|
|
1321
1731
|
) {
|
|
1322
1732
|
return trpcRouter({
|
|
1323
|
-
|
|
1324
|
-
.input(
|
|
1325
|
-
.output(
|
|
1733
|
+
getStatus: protectedProcedure
|
|
1734
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
1735
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
1326
1736
|
.query(async ({ input, ctx }) => {
|
|
1327
1737
|
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1328
|
-
const p = resolveProvider('
|
|
1738
|
+
const p = resolveProvider('carbon-monoxide', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1329
1739
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1330
|
-
return p.
|
|
1740
|
+
return p.getStatus(methodInput as any)
|
|
1331
1741
|
}),
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1742
|
+
})
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
// ── climate-control (singleton) ─────────────────────────────────────
|
|
1746
|
+
|
|
1747
|
+
type ClimateControlProvider = InferProvider<typeof climateControlCapability>
|
|
1748
|
+
|
|
1749
|
+
export function createCapRouter_climateControl(
|
|
1750
|
+
getProvider: (ctx: TrpcContext) => ClimateControlProvider | null,
|
|
1751
|
+
createRemoteProxy?: (capName: string, nodeId: string) => ClimateControlProvider | null,
|
|
1752
|
+
) {
|
|
1753
|
+
return trpcRouter({
|
|
1754
|
+
getStatus: protectedProcedure
|
|
1755
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
1756
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
1335
1757
|
.query(async ({ input, ctx }) => {
|
|
1336
|
-
const
|
|
1337
|
-
|
|
1758
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1759
|
+
const p = resolveProvider('climate-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1760
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1761
|
+
return p.getStatus(methodInput as any)
|
|
1338
1762
|
}),
|
|
1339
|
-
|
|
1763
|
+
setMode: adminProcedure
|
|
1764
|
+
.input(climateControlCapability.methods.setMode.input.loose())
|
|
1765
|
+
.output(climateControlCapability.methods.setMode.output)
|
|
1766
|
+
.mutation(async ({ input, ctx }) => {
|
|
1767
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1768
|
+
const p = resolveProvider('climate-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1769
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1770
|
+
return p.setMode(methodInput as any)
|
|
1771
|
+
}),
|
|
1772
|
+
setFanMode: adminProcedure
|
|
1773
|
+
.input(climateControlCapability.methods.setFanMode.input.loose())
|
|
1774
|
+
.output(climateControlCapability.methods.setFanMode.output)
|
|
1775
|
+
.mutation(async ({ input, ctx }) => {
|
|
1776
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1777
|
+
const p = resolveProvider('climate-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1778
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1779
|
+
return p.setFanMode(methodInput as any)
|
|
1780
|
+
}),
|
|
1781
|
+
setPreset: adminProcedure
|
|
1782
|
+
.input(climateControlCapability.methods.setPreset.input.loose())
|
|
1783
|
+
.output(climateControlCapability.methods.setPreset.output)
|
|
1784
|
+
.mutation(async ({ input, ctx }) => {
|
|
1785
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1786
|
+
const p = resolveProvider('climate-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1787
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1788
|
+
return p.setPreset(methodInput as any)
|
|
1789
|
+
}),
|
|
1790
|
+
setTarget: adminProcedure
|
|
1791
|
+
.input(climateControlCapability.methods.setTarget.input.loose())
|
|
1792
|
+
.output(climateControlCapability.methods.setTarget.output)
|
|
1793
|
+
.mutation(async ({ input, ctx }) => {
|
|
1794
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1795
|
+
const p = resolveProvider('climate-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1796
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1797
|
+
return p.setTarget(methodInput as any)
|
|
1798
|
+
}),
|
|
1799
|
+
setTargetRange: adminProcedure
|
|
1800
|
+
.input(climateControlCapability.methods.setTargetRange.input.loose())
|
|
1801
|
+
.output(climateControlCapability.methods.setTargetRange.output)
|
|
1802
|
+
.mutation(async ({ input, ctx }) => {
|
|
1803
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1804
|
+
const p = resolveProvider('climate-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1805
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1806
|
+
return p.setTargetRange(methodInput as any)
|
|
1807
|
+
}),
|
|
1808
|
+
setTargetHumidity: adminProcedure
|
|
1809
|
+
.input(climateControlCapability.methods.setTargetHumidity.input.loose())
|
|
1810
|
+
.output(climateControlCapability.methods.setTargetHumidity.output)
|
|
1811
|
+
.mutation(async ({ input, ctx }) => {
|
|
1812
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1813
|
+
const p = resolveProvider('climate-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1814
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1815
|
+
return p.setTargetHumidity(methodInput as any)
|
|
1816
|
+
}),
|
|
1817
|
+
})
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
// ── color (singleton) ───────────────────────────────────────────────
|
|
1821
|
+
|
|
1822
|
+
type ColorProvider = InferProvider<typeof colorCapability>
|
|
1823
|
+
|
|
1824
|
+
export function createCapRouter_color(
|
|
1825
|
+
getProvider: (ctx: TrpcContext) => ColorProvider | null,
|
|
1826
|
+
createRemoteProxy?: (capName: string, nodeId: string) => ColorProvider | null,
|
|
1827
|
+
) {
|
|
1828
|
+
return trpcRouter({
|
|
1829
|
+
getStatus: protectedProcedure
|
|
1830
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
1831
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
1832
|
+
.query(async ({ input, ctx }) => {
|
|
1833
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1834
|
+
const p = resolveProvider('color', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1835
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1836
|
+
return p.getStatus(methodInput as any)
|
|
1837
|
+
}),
|
|
1838
|
+
setColor: adminProcedure
|
|
1839
|
+
.input(colorCapability.methods.setColor.input.loose())
|
|
1840
|
+
.output(colorCapability.methods.setColor.output)
|
|
1841
|
+
.mutation(async ({ input, ctx }) => {
|
|
1842
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1843
|
+
const p = resolveProvider('color', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1844
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1845
|
+
return p.setColor(methodInput as any)
|
|
1846
|
+
}),
|
|
1847
|
+
})
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
// ── connectivity (singleton) ────────────────────────────────────────
|
|
1851
|
+
|
|
1852
|
+
type ConnectivityProvider = InferProvider<typeof connectivityCapability>
|
|
1853
|
+
|
|
1854
|
+
export function createCapRouter_connectivity(
|
|
1855
|
+
getProvider: (ctx: TrpcContext) => ConnectivityProvider | null,
|
|
1856
|
+
createRemoteProxy?: (capName: string, nodeId: string) => ConnectivityProvider | null,
|
|
1857
|
+
) {
|
|
1858
|
+
return trpcRouter({
|
|
1859
|
+
getStatus: protectedProcedure
|
|
1860
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
1861
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
1862
|
+
.query(async ({ input, ctx }) => {
|
|
1863
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1864
|
+
const p = resolveProvider('connectivity', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1865
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1866
|
+
return p.getStatus(methodInput as any)
|
|
1867
|
+
}),
|
|
1868
|
+
})
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
// ── consumables (singleton) ─────────────────────────────────────────
|
|
1872
|
+
|
|
1873
|
+
type ConsumablesProvider = InferProvider<typeof consumablesCapability>
|
|
1874
|
+
|
|
1875
|
+
export function createCapRouter_consumables(
|
|
1876
|
+
getProvider: (ctx: TrpcContext) => ConsumablesProvider | null,
|
|
1877
|
+
createRemoteProxy?: (capName: string, nodeId: string) => ConsumablesProvider | null,
|
|
1878
|
+
) {
|
|
1879
|
+
return trpcRouter({
|
|
1880
|
+
getStatus: protectedProcedure
|
|
1881
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
1882
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
1883
|
+
.query(async ({ input, ctx }) => {
|
|
1884
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1885
|
+
const p = resolveProvider('consumables', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1886
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1887
|
+
return p.getStatus(methodInput as any)
|
|
1888
|
+
}),
|
|
1889
|
+
reset: adminProcedure
|
|
1890
|
+
.input(consumablesCapability.methods.reset.input.loose())
|
|
1891
|
+
.output(consumablesCapability.methods.reset.output)
|
|
1892
|
+
.mutation(async ({ input, ctx }) => {
|
|
1893
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1894
|
+
const p = resolveProvider('consumables', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1895
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1896
|
+
return p.reset(methodInput as any)
|
|
1897
|
+
}),
|
|
1898
|
+
})
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
// ── contact (singleton) ─────────────────────────────────────────────
|
|
1902
|
+
|
|
1903
|
+
type ContactProvider = InferProvider<typeof contactCapability>
|
|
1904
|
+
|
|
1905
|
+
export function createCapRouter_contact(
|
|
1906
|
+
getProvider: (ctx: TrpcContext) => ContactProvider | null,
|
|
1907
|
+
createRemoteProxy?: (capName: string, nodeId: string) => ContactProvider | null,
|
|
1908
|
+
) {
|
|
1909
|
+
return trpcRouter({
|
|
1910
|
+
getStatus: protectedProcedure
|
|
1911
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
1912
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
1913
|
+
.query(async ({ input, ctx }) => {
|
|
1914
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1915
|
+
const p = resolveProvider('contact', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1916
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1917
|
+
return p.getStatus(methodInput as any)
|
|
1918
|
+
}),
|
|
1919
|
+
})
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
// ── control (singleton) ─────────────────────────────────────────────
|
|
1923
|
+
|
|
1924
|
+
type ControlProvider = InferProvider<typeof controlCapability>
|
|
1925
|
+
|
|
1926
|
+
export function createCapRouter_control(
|
|
1927
|
+
getProvider: (ctx: TrpcContext) => ControlProvider | null,
|
|
1928
|
+
createRemoteProxy?: (capName: string, nodeId: string) => ControlProvider | null,
|
|
1929
|
+
) {
|
|
1930
|
+
return trpcRouter({
|
|
1931
|
+
getStatus: protectedProcedure
|
|
1932
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
1933
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
1934
|
+
.query(async ({ input, ctx }) => {
|
|
1935
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1936
|
+
const p = resolveProvider('control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1937
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1938
|
+
return p.getStatus(methodInput as any)
|
|
1939
|
+
}),
|
|
1940
|
+
setValue: adminProcedure
|
|
1941
|
+
.input(controlCapability.methods.setValue.input.loose())
|
|
1942
|
+
.output(controlCapability.methods.setValue.output)
|
|
1943
|
+
.mutation(async ({ input, ctx }) => {
|
|
1944
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1945
|
+
const p = resolveProvider('control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1946
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1947
|
+
return p.setValue(methodInput as any)
|
|
1948
|
+
}),
|
|
1949
|
+
})
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
// ── cover (singleton) ───────────────────────────────────────────────
|
|
1953
|
+
|
|
1954
|
+
type CoverProvider = InferProvider<typeof coverCapability>
|
|
1955
|
+
|
|
1956
|
+
export function createCapRouter_cover(
|
|
1957
|
+
getProvider: (ctx: TrpcContext) => CoverProvider | null,
|
|
1958
|
+
createRemoteProxy?: (capName: string, nodeId: string) => CoverProvider | null,
|
|
1959
|
+
) {
|
|
1960
|
+
return trpcRouter({
|
|
1961
|
+
getStatus: protectedProcedure
|
|
1962
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
1963
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
1964
|
+
.query(async ({ input, ctx }) => {
|
|
1965
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1966
|
+
const p = resolveProvider('cover', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1967
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1968
|
+
return p.getStatus(methodInput as any)
|
|
1969
|
+
}),
|
|
1970
|
+
open: adminProcedure
|
|
1971
|
+
.input(coverCapability.methods.open.input.loose())
|
|
1972
|
+
.output(coverCapability.methods.open.output)
|
|
1973
|
+
.mutation(async ({ input, ctx }) => {
|
|
1974
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1975
|
+
const p = resolveProvider('cover', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1976
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1977
|
+
return p.open(methodInput as any)
|
|
1978
|
+
}),
|
|
1979
|
+
close: adminProcedure
|
|
1980
|
+
.input(coverCapability.methods.close.input.loose())
|
|
1981
|
+
.output(coverCapability.methods.close.output)
|
|
1982
|
+
.mutation(async ({ input, ctx }) => {
|
|
1983
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1984
|
+
const p = resolveProvider('cover', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1985
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1986
|
+
return p.close(methodInput as any)
|
|
1987
|
+
}),
|
|
1988
|
+
stop: adminProcedure
|
|
1989
|
+
.input(coverCapability.methods.stop.input.loose())
|
|
1990
|
+
.output(coverCapability.methods.stop.output)
|
|
1991
|
+
.mutation(async ({ input, ctx }) => {
|
|
1992
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
1993
|
+
const p = resolveProvider('cover', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
1994
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1995
|
+
return p.stop(methodInput as any)
|
|
1996
|
+
}),
|
|
1997
|
+
setPosition: adminProcedure
|
|
1998
|
+
.input(coverCapability.methods.setPosition.input.loose())
|
|
1999
|
+
.output(coverCapability.methods.setPosition.output)
|
|
2000
|
+
.mutation(async ({ input, ctx }) => {
|
|
2001
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2002
|
+
const p = resolveProvider('cover', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2003
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2004
|
+
return p.setPosition(methodInput as any)
|
|
2005
|
+
}),
|
|
2006
|
+
setTiltPosition: adminProcedure
|
|
2007
|
+
.input(coverCapability.methods.setTiltPosition.input.loose())
|
|
2008
|
+
.output(coverCapability.methods.setTiltPosition.output)
|
|
2009
|
+
.mutation(async ({ input, ctx }) => {
|
|
2010
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2011
|
+
const p = resolveProvider('cover', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2012
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2013
|
+
return p.setTiltPosition(methodInput as any)
|
|
2014
|
+
}),
|
|
2015
|
+
})
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2018
|
+
// ── decoder (singleton) ─────────────────────────────────────────────
|
|
2019
|
+
|
|
2020
|
+
type DecoderProvider = InferProvider<typeof decoderCapability>
|
|
2021
|
+
|
|
2022
|
+
export function createCapRouter_decoder(
|
|
2023
|
+
getProvider: (ctx: TrpcContext) => DecoderProvider | null,
|
|
2024
|
+
createRemoteProxy?: (capName: string, nodeId: string) => DecoderProvider | null,
|
|
2025
|
+
) {
|
|
2026
|
+
return trpcRouter({
|
|
2027
|
+
supportsCodec: protectedProcedure
|
|
2028
|
+
.input(decoderCapability.methods.supportsCodec.input.loose())
|
|
2029
|
+
.output(decoderCapability.methods.supportsCodec.output)
|
|
2030
|
+
.query(async ({ input, ctx }) => {
|
|
2031
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2032
|
+
const p = resolveProvider('decoder', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2033
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2034
|
+
return p.supportsCodec(methodInput as any)
|
|
2035
|
+
}),
|
|
2036
|
+
getInfo: protectedProcedure
|
|
2037
|
+
.input(z.object({ nodeId: z.string().optional() }).optional())
|
|
2038
|
+
.output(decoderCapability.methods.getInfo.output)
|
|
2039
|
+
.query(async ({ input, ctx }) => {
|
|
2040
|
+
const p = resolveProvider('decoder', input?.nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2041
|
+
return p.getInfo()
|
|
2042
|
+
}),
|
|
2043
|
+
createSession: protectedProcedure
|
|
1340
2044
|
.input(decoderCapability.methods.createSession.input.loose())
|
|
1341
2045
|
.output(decoderCapability.methods.createSession.output)
|
|
1342
2046
|
.query(async ({ input, ctx }) => {
|
|
@@ -1482,6 +2186,90 @@ export function createCapRouter_detectionPipeline(
|
|
|
1482
2186
|
})
|
|
1483
2187
|
}
|
|
1484
2188
|
|
|
2189
|
+
// ── device-adoption (singleton) ─────────────────────────────────────
|
|
2190
|
+
|
|
2191
|
+
type DeviceAdoptionProvider = InferProvider<typeof deviceAdoptionCapability>
|
|
2192
|
+
|
|
2193
|
+
export function createCapRouter_deviceAdoption(
|
|
2194
|
+
getProvider: (ctx: TrpcContext) => DeviceAdoptionProvider | null,
|
|
2195
|
+
createRemoteProxy?: (capName: string, nodeId: string) => DeviceAdoptionProvider | null,
|
|
2196
|
+
) {
|
|
2197
|
+
return trpcRouter({
|
|
2198
|
+
getStatus: protectedProcedure
|
|
2199
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
2200
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
2201
|
+
.query(async ({ input, ctx }) => {
|
|
2202
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2203
|
+
const p = resolveProvider('device-adoption', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2204
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2205
|
+
return p.getStatus(methodInput as any)
|
|
2206
|
+
}),
|
|
2207
|
+
listCandidateFilters: adminProcedure
|
|
2208
|
+
.input(deviceAdoptionCapability.methods.listCandidateFilters.input.loose())
|
|
2209
|
+
.output(deviceAdoptionCapability.methods.listCandidateFilters.output)
|
|
2210
|
+
.query(async ({ input, ctx }) => {
|
|
2211
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2212
|
+
const p = resolveProvider('device-adoption', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2213
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2214
|
+
return p.listCandidateFilters(methodInput as any)
|
|
2215
|
+
}),
|
|
2216
|
+
listCandidates: adminProcedure
|
|
2217
|
+
.input(deviceAdoptionCapability.methods.listCandidates.input.loose())
|
|
2218
|
+
.output(deviceAdoptionCapability.methods.listCandidates.output)
|
|
2219
|
+
.query(async ({ input, ctx }) => {
|
|
2220
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2221
|
+
const p = resolveProvider('device-adoption', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2222
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2223
|
+
return p.listCandidates(methodInput as any)
|
|
2224
|
+
}),
|
|
2225
|
+
getCandidate: adminProcedure
|
|
2226
|
+
.input(deviceAdoptionCapability.methods.getCandidate.input.loose())
|
|
2227
|
+
.output(deviceAdoptionCapability.methods.getCandidate.output)
|
|
2228
|
+
.query(async ({ input, ctx }) => {
|
|
2229
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2230
|
+
const p = resolveProvider('device-adoption', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2231
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2232
|
+
return p.getCandidate(methodInput as any)
|
|
2233
|
+
}),
|
|
2234
|
+
refresh: adminProcedure
|
|
2235
|
+
.input(deviceAdoptionCapability.methods.refresh.input.loose())
|
|
2236
|
+
.output(deviceAdoptionCapability.methods.refresh.output)
|
|
2237
|
+
.mutation(async ({ input, ctx }) => {
|
|
2238
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2239
|
+
const p = resolveProvider('device-adoption', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2240
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2241
|
+
return p.refresh(methodInput as any)
|
|
2242
|
+
}),
|
|
2243
|
+
adopt: adminProcedure
|
|
2244
|
+
.input(deviceAdoptionCapability.methods.adopt.input.loose())
|
|
2245
|
+
.output(deviceAdoptionCapability.methods.adopt.output)
|
|
2246
|
+
.mutation(async ({ input, ctx }) => {
|
|
2247
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2248
|
+
const p = resolveProvider('device-adoption', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2249
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2250
|
+
return p.adopt(methodInput as any)
|
|
2251
|
+
}),
|
|
2252
|
+
release: adminProcedure
|
|
2253
|
+
.input(deviceAdoptionCapability.methods.release.input.loose())
|
|
2254
|
+
.output(deviceAdoptionCapability.methods.release.output)
|
|
2255
|
+
.mutation(async ({ input, ctx }) => {
|
|
2256
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2257
|
+
const p = resolveProvider('device-adoption', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2258
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2259
|
+
return p.release(methodInput as any)
|
|
2260
|
+
}),
|
|
2261
|
+
resync: adminProcedure
|
|
2262
|
+
.input(deviceAdoptionCapability.methods.resync.input.loose())
|
|
2263
|
+
.output(deviceAdoptionCapability.methods.resync.output)
|
|
2264
|
+
.mutation(async ({ input, ctx }) => {
|
|
2265
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2266
|
+
const p = resolveProvider('device-adoption', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2267
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2268
|
+
return p.resync(methodInput as any)
|
|
2269
|
+
}),
|
|
2270
|
+
})
|
|
2271
|
+
}
|
|
2272
|
+
|
|
1485
2273
|
// ── device-discovery (singleton) ────────────────────────────────────
|
|
1486
2274
|
|
|
1487
2275
|
type DeviceDiscoveryProvider = InferProvider<typeof deviceDiscoveryCapability>
|
|
@@ -1707,6 +2495,87 @@ export function createCapRouter_deviceManager(
|
|
|
1707
2495
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1708
2496
|
return p.setLocation(methodInput as any)
|
|
1709
2497
|
}),
|
|
2498
|
+
setType: adminProcedure
|
|
2499
|
+
.input(deviceManagerCapability.methods.setType.input.loose())
|
|
2500
|
+
.output(deviceManagerCapability.methods.setType.output)
|
|
2501
|
+
.mutation(async ({ input, ctx }) => {
|
|
2502
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2503
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2504
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2505
|
+
return p.setType(methodInput as any)
|
|
2506
|
+
}),
|
|
2507
|
+
setIntegrationId: adminProcedure
|
|
2508
|
+
.input(deviceManagerCapability.methods.setIntegrationId.input.loose())
|
|
2509
|
+
.output(deviceManagerCapability.methods.setIntegrationId.output)
|
|
2510
|
+
.mutation(async ({ input, ctx }) => {
|
|
2511
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2512
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2513
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2514
|
+
return p.setIntegrationId(methodInput as any)
|
|
2515
|
+
}),
|
|
2516
|
+
setLinkDeviceId: adminProcedure
|
|
2517
|
+
.input(deviceManagerCapability.methods.setLinkDeviceId.input.loose())
|
|
2518
|
+
.output(deviceManagerCapability.methods.setLinkDeviceId.output)
|
|
2519
|
+
.mutation(async ({ input, ctx }) => {
|
|
2520
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2521
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2522
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2523
|
+
return p.setLinkDeviceId(methodInput as any)
|
|
2524
|
+
}),
|
|
2525
|
+
setPrimaryChildEntityId: adminProcedure
|
|
2526
|
+
.input(deviceManagerCapability.methods.setPrimaryChildEntityId.input.loose())
|
|
2527
|
+
.output(deviceManagerCapability.methods.setPrimaryChildEntityId.output)
|
|
2528
|
+
.mutation(async ({ input, ctx }) => {
|
|
2529
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2530
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2531
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2532
|
+
return p.setPrimaryChildEntityId(methodInput as any)
|
|
2533
|
+
}),
|
|
2534
|
+
setChildLayout: adminProcedure
|
|
2535
|
+
.input(deviceManagerCapability.methods.setChildLayout.input.loose())
|
|
2536
|
+
.output(deviceManagerCapability.methods.setChildLayout.output)
|
|
2537
|
+
.mutation(async ({ input, ctx }) => {
|
|
2538
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2539
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2540
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2541
|
+
return p.setChildLayout(methodInput as any)
|
|
2542
|
+
}),
|
|
2543
|
+
setDeviceLinks: adminProcedure
|
|
2544
|
+
.input(deviceManagerCapability.methods.setDeviceLinks.input.loose())
|
|
2545
|
+
.output(deviceManagerCapability.methods.setDeviceLinks.output)
|
|
2546
|
+
.mutation(async ({ input, ctx }) => {
|
|
2547
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2548
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2549
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2550
|
+
return p.setDeviceLinks(methodInput as any)
|
|
2551
|
+
}),
|
|
2552
|
+
getWireableFields: protectedProcedure
|
|
2553
|
+
.input(deviceManagerCapability.methods.getWireableFields.input.loose())
|
|
2554
|
+
.output(deviceManagerCapability.methods.getWireableFields.output)
|
|
2555
|
+
.query(async ({ input, ctx }) => {
|
|
2556
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2557
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2558
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2559
|
+
return p.getWireableFields(methodInput as any)
|
|
2560
|
+
}),
|
|
2561
|
+
setRole: adminProcedure
|
|
2562
|
+
.input(deviceManagerCapability.methods.setRole.input.loose())
|
|
2563
|
+
.output(deviceManagerCapability.methods.setRole.output)
|
|
2564
|
+
.mutation(async ({ input, ctx }) => {
|
|
2565
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2566
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2567
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2568
|
+
return p.setRole(methodInput as any)
|
|
2569
|
+
}),
|
|
2570
|
+
applyInitialMeta: adminProcedure
|
|
2571
|
+
.input(deviceManagerCapability.methods.applyInitialMeta.input.loose())
|
|
2572
|
+
.output(deviceManagerCapability.methods.applyInitialMeta.output)
|
|
2573
|
+
.mutation(async ({ input, ctx }) => {
|
|
2574
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2575
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2576
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2577
|
+
return p.applyInitialMeta(methodInput as any)
|
|
2578
|
+
}),
|
|
1710
2579
|
setMetadata: adminProcedure
|
|
1711
2580
|
.input(deviceManagerCapability.methods.setMetadata.input.loose())
|
|
1712
2581
|
.output(deviceManagerCapability.methods.setMetadata.output)
|
|
@@ -1849,6 +2718,15 @@ export function createCapRouter_deviceManager(
|
|
|
1849
2718
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1850
2719
|
return p.remove(methodInput as any)
|
|
1851
2720
|
}),
|
|
2721
|
+
removeByIntegration: adminProcedure
|
|
2722
|
+
.input(deviceManagerCapability.methods.removeByIntegration.input.loose())
|
|
2723
|
+
.output(deviceManagerCapability.methods.removeByIntegration.output)
|
|
2724
|
+
.mutation(async ({ input, ctx }) => {
|
|
2725
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2726
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2727
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2728
|
+
return p.removeByIntegration(methodInput as any)
|
|
2729
|
+
}),
|
|
1852
2730
|
getStreamProfileMap: protectedProcedure
|
|
1853
2731
|
.input(deviceManagerCapability.methods.getStreamProfileMap.input.loose())
|
|
1854
2732
|
.output(deviceManagerCapability.methods.getStreamProfileMap.output)
|
|
@@ -1948,6 +2826,15 @@ export function createCapRouter_deviceManager(
|
|
|
1948
2826
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1949
2827
|
return p.getDeviceAggregate(methodInput as any)
|
|
1950
2828
|
}),
|
|
2829
|
+
runDeviceAction: protectedProcedure
|
|
2830
|
+
.input(deviceManagerCapability.methods.runDeviceAction.input.loose())
|
|
2831
|
+
.output(deviceManagerCapability.methods.runDeviceAction.output)
|
|
2832
|
+
.mutation(async ({ input, ctx }) => {
|
|
2833
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2834
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2835
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2836
|
+
return p.runDeviceAction(methodInput as any)
|
|
2837
|
+
}),
|
|
1951
2838
|
updateDeviceField: adminProcedure
|
|
1952
2839
|
.input(deviceManagerCapability.methods.updateDeviceField.input.loose())
|
|
1953
2840
|
.output(deviceManagerCapability.methods.updateDeviceField.output)
|
|
@@ -2011,6 +2898,42 @@ export function createCapRouter_deviceManager(
|
|
|
2011
2898
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2012
2899
|
return p.testCreationField(methodInput as any)
|
|
2013
2900
|
}),
|
|
2901
|
+
adoptionListCandidates: adminProcedure
|
|
2902
|
+
.input(deviceManagerCapability.methods.adoptionListCandidates.input.loose())
|
|
2903
|
+
.output(deviceManagerCapability.methods.adoptionListCandidates.output)
|
|
2904
|
+
.query(async ({ input, ctx }) => {
|
|
2905
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2906
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2907
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2908
|
+
return p.adoptionListCandidates(methodInput as any)
|
|
2909
|
+
}),
|
|
2910
|
+
adoptionRefresh: adminProcedure
|
|
2911
|
+
.input(deviceManagerCapability.methods.adoptionRefresh.input.loose())
|
|
2912
|
+
.output(deviceManagerCapability.methods.adoptionRefresh.output)
|
|
2913
|
+
.mutation(async ({ input, ctx }) => {
|
|
2914
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2915
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2916
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2917
|
+
return p.adoptionRefresh(methodInput as any)
|
|
2918
|
+
}),
|
|
2919
|
+
adoptionAdopt: adminProcedure
|
|
2920
|
+
.input(deviceManagerCapability.methods.adoptionAdopt.input.loose())
|
|
2921
|
+
.output(deviceManagerCapability.methods.adoptionAdopt.output)
|
|
2922
|
+
.mutation(async ({ input, ctx }) => {
|
|
2923
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2924
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2925
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2926
|
+
return p.adoptionAdopt(methodInput as any)
|
|
2927
|
+
}),
|
|
2928
|
+
adoptionRelease: adminProcedure
|
|
2929
|
+
.input(deviceManagerCapability.methods.adoptionRelease.input.loose())
|
|
2930
|
+
.output(deviceManagerCapability.methods.adoptionRelease.output)
|
|
2931
|
+
.mutation(async ({ input, ctx }) => {
|
|
2932
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2933
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2934
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2935
|
+
return p.adoptionRelease(methodInput as any)
|
|
2936
|
+
}),
|
|
2014
2937
|
testField: adminProcedure
|
|
2015
2938
|
.input(deviceManagerCapability.methods.testField.input.loose())
|
|
2016
2939
|
.output(deviceManagerCapability.methods.testField.output)
|
|
@@ -2068,6 +2991,15 @@ export function createCapRouter_deviceOps(
|
|
|
2068
2991
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2069
2992
|
return p.setConfig(methodInput as any)
|
|
2070
2993
|
}),
|
|
2994
|
+
runAction: protectedProcedure
|
|
2995
|
+
.input(deviceOpsCapability.methods.runAction.input.loose())
|
|
2996
|
+
.output(deviceOpsCapability.methods.runAction.output)
|
|
2997
|
+
.mutation(async ({ input, ctx }) => {
|
|
2998
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2999
|
+
const p = resolveProvider('device-ops', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3000
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3001
|
+
return p.runAction(methodInput as any)
|
|
3002
|
+
}),
|
|
2071
3003
|
removeDevice: protectedProcedure
|
|
2072
3004
|
.input(deviceOpsCapability.methods.removeDevice.input.loose())
|
|
2073
3005
|
.output(deviceOpsCapability.methods.removeDevice.output)
|
|
@@ -2086,6 +3018,15 @@ export function createCapRouter_deviceOps(
|
|
|
2086
3018
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2087
3019
|
return p.getSettingsSchema(methodInput as any)
|
|
2088
3020
|
}),
|
|
3021
|
+
getRawState: protectedProcedure
|
|
3022
|
+
.input(deviceOpsCapability.methods.getRawState.input.loose())
|
|
3023
|
+
.output(deviceOpsCapability.methods.getRawState.output)
|
|
3024
|
+
.query(async ({ input, ctx }) => {
|
|
3025
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3026
|
+
const p = resolveProvider('device-ops', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3027
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3028
|
+
return p.getRawState(methodInput as any)
|
|
3029
|
+
}),
|
|
2089
3030
|
})
|
|
2090
3031
|
}
|
|
2091
3032
|
|
|
@@ -2319,6 +3260,48 @@ export function createCapRouter_embeddingEncoder(
|
|
|
2319
3260
|
})
|
|
2320
3261
|
}
|
|
2321
3262
|
|
|
3263
|
+
// ── enum-sensor (singleton) ─────────────────────────────────────────
|
|
3264
|
+
|
|
3265
|
+
type EnumSensorProvider = InferProvider<typeof enumSensorCapability>
|
|
3266
|
+
|
|
3267
|
+
export function createCapRouter_enumSensor(
|
|
3268
|
+
getProvider: (ctx: TrpcContext) => EnumSensorProvider | null,
|
|
3269
|
+
createRemoteProxy?: (capName: string, nodeId: string) => EnumSensorProvider | null,
|
|
3270
|
+
) {
|
|
3271
|
+
return trpcRouter({
|
|
3272
|
+
getStatus: protectedProcedure
|
|
3273
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
3274
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
3275
|
+
.query(async ({ input, ctx }) => {
|
|
3276
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3277
|
+
const p = resolveProvider('enum-sensor', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3278
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3279
|
+
return p.getStatus(methodInput as any)
|
|
3280
|
+
}),
|
|
3281
|
+
})
|
|
3282
|
+
}
|
|
3283
|
+
|
|
3284
|
+
// ── event-emitter (singleton) ───────────────────────────────────────
|
|
3285
|
+
|
|
3286
|
+
type EventEmitterProvider = InferProvider<typeof eventEmitterCapability>
|
|
3287
|
+
|
|
3288
|
+
export function createCapRouter_eventEmitter(
|
|
3289
|
+
getProvider: (ctx: TrpcContext) => EventEmitterProvider | null,
|
|
3290
|
+
createRemoteProxy?: (capName: string, nodeId: string) => EventEmitterProvider | null,
|
|
3291
|
+
) {
|
|
3292
|
+
return trpcRouter({
|
|
3293
|
+
getStatus: protectedProcedure
|
|
3294
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
3295
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
3296
|
+
.query(async ({ input, ctx }) => {
|
|
3297
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3298
|
+
const p = resolveProvider('event-emitter', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3299
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3300
|
+
return p.getStatus(methodInput as any)
|
|
3301
|
+
}),
|
|
3302
|
+
})
|
|
3303
|
+
}
|
|
3304
|
+
|
|
2322
3305
|
// ── events (singleton) ──────────────────────────────────────────────
|
|
2323
3306
|
|
|
2324
3307
|
type EventsProvider = InferProvider<typeof eventsCapability>
|
|
@@ -2358,6 +3341,63 @@ export function createCapRouter_events(
|
|
|
2358
3341
|
})
|
|
2359
3342
|
}
|
|
2360
3343
|
|
|
3344
|
+
// ── fan-control (singleton) ─────────────────────────────────────────
|
|
3345
|
+
|
|
3346
|
+
type FanControlProvider = InferProvider<typeof fanControlCapability>
|
|
3347
|
+
|
|
3348
|
+
export function createCapRouter_fanControl(
|
|
3349
|
+
getProvider: (ctx: TrpcContext) => FanControlProvider | null,
|
|
3350
|
+
createRemoteProxy?: (capName: string, nodeId: string) => FanControlProvider | null,
|
|
3351
|
+
) {
|
|
3352
|
+
return trpcRouter({
|
|
3353
|
+
getStatus: protectedProcedure
|
|
3354
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
3355
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
3356
|
+
.query(async ({ input, ctx }) => {
|
|
3357
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3358
|
+
const p = resolveProvider('fan-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3359
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3360
|
+
return p.getStatus(methodInput as any)
|
|
3361
|
+
}),
|
|
3362
|
+
setPercentage: adminProcedure
|
|
3363
|
+
.input(fanControlCapability.methods.setPercentage.input.loose())
|
|
3364
|
+
.output(fanControlCapability.methods.setPercentage.output)
|
|
3365
|
+
.mutation(async ({ input, ctx }) => {
|
|
3366
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3367
|
+
const p = resolveProvider('fan-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3368
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3369
|
+
return p.setPercentage(methodInput as any)
|
|
3370
|
+
}),
|
|
3371
|
+
setPreset: adminProcedure
|
|
3372
|
+
.input(fanControlCapability.methods.setPreset.input.loose())
|
|
3373
|
+
.output(fanControlCapability.methods.setPreset.output)
|
|
3374
|
+
.mutation(async ({ input, ctx }) => {
|
|
3375
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3376
|
+
const p = resolveProvider('fan-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3377
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3378
|
+
return p.setPreset(methodInput as any)
|
|
3379
|
+
}),
|
|
3380
|
+
setDirection: adminProcedure
|
|
3381
|
+
.input(fanControlCapability.methods.setDirection.input.loose())
|
|
3382
|
+
.output(fanControlCapability.methods.setDirection.output)
|
|
3383
|
+
.mutation(async ({ input, ctx }) => {
|
|
3384
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3385
|
+
const p = resolveProvider('fan-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3386
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3387
|
+
return p.setDirection(methodInput as any)
|
|
3388
|
+
}),
|
|
3389
|
+
setOscillating: adminProcedure
|
|
3390
|
+
.input(fanControlCapability.methods.setOscillating.input.loose())
|
|
3391
|
+
.output(fanControlCapability.methods.setOscillating.output)
|
|
3392
|
+
.mutation(async ({ input, ctx }) => {
|
|
3393
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3394
|
+
const p = resolveProvider('fan-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3395
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3396
|
+
return p.setOscillating(methodInput as any)
|
|
3397
|
+
}),
|
|
3398
|
+
})
|
|
3399
|
+
}
|
|
3400
|
+
|
|
2361
3401
|
// ── feature-probe (singleton) ───────────────────────────────────────
|
|
2362
3402
|
|
|
2363
3403
|
type FeatureProbeProvider = InferProvider<typeof featureProbeCapability>
|
|
@@ -2379,6 +3419,138 @@ export function createCapRouter_featureProbe(
|
|
|
2379
3419
|
})
|
|
2380
3420
|
}
|
|
2381
3421
|
|
|
3422
|
+
// ── flood (singleton) ───────────────────────────────────────────────
|
|
3423
|
+
|
|
3424
|
+
type FloodProvider = InferProvider<typeof floodCapability>
|
|
3425
|
+
|
|
3426
|
+
export function createCapRouter_flood(
|
|
3427
|
+
getProvider: (ctx: TrpcContext) => FloodProvider | null,
|
|
3428
|
+
createRemoteProxy?: (capName: string, nodeId: string) => FloodProvider | null,
|
|
3429
|
+
) {
|
|
3430
|
+
return trpcRouter({
|
|
3431
|
+
getStatus: protectedProcedure
|
|
3432
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
3433
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
3434
|
+
.query(async ({ input, ctx }) => {
|
|
3435
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3436
|
+
const p = resolveProvider('flood', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3437
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3438
|
+
return p.getStatus(methodInput as any)
|
|
3439
|
+
}),
|
|
3440
|
+
})
|
|
3441
|
+
}
|
|
3442
|
+
|
|
3443
|
+
// ── gas (singleton) ─────────────────────────────────────────────────
|
|
3444
|
+
|
|
3445
|
+
type GasProvider = InferProvider<typeof gasCapability>
|
|
3446
|
+
|
|
3447
|
+
export function createCapRouter_gas(
|
|
3448
|
+
getProvider: (ctx: TrpcContext) => GasProvider | null,
|
|
3449
|
+
createRemoteProxy?: (capName: string, nodeId: string) => GasProvider | null,
|
|
3450
|
+
) {
|
|
3451
|
+
return trpcRouter({
|
|
3452
|
+
getStatus: protectedProcedure
|
|
3453
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
3454
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
3455
|
+
.query(async ({ input, ctx }) => {
|
|
3456
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3457
|
+
const p = resolveProvider('gas', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3458
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3459
|
+
return p.getStatus(methodInput as any)
|
|
3460
|
+
}),
|
|
3461
|
+
})
|
|
3462
|
+
}
|
|
3463
|
+
|
|
3464
|
+
// ── humidifier (singleton) ──────────────────────────────────────────
|
|
3465
|
+
|
|
3466
|
+
type HumidifierProvider = InferProvider<typeof humidifierCapability>
|
|
3467
|
+
|
|
3468
|
+
export function createCapRouter_humidifier(
|
|
3469
|
+
getProvider: (ctx: TrpcContext) => HumidifierProvider | null,
|
|
3470
|
+
createRemoteProxy?: (capName: string, nodeId: string) => HumidifierProvider | null,
|
|
3471
|
+
) {
|
|
3472
|
+
return trpcRouter({
|
|
3473
|
+
getStatus: protectedProcedure
|
|
3474
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
3475
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
3476
|
+
.query(async ({ input, ctx }) => {
|
|
3477
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3478
|
+
const p = resolveProvider('humidifier', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3479
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3480
|
+
return p.getStatus(methodInput as any)
|
|
3481
|
+
}),
|
|
3482
|
+
setOn: adminProcedure
|
|
3483
|
+
.input(humidifierCapability.methods.setOn.input.loose())
|
|
3484
|
+
.output(humidifierCapability.methods.setOn.output)
|
|
3485
|
+
.mutation(async ({ input, ctx }) => {
|
|
3486
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3487
|
+
const p = resolveProvider('humidifier', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3488
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3489
|
+
return p.setOn(methodInput as any)
|
|
3490
|
+
}),
|
|
3491
|
+
setTargetHumidity: adminProcedure
|
|
3492
|
+
.input(humidifierCapability.methods.setTargetHumidity.input.loose())
|
|
3493
|
+
.output(humidifierCapability.methods.setTargetHumidity.output)
|
|
3494
|
+
.mutation(async ({ input, ctx }) => {
|
|
3495
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3496
|
+
const p = resolveProvider('humidifier', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3497
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3498
|
+
return p.setTargetHumidity(methodInput as any)
|
|
3499
|
+
}),
|
|
3500
|
+
setMode: adminProcedure
|
|
3501
|
+
.input(humidifierCapability.methods.setMode.input.loose())
|
|
3502
|
+
.output(humidifierCapability.methods.setMode.output)
|
|
3503
|
+
.mutation(async ({ input, ctx }) => {
|
|
3504
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3505
|
+
const p = resolveProvider('humidifier', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3506
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3507
|
+
return p.setMode(methodInput as any)
|
|
3508
|
+
}),
|
|
3509
|
+
})
|
|
3510
|
+
}
|
|
3511
|
+
|
|
3512
|
+
// ── humidity-sensor (singleton) ─────────────────────────────────────
|
|
3513
|
+
|
|
3514
|
+
type HumiditySensorProvider = InferProvider<typeof humiditySensorCapability>
|
|
3515
|
+
|
|
3516
|
+
export function createCapRouter_humiditySensor(
|
|
3517
|
+
getProvider: (ctx: TrpcContext) => HumiditySensorProvider | null,
|
|
3518
|
+
createRemoteProxy?: (capName: string, nodeId: string) => HumiditySensorProvider | null,
|
|
3519
|
+
) {
|
|
3520
|
+
return trpcRouter({
|
|
3521
|
+
getStatus: protectedProcedure
|
|
3522
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
3523
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
3524
|
+
.query(async ({ input, ctx }) => {
|
|
3525
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3526
|
+
const p = resolveProvider('humidity-sensor', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3527
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3528
|
+
return p.getStatus(methodInput as any)
|
|
3529
|
+
}),
|
|
3530
|
+
})
|
|
3531
|
+
}
|
|
3532
|
+
|
|
3533
|
+
// ── image (singleton) ───────────────────────────────────────────────
|
|
3534
|
+
|
|
3535
|
+
type ImageProvider = InferProvider<typeof imageCapability>
|
|
3536
|
+
|
|
3537
|
+
export function createCapRouter_image(
|
|
3538
|
+
getProvider: (ctx: TrpcContext) => ImageProvider | null,
|
|
3539
|
+
createRemoteProxy?: (capName: string, nodeId: string) => ImageProvider | null,
|
|
3540
|
+
) {
|
|
3541
|
+
return trpcRouter({
|
|
3542
|
+
getStatus: protectedProcedure
|
|
3543
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
3544
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
3545
|
+
.query(async ({ input, ctx }) => {
|
|
3546
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3547
|
+
const p = resolveProvider('image', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3548
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3549
|
+
return p.getStatus(methodInput as any)
|
|
3550
|
+
}),
|
|
3551
|
+
})
|
|
3552
|
+
}
|
|
3553
|
+
|
|
2382
3554
|
// ── integrations (singleton) ────────────────────────────────────────
|
|
2383
3555
|
|
|
2384
3556
|
type IntegrationsProvider = InferProvider<typeof integrationsCapability>
|
|
@@ -2531,14 +3703,14 @@ export function createCapRouter_intercom(
|
|
|
2531
3703
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2532
3704
|
return p.startTalkSession(methodInput as any)
|
|
2533
3705
|
}),
|
|
2534
|
-
|
|
2535
|
-
.input(intercomCapability.methods.
|
|
2536
|
-
.output(intercomCapability.methods.
|
|
3706
|
+
pushTalkAudio: adminProcedure
|
|
3707
|
+
.input(intercomCapability.methods.pushTalkAudio.input.loose())
|
|
3708
|
+
.output(intercomCapability.methods.pushTalkAudio.output)
|
|
2537
3709
|
.mutation(async ({ input, ctx }) => {
|
|
2538
3710
|
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2539
3711
|
const p = resolveProvider('intercom', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2540
3712
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2541
|
-
return p.
|
|
3713
|
+
return p.pushTalkAudio(methodInput as any)
|
|
2542
3714
|
}),
|
|
2543
3715
|
endTalkSession: adminProcedure
|
|
2544
3716
|
.input(intercomCapability.methods.endTalkSession.input.loose())
|
|
@@ -2552,6 +3724,54 @@ export function createCapRouter_intercom(
|
|
|
2552
3724
|
})
|
|
2553
3725
|
}
|
|
2554
3726
|
|
|
3727
|
+
// ── lawn-mower-control (singleton) ──────────────────────────────────
|
|
3728
|
+
|
|
3729
|
+
type LawnMowerControlProvider = InferProvider<typeof lawnMowerControlCapability>
|
|
3730
|
+
|
|
3731
|
+
export function createCapRouter_lawnMowerControl(
|
|
3732
|
+
getProvider: (ctx: TrpcContext) => LawnMowerControlProvider | null,
|
|
3733
|
+
createRemoteProxy?: (capName: string, nodeId: string) => LawnMowerControlProvider | null,
|
|
3734
|
+
) {
|
|
3735
|
+
return trpcRouter({
|
|
3736
|
+
getStatus: protectedProcedure
|
|
3737
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
3738
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
3739
|
+
.query(async ({ input, ctx }) => {
|
|
3740
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3741
|
+
const p = resolveProvider('lawn-mower-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3742
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3743
|
+
return p.getStatus(methodInput as any)
|
|
3744
|
+
}),
|
|
3745
|
+
startMowing: adminProcedure
|
|
3746
|
+
.input(lawnMowerControlCapability.methods.startMowing.input.loose())
|
|
3747
|
+
.output(lawnMowerControlCapability.methods.startMowing.output)
|
|
3748
|
+
.mutation(async ({ input, ctx }) => {
|
|
3749
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3750
|
+
const p = resolveProvider('lawn-mower-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3751
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3752
|
+
return p.startMowing(methodInput as any)
|
|
3753
|
+
}),
|
|
3754
|
+
pause: adminProcedure
|
|
3755
|
+
.input(lawnMowerControlCapability.methods.pause.input.loose())
|
|
3756
|
+
.output(lawnMowerControlCapability.methods.pause.output)
|
|
3757
|
+
.mutation(async ({ input, ctx }) => {
|
|
3758
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3759
|
+
const p = resolveProvider('lawn-mower-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3760
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3761
|
+
return p.pause(methodInput as any)
|
|
3762
|
+
}),
|
|
3763
|
+
dock: adminProcedure
|
|
3764
|
+
.input(lawnMowerControlCapability.methods.dock.input.loose())
|
|
3765
|
+
.output(lawnMowerControlCapability.methods.dock.output)
|
|
3766
|
+
.mutation(async ({ input, ctx }) => {
|
|
3767
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3768
|
+
const p = resolveProvider('lawn-mower-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3769
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3770
|
+
return p.dock(methodInput as any)
|
|
3771
|
+
}),
|
|
3772
|
+
})
|
|
3773
|
+
}
|
|
3774
|
+
|
|
2555
3775
|
// ── local-network (singleton) ───────────────────────────────────────
|
|
2556
3776
|
|
|
2557
3777
|
type LocalNetworkProvider = InferProvider<typeof localNetworkCapability>
|
|
@@ -2591,21 +3811,69 @@ export function createCapRouter_localNetwork(
|
|
|
2591
3811
|
const p = resolveProvider('local-network', input?.nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2592
3812
|
return p.getAllowedAddresses()
|
|
2593
3813
|
}),
|
|
2594
|
-
setAllowedAddresses: protectedProcedure
|
|
2595
|
-
.input(localNetworkCapability.methods.setAllowedAddresses.input.loose())
|
|
2596
|
-
.output(localNetworkCapability.methods.setAllowedAddresses.output)
|
|
3814
|
+
setAllowedAddresses: protectedProcedure
|
|
3815
|
+
.input(localNetworkCapability.methods.setAllowedAddresses.input.loose())
|
|
3816
|
+
.output(localNetworkCapability.methods.setAllowedAddresses.output)
|
|
3817
|
+
.mutation(async ({ input, ctx }) => {
|
|
3818
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3819
|
+
const p = resolveProvider('local-network', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3820
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3821
|
+
return p.setAllowedAddresses(methodInput as any)
|
|
3822
|
+
}),
|
|
3823
|
+
resetAllowlistToBestMatch: protectedProcedure
|
|
3824
|
+
.input(z.object({ nodeId: z.string().optional() }).optional())
|
|
3825
|
+
.output(localNetworkCapability.methods.resetAllowlistToBestMatch.output)
|
|
3826
|
+
.mutation(async ({ input, ctx }) => {
|
|
3827
|
+
const p = resolveProvider('local-network', input?.nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3828
|
+
return p.resetAllowlistToBestMatch()
|
|
3829
|
+
}),
|
|
3830
|
+
})
|
|
3831
|
+
}
|
|
3832
|
+
|
|
3833
|
+
// ── lock-control (singleton) ────────────────────────────────────────
|
|
3834
|
+
|
|
3835
|
+
type LockControlProvider = InferProvider<typeof lockControlCapability>
|
|
3836
|
+
|
|
3837
|
+
export function createCapRouter_lockControl(
|
|
3838
|
+
getProvider: (ctx: TrpcContext) => LockControlProvider | null,
|
|
3839
|
+
createRemoteProxy?: (capName: string, nodeId: string) => LockControlProvider | null,
|
|
3840
|
+
) {
|
|
3841
|
+
return trpcRouter({
|
|
3842
|
+
getStatus: protectedProcedure
|
|
3843
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
3844
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
3845
|
+
.query(async ({ input, ctx }) => {
|
|
3846
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3847
|
+
const p = resolveProvider('lock-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3848
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3849
|
+
return p.getStatus(methodInput as any)
|
|
3850
|
+
}),
|
|
3851
|
+
lock: adminProcedure
|
|
3852
|
+
.input(lockControlCapability.methods.lock.input.loose())
|
|
3853
|
+
.output(lockControlCapability.methods.lock.output)
|
|
2597
3854
|
.mutation(async ({ input, ctx }) => {
|
|
2598
3855
|
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
2599
|
-
const p = resolveProvider('
|
|
3856
|
+
const p = resolveProvider('lock-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
2600
3857
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2601
|
-
return p.
|
|
3858
|
+
return p.lock(methodInput as any)
|
|
2602
3859
|
}),
|
|
2603
|
-
|
|
2604
|
-
.input(
|
|
2605
|
-
.output(
|
|
3860
|
+
unlock: adminProcedure
|
|
3861
|
+
.input(lockControlCapability.methods.unlock.input.loose())
|
|
3862
|
+
.output(lockControlCapability.methods.unlock.output)
|
|
2606
3863
|
.mutation(async ({ input, ctx }) => {
|
|
2607
|
-
const
|
|
2608
|
-
|
|
3864
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3865
|
+
const p = resolveProvider('lock-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3866
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3867
|
+
return p.unlock(methodInput as any)
|
|
3868
|
+
}),
|
|
3869
|
+
open: adminProcedure
|
|
3870
|
+
.input(lockControlCapability.methods.open.input.loose())
|
|
3871
|
+
.output(lockControlCapability.methods.open.output)
|
|
3872
|
+
.mutation(async ({ input, ctx }) => {
|
|
3873
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3874
|
+
const p = resolveProvider('lock-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3875
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3876
|
+
return p.open(methodInput as any)
|
|
2609
3877
|
}),
|
|
2610
3878
|
})
|
|
2611
3879
|
}
|
|
@@ -2640,6 +3908,135 @@ export function createCapRouter_logDestination(
|
|
|
2640
3908
|
})
|
|
2641
3909
|
}
|
|
2642
3910
|
|
|
3911
|
+
// ── media-player (singleton) ────────────────────────────────────────
|
|
3912
|
+
|
|
3913
|
+
type MediaPlayerProvider = InferProvider<typeof mediaPlayerCapability>
|
|
3914
|
+
|
|
3915
|
+
export function createCapRouter_mediaPlayer(
|
|
3916
|
+
getProvider: (ctx: TrpcContext) => MediaPlayerProvider | null,
|
|
3917
|
+
createRemoteProxy?: (capName: string, nodeId: string) => MediaPlayerProvider | null,
|
|
3918
|
+
) {
|
|
3919
|
+
return trpcRouter({
|
|
3920
|
+
getStatus: protectedProcedure
|
|
3921
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
3922
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
3923
|
+
.query(async ({ input, ctx }) => {
|
|
3924
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3925
|
+
const p = resolveProvider('media-player', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3926
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3927
|
+
return p.getStatus(methodInput as any)
|
|
3928
|
+
}),
|
|
3929
|
+
play: adminProcedure
|
|
3930
|
+
.input(mediaPlayerCapability.methods.play.input.loose())
|
|
3931
|
+
.output(mediaPlayerCapability.methods.play.output)
|
|
3932
|
+
.mutation(async ({ input, ctx }) => {
|
|
3933
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3934
|
+
const p = resolveProvider('media-player', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3935
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3936
|
+
return p.play(methodInput as any)
|
|
3937
|
+
}),
|
|
3938
|
+
pause: adminProcedure
|
|
3939
|
+
.input(mediaPlayerCapability.methods.pause.input.loose())
|
|
3940
|
+
.output(mediaPlayerCapability.methods.pause.output)
|
|
3941
|
+
.mutation(async ({ input, ctx }) => {
|
|
3942
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3943
|
+
const p = resolveProvider('media-player', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3944
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3945
|
+
return p.pause(methodInput as any)
|
|
3946
|
+
}),
|
|
3947
|
+
stop: adminProcedure
|
|
3948
|
+
.input(mediaPlayerCapability.methods.stop.input.loose())
|
|
3949
|
+
.output(mediaPlayerCapability.methods.stop.output)
|
|
3950
|
+
.mutation(async ({ input, ctx }) => {
|
|
3951
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3952
|
+
const p = resolveProvider('media-player', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3953
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3954
|
+
return p.stop(methodInput as any)
|
|
3955
|
+
}),
|
|
3956
|
+
next: adminProcedure
|
|
3957
|
+
.input(mediaPlayerCapability.methods.next.input.loose())
|
|
3958
|
+
.output(mediaPlayerCapability.methods.next.output)
|
|
3959
|
+
.mutation(async ({ input, ctx }) => {
|
|
3960
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3961
|
+
const p = resolveProvider('media-player', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3962
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3963
|
+
return p.next(methodInput as any)
|
|
3964
|
+
}),
|
|
3965
|
+
previous: adminProcedure
|
|
3966
|
+
.input(mediaPlayerCapability.methods.previous.input.loose())
|
|
3967
|
+
.output(mediaPlayerCapability.methods.previous.output)
|
|
3968
|
+
.mutation(async ({ input, ctx }) => {
|
|
3969
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3970
|
+
const p = resolveProvider('media-player', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3971
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3972
|
+
return p.previous(methodInput as any)
|
|
3973
|
+
}),
|
|
3974
|
+
seek: adminProcedure
|
|
3975
|
+
.input(mediaPlayerCapability.methods.seek.input.loose())
|
|
3976
|
+
.output(mediaPlayerCapability.methods.seek.output)
|
|
3977
|
+
.mutation(async ({ input, ctx }) => {
|
|
3978
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3979
|
+
const p = resolveProvider('media-player', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3980
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3981
|
+
return p.seek(methodInput as any)
|
|
3982
|
+
}),
|
|
3983
|
+
setVolume: adminProcedure
|
|
3984
|
+
.input(mediaPlayerCapability.methods.setVolume.input.loose())
|
|
3985
|
+
.output(mediaPlayerCapability.methods.setVolume.output)
|
|
3986
|
+
.mutation(async ({ input, ctx }) => {
|
|
3987
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3988
|
+
const p = resolveProvider('media-player', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3989
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3990
|
+
return p.setVolume(methodInput as any)
|
|
3991
|
+
}),
|
|
3992
|
+
setMute: adminProcedure
|
|
3993
|
+
.input(mediaPlayerCapability.methods.setMute.input.loose())
|
|
3994
|
+
.output(mediaPlayerCapability.methods.setMute.output)
|
|
3995
|
+
.mutation(async ({ input, ctx }) => {
|
|
3996
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
3997
|
+
const p = resolveProvider('media-player', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
3998
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3999
|
+
return p.setMute(methodInput as any)
|
|
4000
|
+
}),
|
|
4001
|
+
setShuffle: adminProcedure
|
|
4002
|
+
.input(mediaPlayerCapability.methods.setShuffle.input.loose())
|
|
4003
|
+
.output(mediaPlayerCapability.methods.setShuffle.output)
|
|
4004
|
+
.mutation(async ({ input, ctx }) => {
|
|
4005
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4006
|
+
const p = resolveProvider('media-player', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4007
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4008
|
+
return p.setShuffle(methodInput as any)
|
|
4009
|
+
}),
|
|
4010
|
+
setRepeat: adminProcedure
|
|
4011
|
+
.input(mediaPlayerCapability.methods.setRepeat.input.loose())
|
|
4012
|
+
.output(mediaPlayerCapability.methods.setRepeat.output)
|
|
4013
|
+
.mutation(async ({ input, ctx }) => {
|
|
4014
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4015
|
+
const p = resolveProvider('media-player', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4016
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4017
|
+
return p.setRepeat(methodInput as any)
|
|
4018
|
+
}),
|
|
4019
|
+
selectSource: adminProcedure
|
|
4020
|
+
.input(mediaPlayerCapability.methods.selectSource.input.loose())
|
|
4021
|
+
.output(mediaPlayerCapability.methods.selectSource.output)
|
|
4022
|
+
.mutation(async ({ input, ctx }) => {
|
|
4023
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4024
|
+
const p = resolveProvider('media-player', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4025
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4026
|
+
return p.selectSource(methodInput as any)
|
|
4027
|
+
}),
|
|
4028
|
+
playMedia: adminProcedure
|
|
4029
|
+
.input(mediaPlayerCapability.methods.playMedia.input.loose())
|
|
4030
|
+
.output(mediaPlayerCapability.methods.playMedia.output)
|
|
4031
|
+
.mutation(async ({ input, ctx }) => {
|
|
4032
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4033
|
+
const p = resolveProvider('media-player', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4034
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4035
|
+
return p.playMedia(methodInput as any)
|
|
4036
|
+
}),
|
|
4037
|
+
})
|
|
4038
|
+
}
|
|
4039
|
+
|
|
2643
4040
|
// ── mesh-network (collection) ────────────────────────────────────────
|
|
2644
4041
|
|
|
2645
4042
|
type MeshNetworkProvider = InferProvider<typeof meshNetworkCapability>
|
|
@@ -3305,6 +4702,66 @@ export function createCapRouter_notificationOutput(
|
|
|
3305
4702
|
})
|
|
3306
4703
|
}
|
|
3307
4704
|
|
|
4705
|
+
// ── notifier (singleton) ────────────────────────────────────────────
|
|
4706
|
+
|
|
4707
|
+
type NotifierProvider = InferProvider<typeof notifierCapability>
|
|
4708
|
+
|
|
4709
|
+
export function createCapRouter_notifier(
|
|
4710
|
+
getProvider: (ctx: TrpcContext) => NotifierProvider | null,
|
|
4711
|
+
createRemoteProxy?: (capName: string, nodeId: string) => NotifierProvider | null,
|
|
4712
|
+
) {
|
|
4713
|
+
return trpcRouter({
|
|
4714
|
+
getStatus: protectedProcedure
|
|
4715
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
4716
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
4717
|
+
.query(async ({ input, ctx }) => {
|
|
4718
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4719
|
+
const p = resolveProvider('notifier', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4720
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4721
|
+
return p.getStatus(methodInput as any)
|
|
4722
|
+
}),
|
|
4723
|
+
send: adminProcedure
|
|
4724
|
+
.input(notifierCapability.methods.send.input.loose())
|
|
4725
|
+
.output(notifierCapability.methods.send.output)
|
|
4726
|
+
.mutation(async ({ input, ctx }) => {
|
|
4727
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4728
|
+
const p = resolveProvider('notifier', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4729
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4730
|
+
return p.send(methodInput as any)
|
|
4731
|
+
}),
|
|
4732
|
+
cancel: adminProcedure
|
|
4733
|
+
.input(notifierCapability.methods.cancel.input.loose())
|
|
4734
|
+
.output(notifierCapability.methods.cancel.output)
|
|
4735
|
+
.mutation(async ({ input, ctx }) => {
|
|
4736
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4737
|
+
const p = resolveProvider('notifier', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4738
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4739
|
+
return p.cancel(methodInput as any)
|
|
4740
|
+
}),
|
|
4741
|
+
})
|
|
4742
|
+
}
|
|
4743
|
+
|
|
4744
|
+
// ── numeric-sensor (singleton) ──────────────────────────────────────
|
|
4745
|
+
|
|
4746
|
+
type NumericSensorProvider = InferProvider<typeof numericSensorCapability>
|
|
4747
|
+
|
|
4748
|
+
export function createCapRouter_numericSensor(
|
|
4749
|
+
getProvider: (ctx: TrpcContext) => NumericSensorProvider | null,
|
|
4750
|
+
createRemoteProxy?: (capName: string, nodeId: string) => NumericSensorProvider | null,
|
|
4751
|
+
) {
|
|
4752
|
+
return trpcRouter({
|
|
4753
|
+
getStatus: protectedProcedure
|
|
4754
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
4755
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
4756
|
+
.query(async ({ input, ctx }) => {
|
|
4757
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4758
|
+
const p = resolveProvider('numeric-sensor', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4759
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4760
|
+
return p.getStatus(methodInput as any)
|
|
4761
|
+
}),
|
|
4762
|
+
})
|
|
4763
|
+
}
|
|
4764
|
+
|
|
3308
4765
|
// ── oauth-integration (collection) ───────────────────────────────────
|
|
3309
4766
|
|
|
3310
4767
|
type OauthIntegrationProvider = InferProvider<typeof oauthIntegrationCapability>
|
|
@@ -3453,6 +4910,24 @@ export function createCapRouter_pipelineAnalytics(
|
|
|
3453
4910
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3454
4911
|
return p.getAudioEvents(methodInput as any)
|
|
3455
4912
|
}),
|
|
4913
|
+
getEventDensity: protectedProcedure
|
|
4914
|
+
.input(pipelineAnalyticsCapability.methods.getEventDensity.input.loose())
|
|
4915
|
+
.output(pipelineAnalyticsCapability.methods.getEventDensity.output)
|
|
4916
|
+
.query(async ({ input, ctx }) => {
|
|
4917
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4918
|
+
const p = resolveProvider('pipeline-analytics', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4919
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4920
|
+
return p.getEventDensity(methodInput as any)
|
|
4921
|
+
}),
|
|
4922
|
+
pruneEventsBefore: adminProcedure
|
|
4923
|
+
.input(pipelineAnalyticsCapability.methods.pruneEventsBefore.input.loose())
|
|
4924
|
+
.output(pipelineAnalyticsCapability.methods.pruneEventsBefore.output)
|
|
4925
|
+
.mutation(async ({ input, ctx }) => {
|
|
4926
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4927
|
+
const p = resolveProvider('pipeline-analytics', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4928
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4929
|
+
return p.pruneEventsBefore(methodInput as any)
|
|
4930
|
+
}),
|
|
3456
4931
|
getEventMedia: protectedProcedure
|
|
3457
4932
|
.input(pipelineAnalyticsCapability.methods.getEventMedia.input.loose())
|
|
3458
4933
|
.output(pipelineAnalyticsCapability.methods.getEventMedia.output)
|
|
@@ -4218,6 +5693,83 @@ export function createCapRouter_platformProbe(
|
|
|
4218
5693
|
const p = resolveProvider('platform-probe', input?.nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4219
5694
|
return p.refreshHardwareEncoders()
|
|
4220
5695
|
}),
|
|
5696
|
+
getHardwareDecodeAccels: protectedProcedure
|
|
5697
|
+
.input(z.object({ nodeId: z.string().optional() }).optional())
|
|
5698
|
+
.output(platformProbeCapability.methods.getHardwareDecodeAccels.output)
|
|
5699
|
+
.query(async ({ input, ctx }) => {
|
|
5700
|
+
const p = resolveProvider('platform-probe', input?.nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
5701
|
+
return p.getHardwareDecodeAccels()
|
|
5702
|
+
}),
|
|
5703
|
+
refreshHardwareDecodeAccels: adminProcedure
|
|
5704
|
+
.input(z.object({ nodeId: z.string().optional() }).optional())
|
|
5705
|
+
.output(platformProbeCapability.methods.refreshHardwareDecodeAccels.output)
|
|
5706
|
+
.mutation(async ({ input, ctx }) => {
|
|
5707
|
+
const p = resolveProvider('platform-probe', input?.nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
5708
|
+
return p.refreshHardwareDecodeAccels()
|
|
5709
|
+
}),
|
|
5710
|
+
})
|
|
5711
|
+
}
|
|
5712
|
+
|
|
5713
|
+
// ── power-meter (singleton) ─────────────────────────────────────────
|
|
5714
|
+
|
|
5715
|
+
type PowerMeterProvider = InferProvider<typeof powerMeterCapability>
|
|
5716
|
+
|
|
5717
|
+
export function createCapRouter_powerMeter(
|
|
5718
|
+
getProvider: (ctx: TrpcContext) => PowerMeterProvider | null,
|
|
5719
|
+
createRemoteProxy?: (capName: string, nodeId: string) => PowerMeterProvider | null,
|
|
5720
|
+
) {
|
|
5721
|
+
return trpcRouter({
|
|
5722
|
+
getStatus: protectedProcedure
|
|
5723
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
5724
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
5725
|
+
.query(async ({ input, ctx }) => {
|
|
5726
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
5727
|
+
const p = resolveProvider('power-meter', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
5728
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
5729
|
+
return p.getStatus(methodInput as any)
|
|
5730
|
+
}),
|
|
5731
|
+
})
|
|
5732
|
+
}
|
|
5733
|
+
|
|
5734
|
+
// ── presence (singleton) ────────────────────────────────────────────
|
|
5735
|
+
|
|
5736
|
+
type PresenceProvider = InferProvider<typeof presenceCapability>
|
|
5737
|
+
|
|
5738
|
+
export function createCapRouter_presence(
|
|
5739
|
+
getProvider: (ctx: TrpcContext) => PresenceProvider | null,
|
|
5740
|
+
createRemoteProxy?: (capName: string, nodeId: string) => PresenceProvider | null,
|
|
5741
|
+
) {
|
|
5742
|
+
return trpcRouter({
|
|
5743
|
+
getStatus: protectedProcedure
|
|
5744
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
5745
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
5746
|
+
.query(async ({ input, ctx }) => {
|
|
5747
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
5748
|
+
const p = resolveProvider('presence', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
5749
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
5750
|
+
return p.getStatus(methodInput as any)
|
|
5751
|
+
}),
|
|
5752
|
+
})
|
|
5753
|
+
}
|
|
5754
|
+
|
|
5755
|
+
// ── pressure-sensor (singleton) ─────────────────────────────────────
|
|
5756
|
+
|
|
5757
|
+
type PressureSensorProvider = InferProvider<typeof pressureSensorCapability>
|
|
5758
|
+
|
|
5759
|
+
export function createCapRouter_pressureSensor(
|
|
5760
|
+
getProvider: (ctx: TrpcContext) => PressureSensorProvider | null,
|
|
5761
|
+
createRemoteProxy?: (capName: string, nodeId: string) => PressureSensorProvider | null,
|
|
5762
|
+
) {
|
|
5763
|
+
return trpcRouter({
|
|
5764
|
+
getStatus: protectedProcedure
|
|
5765
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
5766
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
5767
|
+
.query(async ({ input, ctx }) => {
|
|
5768
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
5769
|
+
const p = resolveProvider('pressure-sensor', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
5770
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
5771
|
+
return p.getStatus(methodInput as any)
|
|
5772
|
+
}),
|
|
4221
5773
|
})
|
|
4222
5774
|
}
|
|
4223
5775
|
|
|
@@ -4458,202 +6010,104 @@ export function createCapRouter_recording(
|
|
|
4458
6010
|
createRemoteProxy?: (capName: string, nodeId: string) => RecordingProvider | null,
|
|
4459
6011
|
) {
|
|
4460
6012
|
return trpcRouter({
|
|
4461
|
-
|
|
4462
|
-
.input(
|
|
4463
|
-
.output(
|
|
6013
|
+
getStatus: protectedProcedure
|
|
6014
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
6015
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
4464
6016
|
.query(async ({ input, ctx }) => {
|
|
4465
6017
|
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4466
6018
|
const p = resolveProvider('recording', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4467
6019
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4468
|
-
return p.
|
|
6020
|
+
return p.getStatus(methodInput as any)
|
|
4469
6021
|
}),
|
|
4470
|
-
|
|
4471
|
-
.input(
|
|
4472
|
-
.output(
|
|
6022
|
+
getDeviceSettingsContribution: protectedProcedure
|
|
6023
|
+
.input(DEVICE_SETTINGS_CONTRIBUTION_METHODS.getDeviceSettingsContribution.input.loose())
|
|
6024
|
+
.output(DEVICE_SETTINGS_CONTRIBUTION_METHODS.getDeviceSettingsContribution.output)
|
|
4473
6025
|
.query(async ({ input, ctx }) => {
|
|
4474
6026
|
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4475
6027
|
const p = resolveProvider('recording', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4476
6028
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4477
|
-
return p.
|
|
6029
|
+
return p.getDeviceSettingsContribution(methodInput as any)
|
|
4478
6030
|
}),
|
|
4479
|
-
|
|
4480
|
-
.input(
|
|
4481
|
-
.output(
|
|
6031
|
+
getDeviceLiveContribution: protectedProcedure
|
|
6032
|
+
.input(DEVICE_SETTINGS_CONTRIBUTION_METHODS.getDeviceLiveContribution.input.loose())
|
|
6033
|
+
.output(DEVICE_SETTINGS_CONTRIBUTION_METHODS.getDeviceLiveContribution.output)
|
|
4482
6034
|
.query(async ({ input, ctx }) => {
|
|
4483
6035
|
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4484
6036
|
const p = resolveProvider('recording', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4485
6037
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4486
|
-
return p.
|
|
4487
|
-
}),
|
|
4488
|
-
})
|
|
4489
|
-
}
|
|
4490
|
-
|
|
4491
|
-
// ── recording-engine (singleton) ────────────────────────────────────
|
|
4492
|
-
|
|
4493
|
-
type RecordingEngineProvider = InferProvider<typeof recordingEngineCapability>
|
|
4494
|
-
|
|
4495
|
-
export function createCapRouter_recordingEngine(
|
|
4496
|
-
getProvider: (ctx: TrpcContext) => RecordingEngineProvider | null,
|
|
4497
|
-
createRemoteProxy?: (capName: string, nodeId: string) => RecordingEngineProvider | null,
|
|
4498
|
-
) {
|
|
4499
|
-
return trpcRouter({
|
|
4500
|
-
getStatus: protectedProcedure
|
|
4501
|
-
.input(z.object({ nodeId: z.string().optional() }).optional())
|
|
4502
|
-
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
4503
|
-
.query(async ({ input, ctx }) => {
|
|
4504
|
-
const p = resolveProvider('recording-engine', input?.nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4505
|
-
return p.getStatus()
|
|
4506
|
-
}),
|
|
4507
|
-
enable: adminProcedure
|
|
4508
|
-
.input(recordingEngineCapability.methods.enable.input.loose())
|
|
4509
|
-
.output(recordingEngineCapability.methods.enable.output)
|
|
4510
|
-
.mutation(async ({ input, ctx }) => {
|
|
4511
|
-
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4512
|
-
const p = resolveProvider('recording-engine', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4513
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4514
|
-
return p.enable(methodInput as any)
|
|
4515
|
-
}),
|
|
4516
|
-
disable: adminProcedure
|
|
4517
|
-
.input(recordingEngineCapability.methods.disable.input.loose())
|
|
4518
|
-
.output(recordingEngineCapability.methods.disable.output)
|
|
4519
|
-
.mutation(async ({ input, ctx }) => {
|
|
4520
|
-
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4521
|
-
const p = resolveProvider('recording-engine', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4522
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4523
|
-
return p.disable(methodInput as any)
|
|
4524
|
-
}),
|
|
4525
|
-
getConfig: protectedProcedure
|
|
4526
|
-
.input(recordingEngineCapability.methods.getConfig.input.loose())
|
|
4527
|
-
.output(recordingEngineCapability.methods.getConfig.output)
|
|
4528
|
-
.query(async ({ input, ctx }) => {
|
|
4529
|
-
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4530
|
-
const p = resolveProvider('recording-engine', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4531
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4532
|
-
return p.getConfig(methodInput as any)
|
|
6038
|
+
return p.getDeviceLiveContribution(methodInput as any)
|
|
4533
6039
|
}),
|
|
4534
|
-
|
|
4535
|
-
.input(
|
|
4536
|
-
.output(
|
|
6040
|
+
applyDeviceSettingsPatch: adminProcedure
|
|
6041
|
+
.input(DEVICE_SETTINGS_CONTRIBUTION_METHODS.applyDeviceSettingsPatch.input.loose())
|
|
6042
|
+
.output(DEVICE_SETTINGS_CONTRIBUTION_METHODS.applyDeviceSettingsPatch.output)
|
|
4537
6043
|
.mutation(async ({ input, ctx }) => {
|
|
4538
6044
|
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4539
|
-
const p = resolveProvider('recording
|
|
4540
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4541
|
-
return p.updateConfig(methodInput as any)
|
|
4542
|
-
}),
|
|
4543
|
-
getPlaylist: protectedProcedure
|
|
4544
|
-
.input(recordingEngineCapability.methods.getPlaylist.input.loose())
|
|
4545
|
-
.output(recordingEngineCapability.methods.getPlaylist.output)
|
|
4546
|
-
.query(async ({ input, ctx }) => {
|
|
4547
|
-
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4548
|
-
const p = resolveProvider('recording-engine', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4549
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4550
|
-
return p.getPlaylist(methodInput as any)
|
|
4551
|
-
}),
|
|
4552
|
-
getThumbnail: protectedProcedure
|
|
4553
|
-
.input(recordingEngineCapability.methods.getThumbnail.input.loose())
|
|
4554
|
-
.output(recordingEngineCapability.methods.getThumbnail.output)
|
|
4555
|
-
.query(async ({ input, ctx }) => {
|
|
4556
|
-
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4557
|
-
const p = resolveProvider('recording-engine', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4558
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4559
|
-
return p.getThumbnail(methodInput as any)
|
|
4560
|
-
}),
|
|
4561
|
-
getSegments: protectedProcedure
|
|
4562
|
-
.input(recordingEngineCapability.methods.getSegments.input.loose())
|
|
4563
|
-
.output(recordingEngineCapability.methods.getSegments.output)
|
|
4564
|
-
.query(async ({ input, ctx }) => {
|
|
4565
|
-
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4566
|
-
const p = resolveProvider('recording-engine', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
6045
|
+
const p = resolveProvider('recording', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4567
6046
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4568
|
-
return p.
|
|
6047
|
+
return p.applyDeviceSettingsPatch(methodInput as any)
|
|
4569
6048
|
}),
|
|
4570
|
-
getAvailability:
|
|
4571
|
-
.input(
|
|
4572
|
-
.output(
|
|
6049
|
+
getAvailability: adminProcedure
|
|
6050
|
+
.input(recordingCapability.methods.getAvailability.input.loose())
|
|
6051
|
+
.output(recordingCapability.methods.getAvailability.output)
|
|
4573
6052
|
.query(async ({ input, ctx }) => {
|
|
4574
6053
|
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4575
|
-
const p = resolveProvider('recording
|
|
6054
|
+
const p = resolveProvider('recording', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4576
6055
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4577
6056
|
return p.getAvailability(methodInput as any)
|
|
4578
6057
|
}),
|
|
4579
|
-
|
|
4580
|
-
.input(
|
|
4581
|
-
.output(
|
|
4582
|
-
.query(async ({ input, ctx }) => {
|
|
4583
|
-
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4584
|
-
const p = resolveProvider('recording-engine', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4585
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4586
|
-
return p.estimateStorage(methodInput as any)
|
|
4587
|
-
}),
|
|
4588
|
-
estimateGlobalStorage: protectedProcedure
|
|
4589
|
-
.input(z.object({ nodeId: z.string().optional() }).optional())
|
|
4590
|
-
.output(recordingEngineCapability.methods.estimateGlobalStorage.output)
|
|
4591
|
-
.query(async ({ input, ctx }) => {
|
|
4592
|
-
const p = resolveProvider('recording-engine', input?.nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4593
|
-
return p.estimateGlobalStorage()
|
|
4594
|
-
}),
|
|
4595
|
-
getStorageUsage: protectedProcedure
|
|
4596
|
-
.input(recordingEngineCapability.methods.getStorageUsage.input.loose())
|
|
4597
|
-
.output(recordingEngineCapability.methods.getStorageUsage.output)
|
|
6058
|
+
getPlaybackManifest: adminProcedure
|
|
6059
|
+
.input(recordingCapability.methods.getPlaybackManifest.input.loose())
|
|
6060
|
+
.output(recordingCapability.methods.getPlaybackManifest.output)
|
|
4598
6061
|
.query(async ({ input, ctx }) => {
|
|
4599
6062
|
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4600
|
-
const p = resolveProvider('recording
|
|
4601
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4602
|
-
return p.getStorageUsage(methodInput as any)
|
|
4603
|
-
}),
|
|
4604
|
-
setPolicy: adminProcedure
|
|
4605
|
-
.input(recordingEngineCapability.methods.setPolicy.input.loose())
|
|
4606
|
-
.output(recordingEngineCapability.methods.setPolicy.output)
|
|
4607
|
-
.mutation(async ({ input, ctx }) => {
|
|
4608
|
-
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4609
|
-
const p = resolveProvider('recording-engine', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
6063
|
+
const p = resolveProvider('recording', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4610
6064
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4611
|
-
return p.
|
|
6065
|
+
return p.getPlaybackManifest(methodInput as any)
|
|
4612
6066
|
}),
|
|
4613
|
-
|
|
4614
|
-
.input(
|
|
4615
|
-
.output(
|
|
6067
|
+
getStorageUsage: adminProcedure
|
|
6068
|
+
.input(recordingCapability.methods.getStorageUsage.input.loose())
|
|
6069
|
+
.output(recordingCapability.methods.getStorageUsage.output)
|
|
4616
6070
|
.query(async ({ input, ctx }) => {
|
|
4617
6071
|
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4618
|
-
const p = resolveProvider('recording
|
|
6072
|
+
const p = resolveProvider('recording', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4619
6073
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4620
|
-
return p.
|
|
6074
|
+
return p.getStorageUsage(methodInput as any)
|
|
4621
6075
|
}),
|
|
4622
|
-
|
|
4623
|
-
.input(
|
|
4624
|
-
.output(
|
|
6076
|
+
getDeviceConfig: adminProcedure
|
|
6077
|
+
.input(recordingCapability.methods.getDeviceConfig.input.loose())
|
|
6078
|
+
.output(recordingCapability.methods.getDeviceConfig.output)
|
|
4625
6079
|
.query(async ({ input, ctx }) => {
|
|
4626
6080
|
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4627
|
-
const p = resolveProvider('recording
|
|
6081
|
+
const p = resolveProvider('recording', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4628
6082
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4629
|
-
return p.
|
|
6083
|
+
return p.getDeviceConfig(methodInput as any)
|
|
4630
6084
|
}),
|
|
4631
|
-
|
|
4632
|
-
.input(
|
|
4633
|
-
.output(
|
|
4634
|
-
.
|
|
6085
|
+
setDeviceConfig: adminProcedure
|
|
6086
|
+
.input(recordingCapability.methods.setDeviceConfig.input.loose())
|
|
6087
|
+
.output(recordingCapability.methods.setDeviceConfig.output)
|
|
6088
|
+
.mutation(async ({ input, ctx }) => {
|
|
4635
6089
|
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4636
|
-
const p = resolveProvider('recording
|
|
6090
|
+
const p = resolveProvider('recording', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4637
6091
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4638
|
-
return p.
|
|
6092
|
+
return p.setDeviceConfig(methodInput as any)
|
|
4639
6093
|
}),
|
|
4640
|
-
|
|
4641
|
-
.input(
|
|
4642
|
-
.output(
|
|
6094
|
+
rescanStorage: adminProcedure
|
|
6095
|
+
.input(recordingCapability.methods.rescanStorage.input.loose())
|
|
6096
|
+
.output(recordingCapability.methods.rescanStorage.output)
|
|
4643
6097
|
.mutation(async ({ input, ctx }) => {
|
|
4644
6098
|
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4645
|
-
const p = resolveProvider('recording
|
|
6099
|
+
const p = resolveProvider('recording', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4646
6100
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4647
|
-
return p.
|
|
6101
|
+
return p.rescanStorage(methodInput as any)
|
|
4648
6102
|
}),
|
|
4649
|
-
|
|
4650
|
-
.input(
|
|
4651
|
-
.output(
|
|
4652
|
-
.
|
|
6103
|
+
pruneFootage: adminProcedure
|
|
6104
|
+
.input(recordingCapability.methods.pruneFootage.input.loose())
|
|
6105
|
+
.output(recordingCapability.methods.pruneFootage.output)
|
|
6106
|
+
.mutation(async ({ input, ctx }) => {
|
|
4653
6107
|
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
4654
|
-
const p = resolveProvider('recording
|
|
6108
|
+
const p = resolveProvider('recording', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
4655
6109
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4656
|
-
return p.
|
|
6110
|
+
return p.pruneFootage(methodInput as any)
|
|
4657
6111
|
}),
|
|
4658
6112
|
})
|
|
4659
6113
|
}
|
|
@@ -4697,6 +6151,45 @@ export function createCapRouter_restreamer(
|
|
|
4697
6151
|
})
|
|
4698
6152
|
}
|
|
4699
6153
|
|
|
6154
|
+
// ── script-runner (singleton) ───────────────────────────────────────
|
|
6155
|
+
|
|
6156
|
+
type ScriptRunnerProvider = InferProvider<typeof scriptRunnerCapability>
|
|
6157
|
+
|
|
6158
|
+
export function createCapRouter_scriptRunner(
|
|
6159
|
+
getProvider: (ctx: TrpcContext) => ScriptRunnerProvider | null,
|
|
6160
|
+
createRemoteProxy?: (capName: string, nodeId: string) => ScriptRunnerProvider | null,
|
|
6161
|
+
) {
|
|
6162
|
+
return trpcRouter({
|
|
6163
|
+
getStatus: protectedProcedure
|
|
6164
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
6165
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
6166
|
+
.query(async ({ input, ctx }) => {
|
|
6167
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
6168
|
+
const p = resolveProvider('script-runner', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
6169
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
6170
|
+
return p.getStatus(methodInput as any)
|
|
6171
|
+
}),
|
|
6172
|
+
run: adminProcedure
|
|
6173
|
+
.input(scriptRunnerCapability.methods.run.input.loose())
|
|
6174
|
+
.output(scriptRunnerCapability.methods.run.output)
|
|
6175
|
+
.mutation(async ({ input, ctx }) => {
|
|
6176
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
6177
|
+
const p = resolveProvider('script-runner', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
6178
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
6179
|
+
return p.run(methodInput as any)
|
|
6180
|
+
}),
|
|
6181
|
+
stop: adminProcedure
|
|
6182
|
+
.input(scriptRunnerCapability.methods.stop.input.loose())
|
|
6183
|
+
.output(scriptRunnerCapability.methods.stop.output)
|
|
6184
|
+
.mutation(async ({ input, ctx }) => {
|
|
6185
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
6186
|
+
const p = resolveProvider('script-runner', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
6187
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
6188
|
+
return p.stop(methodInput as any)
|
|
6189
|
+
}),
|
|
6190
|
+
})
|
|
6191
|
+
}
|
|
6192
|
+
|
|
4700
6193
|
// ── settings-store (singleton) ──────────────────────────────────────
|
|
4701
6194
|
|
|
4702
6195
|
type SettingsStoreProvider = InferProvider<typeof settingsStoreCapability>
|
|
@@ -4769,6 +6262,15 @@ export function createCapRouter_settingsStore(
|
|
|
4769
6262
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
4770
6263
|
return p.count(methodInput as any)
|
|
4771
6264
|
}),
|
|
6265
|
+
histogram: protectedProcedure
|
|
6266
|
+
.input(settingsStoreCapability.methods.histogram.input.loose())
|
|
6267
|
+
.output(settingsStoreCapability.methods.histogram.output)
|
|
6268
|
+
.query(async ({ input, ctx }) => {
|
|
6269
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
6270
|
+
const p = resolveProvider('settings-store', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
6271
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
6272
|
+
return p.histogram(methodInput as any)
|
|
6273
|
+
}),
|
|
4772
6274
|
isEmpty: protectedProcedure
|
|
4773
6275
|
.input(settingsStoreCapability.methods.isEmpty.input.loose())
|
|
4774
6276
|
.output(settingsStoreCapability.methods.isEmpty.output)
|
|
@@ -4790,6 +6292,27 @@ export function createCapRouter_settingsStore(
|
|
|
4790
6292
|
})
|
|
4791
6293
|
}
|
|
4792
6294
|
|
|
6295
|
+
// ── smoke (singleton) ───────────────────────────────────────────────
|
|
6296
|
+
|
|
6297
|
+
type SmokeProvider = InferProvider<typeof smokeCapability>
|
|
6298
|
+
|
|
6299
|
+
export function createCapRouter_smoke(
|
|
6300
|
+
getProvider: (ctx: TrpcContext) => SmokeProvider | null,
|
|
6301
|
+
createRemoteProxy?: (capName: string, nodeId: string) => SmokeProvider | null,
|
|
6302
|
+
) {
|
|
6303
|
+
return trpcRouter({
|
|
6304
|
+
getStatus: protectedProcedure
|
|
6305
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
6306
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
6307
|
+
.query(async ({ input, ctx }) => {
|
|
6308
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
6309
|
+
const p = resolveProvider('smoke', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
6310
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
6311
|
+
return p.getStatus(methodInput as any)
|
|
6312
|
+
}),
|
|
6313
|
+
})
|
|
6314
|
+
}
|
|
6315
|
+
|
|
4793
6316
|
// ── smtp-provider (collection) ───────────────────────────────────────
|
|
4794
6317
|
|
|
4795
6318
|
type SmtpProviderProvider = InferProvider<typeof smtpProviderCapability>
|
|
@@ -5104,6 +6627,13 @@ export function createCapRouter_storage(
|
|
|
5104
6627
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
5105
6628
|
return p.getDefaultLocation(methodInput as any)
|
|
5106
6629
|
}),
|
|
6630
|
+
listLocationDeclarations: protectedProcedure
|
|
6631
|
+
.input(z.object({ nodeId: z.string().optional() }).optional())
|
|
6632
|
+
.output(storageCapability.methods.listLocationDeclarations.output)
|
|
6633
|
+
.query(async ({ input, ctx }) => {
|
|
6634
|
+
const p = resolveProvider('storage', input?.nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
6635
|
+
return p.listLocationDeclarations()
|
|
6636
|
+
}),
|
|
5107
6637
|
upsertLocation: adminProcedure
|
|
5108
6638
|
.input(storageCapability.methods.upsertLocation.input.loose())
|
|
5109
6639
|
.output(storageCapability.methods.upsertLocation.output)
|
|
@@ -5150,6 +6680,36 @@ export function createCapRouter_storage(
|
|
|
5150
6680
|
})
|
|
5151
6681
|
}
|
|
5152
6682
|
|
|
6683
|
+
// ── storage-evictable (collection) ───────────────────────────────────
|
|
6684
|
+
|
|
6685
|
+
type StorageEvictableProvider = InferProvider<typeof storageEvictableCapability>
|
|
6686
|
+
|
|
6687
|
+
export function createCapRouter_storageEvictable(
|
|
6688
|
+
getProvider: (ctx: TrpcContext, addonId?: string) => StorageEvictableProvider | null,
|
|
6689
|
+
createRemoteProxy?: (capName: string, nodeId: string) => StorageEvictableProvider | null,
|
|
6690
|
+
) {
|
|
6691
|
+
return trpcRouter({
|
|
6692
|
+
getEvictableUsage: protectedProcedure
|
|
6693
|
+
.input(storageEvictableCapability.methods.getEvictableUsage.input.loose())
|
|
6694
|
+
.output(storageEvictableCapability.methods.getEvictableUsage.output)
|
|
6695
|
+
.query(async ({ input, ctx }) => {
|
|
6696
|
+
const { nodeId, addonId, ...methodInput } = input as { nodeId?: string; addonId?: string } & Record<string, unknown>
|
|
6697
|
+
const p = resolveProvider('storage-evictable', nodeId, () => getProvider(ctx, addonId), createRemoteProxy)
|
|
6698
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
6699
|
+
return p.getEvictableUsage(methodInput as any)
|
|
6700
|
+
}),
|
|
6701
|
+
evict: protectedProcedure
|
|
6702
|
+
.input(storageEvictableCapability.methods.evict.input.loose())
|
|
6703
|
+
.output(storageEvictableCapability.methods.evict.output)
|
|
6704
|
+
.mutation(async ({ input, ctx }) => {
|
|
6705
|
+
const { nodeId, addonId, ...methodInput } = input as { nodeId?: string; addonId?: string } & Record<string, unknown>
|
|
6706
|
+
const p = resolveProvider('storage-evictable', nodeId, () => getProvider(ctx, addonId), createRemoteProxy)
|
|
6707
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
6708
|
+
return p.evict(methodInput as any)
|
|
6709
|
+
}),
|
|
6710
|
+
})
|
|
6711
|
+
}
|
|
6712
|
+
|
|
5153
6713
|
// ── storage-provider (collection) ────────────────────────────────────
|
|
5154
6714
|
|
|
5155
6715
|
type StorageProviderProvider = InferProvider<typeof storageProviderCapability>
|
|
@@ -5786,6 +7346,48 @@ export function createCapRouter_system(
|
|
|
5786
7346
|
})
|
|
5787
7347
|
}
|
|
5788
7348
|
|
|
7349
|
+
// ── tamper (singleton) ──────────────────────────────────────────────
|
|
7350
|
+
|
|
7351
|
+
type TamperProvider = InferProvider<typeof tamperCapability>
|
|
7352
|
+
|
|
7353
|
+
export function createCapRouter_tamper(
|
|
7354
|
+
getProvider: (ctx: TrpcContext) => TamperProvider | null,
|
|
7355
|
+
createRemoteProxy?: (capName: string, nodeId: string) => TamperProvider | null,
|
|
7356
|
+
) {
|
|
7357
|
+
return trpcRouter({
|
|
7358
|
+
getStatus: protectedProcedure
|
|
7359
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
7360
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
7361
|
+
.query(async ({ input, ctx }) => {
|
|
7362
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7363
|
+
const p = resolveProvider('tamper', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7364
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7365
|
+
return p.getStatus(methodInput as any)
|
|
7366
|
+
}),
|
|
7367
|
+
})
|
|
7368
|
+
}
|
|
7369
|
+
|
|
7370
|
+
// ── temperature-sensor (singleton) ──────────────────────────────────
|
|
7371
|
+
|
|
7372
|
+
type TemperatureSensorProvider = InferProvider<typeof temperatureSensorCapability>
|
|
7373
|
+
|
|
7374
|
+
export function createCapRouter_temperatureSensor(
|
|
7375
|
+
getProvider: (ctx: TrpcContext) => TemperatureSensorProvider | null,
|
|
7376
|
+
createRemoteProxy?: (capName: string, nodeId: string) => TemperatureSensorProvider | null,
|
|
7377
|
+
) {
|
|
7378
|
+
return trpcRouter({
|
|
7379
|
+
getStatus: protectedProcedure
|
|
7380
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
7381
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
7382
|
+
.query(async ({ input, ctx }) => {
|
|
7383
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7384
|
+
const p = resolveProvider('temperature-sensor', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7385
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7386
|
+
return p.getStatus(methodInput as any)
|
|
7387
|
+
}),
|
|
7388
|
+
})
|
|
7389
|
+
}
|
|
7390
|
+
|
|
5789
7391
|
// ── toast (singleton) ───────────────────────────────────────────────
|
|
5790
7392
|
|
|
5791
7393
|
type ToastProvider = InferProvider<typeof toastCapability>
|
|
@@ -5825,6 +7427,34 @@ export function createCapRouter_turnProvider(
|
|
|
5825
7427
|
})
|
|
5826
7428
|
}
|
|
5827
7429
|
|
|
7430
|
+
// ── update (singleton) ──────────────────────────────────────────────
|
|
7431
|
+
|
|
7432
|
+
type UpdateProvider = InferProvider<typeof updateCapability>
|
|
7433
|
+
|
|
7434
|
+
export function createCapRouter_update(
|
|
7435
|
+
getProvider: (ctx: TrpcContext) => UpdateProvider | null,
|
|
7436
|
+
createRemoteProxy?: (capName: string, nodeId: string) => UpdateProvider | null,
|
|
7437
|
+
) {
|
|
7438
|
+
return trpcRouter({
|
|
7439
|
+
getStatus: protectedProcedure
|
|
7440
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
7441
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
7442
|
+
.query(async ({ input, ctx }) => {
|
|
7443
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7444
|
+
const p = resolveProvider('update', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7445
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7446
|
+
return p.getStatus(methodInput as any)
|
|
7447
|
+
}),
|
|
7448
|
+
installUpdate: adminProcedure
|
|
7449
|
+
.input(z.object({ nodeId: z.string().optional() }).optional())
|
|
7450
|
+
.output(updateCapability.methods.installUpdate.output)
|
|
7451
|
+
.mutation(async ({ input, ctx }) => {
|
|
7452
|
+
const p = resolveProvider('update', input?.nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7453
|
+
return p.installUpdate()
|
|
7454
|
+
}),
|
|
7455
|
+
})
|
|
7456
|
+
}
|
|
7457
|
+
|
|
5828
7458
|
// ── user-management (singleton) ─────────────────────────────────────
|
|
5829
7459
|
|
|
5830
7460
|
type UserManagementProvider = InferProvider<typeof userManagementCapability>
|
|
@@ -6131,6 +7761,228 @@ export function createCapRouter_userPasskeys(
|
|
|
6131
7761
|
})
|
|
6132
7762
|
}
|
|
6133
7763
|
|
|
7764
|
+
// ── vacuum-control (singleton) ──────────────────────────────────────
|
|
7765
|
+
|
|
7766
|
+
type VacuumControlProvider = InferProvider<typeof vacuumControlCapability>
|
|
7767
|
+
|
|
7768
|
+
export function createCapRouter_vacuumControl(
|
|
7769
|
+
getProvider: (ctx: TrpcContext) => VacuumControlProvider | null,
|
|
7770
|
+
createRemoteProxy?: (capName: string, nodeId: string) => VacuumControlProvider | null,
|
|
7771
|
+
) {
|
|
7772
|
+
return trpcRouter({
|
|
7773
|
+
getStatus: protectedProcedure
|
|
7774
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
7775
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
7776
|
+
.query(async ({ input, ctx }) => {
|
|
7777
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7778
|
+
const p = resolveProvider('vacuum-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7779
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7780
|
+
return p.getStatus(methodInput as any)
|
|
7781
|
+
}),
|
|
7782
|
+
start: adminProcedure
|
|
7783
|
+
.input(vacuumControlCapability.methods.start.input.loose())
|
|
7784
|
+
.output(vacuumControlCapability.methods.start.output)
|
|
7785
|
+
.mutation(async ({ input, ctx }) => {
|
|
7786
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7787
|
+
const p = resolveProvider('vacuum-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7788
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7789
|
+
return p.start(methodInput as any)
|
|
7790
|
+
}),
|
|
7791
|
+
pause: adminProcedure
|
|
7792
|
+
.input(vacuumControlCapability.methods.pause.input.loose())
|
|
7793
|
+
.output(vacuumControlCapability.methods.pause.output)
|
|
7794
|
+
.mutation(async ({ input, ctx }) => {
|
|
7795
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7796
|
+
const p = resolveProvider('vacuum-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7797
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7798
|
+
return p.pause(methodInput as any)
|
|
7799
|
+
}),
|
|
7800
|
+
stop: adminProcedure
|
|
7801
|
+
.input(vacuumControlCapability.methods.stop.input.loose())
|
|
7802
|
+
.output(vacuumControlCapability.methods.stop.output)
|
|
7803
|
+
.mutation(async ({ input, ctx }) => {
|
|
7804
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7805
|
+
const p = resolveProvider('vacuum-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7806
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7807
|
+
return p.stop(methodInput as any)
|
|
7808
|
+
}),
|
|
7809
|
+
returnToBase: adminProcedure
|
|
7810
|
+
.input(vacuumControlCapability.methods.returnToBase.input.loose())
|
|
7811
|
+
.output(vacuumControlCapability.methods.returnToBase.output)
|
|
7812
|
+
.mutation(async ({ input, ctx }) => {
|
|
7813
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7814
|
+
const p = resolveProvider('vacuum-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7815
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7816
|
+
return p.returnToBase(methodInput as any)
|
|
7817
|
+
}),
|
|
7818
|
+
locate: adminProcedure
|
|
7819
|
+
.input(vacuumControlCapability.methods.locate.input.loose())
|
|
7820
|
+
.output(vacuumControlCapability.methods.locate.output)
|
|
7821
|
+
.mutation(async ({ input, ctx }) => {
|
|
7822
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7823
|
+
const p = resolveProvider('vacuum-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7824
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7825
|
+
return p.locate(methodInput as any)
|
|
7826
|
+
}),
|
|
7827
|
+
setFanSpeed: adminProcedure
|
|
7828
|
+
.input(vacuumControlCapability.methods.setFanSpeed.input.loose())
|
|
7829
|
+
.output(vacuumControlCapability.methods.setFanSpeed.output)
|
|
7830
|
+
.mutation(async ({ input, ctx }) => {
|
|
7831
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7832
|
+
const p = resolveProvider('vacuum-control', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7833
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7834
|
+
return p.setFanSpeed(methodInput as any)
|
|
7835
|
+
}),
|
|
7836
|
+
})
|
|
7837
|
+
}
|
|
7838
|
+
|
|
7839
|
+
// ── valve (singleton) ───────────────────────────────────────────────
|
|
7840
|
+
|
|
7841
|
+
type ValveProvider = InferProvider<typeof valveCapability>
|
|
7842
|
+
|
|
7843
|
+
export function createCapRouter_valve(
|
|
7844
|
+
getProvider: (ctx: TrpcContext) => ValveProvider | null,
|
|
7845
|
+
createRemoteProxy?: (capName: string, nodeId: string) => ValveProvider | null,
|
|
7846
|
+
) {
|
|
7847
|
+
return trpcRouter({
|
|
7848
|
+
getStatus: protectedProcedure
|
|
7849
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
7850
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
7851
|
+
.query(async ({ input, ctx }) => {
|
|
7852
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7853
|
+
const p = resolveProvider('valve', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7854
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7855
|
+
return p.getStatus(methodInput as any)
|
|
7856
|
+
}),
|
|
7857
|
+
open: adminProcedure
|
|
7858
|
+
.input(valveCapability.methods.open.input.loose())
|
|
7859
|
+
.output(valveCapability.methods.open.output)
|
|
7860
|
+
.mutation(async ({ input, ctx }) => {
|
|
7861
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7862
|
+
const p = resolveProvider('valve', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7863
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7864
|
+
return p.open(methodInput as any)
|
|
7865
|
+
}),
|
|
7866
|
+
close: adminProcedure
|
|
7867
|
+
.input(valveCapability.methods.close.input.loose())
|
|
7868
|
+
.output(valveCapability.methods.close.output)
|
|
7869
|
+
.mutation(async ({ input, ctx }) => {
|
|
7870
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7871
|
+
const p = resolveProvider('valve', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7872
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7873
|
+
return p.close(methodInput as any)
|
|
7874
|
+
}),
|
|
7875
|
+
stop: adminProcedure
|
|
7876
|
+
.input(valveCapability.methods.stop.input.loose())
|
|
7877
|
+
.output(valveCapability.methods.stop.output)
|
|
7878
|
+
.mutation(async ({ input, ctx }) => {
|
|
7879
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7880
|
+
const p = resolveProvider('valve', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7881
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7882
|
+
return p.stop(methodInput as any)
|
|
7883
|
+
}),
|
|
7884
|
+
setPosition: adminProcedure
|
|
7885
|
+
.input(valveCapability.methods.setPosition.input.loose())
|
|
7886
|
+
.output(valveCapability.methods.setPosition.output)
|
|
7887
|
+
.mutation(async ({ input, ctx }) => {
|
|
7888
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7889
|
+
const p = resolveProvider('valve', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7890
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7891
|
+
return p.setPosition(methodInput as any)
|
|
7892
|
+
}),
|
|
7893
|
+
})
|
|
7894
|
+
}
|
|
7895
|
+
|
|
7896
|
+
// ── vibration (singleton) ───────────────────────────────────────────
|
|
7897
|
+
|
|
7898
|
+
type VibrationProvider = InferProvider<typeof vibrationCapability>
|
|
7899
|
+
|
|
7900
|
+
export function createCapRouter_vibration(
|
|
7901
|
+
getProvider: (ctx: TrpcContext) => VibrationProvider | null,
|
|
7902
|
+
createRemoteProxy?: (capName: string, nodeId: string) => VibrationProvider | null,
|
|
7903
|
+
) {
|
|
7904
|
+
return trpcRouter({
|
|
7905
|
+
getStatus: protectedProcedure
|
|
7906
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
7907
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
7908
|
+
.query(async ({ input, ctx }) => {
|
|
7909
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7910
|
+
const p = resolveProvider('vibration', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7911
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7912
|
+
return p.getStatus(methodInput as any)
|
|
7913
|
+
}),
|
|
7914
|
+
})
|
|
7915
|
+
}
|
|
7916
|
+
|
|
7917
|
+
// ── water-heater (singleton) ────────────────────────────────────────
|
|
7918
|
+
|
|
7919
|
+
type WaterHeaterProvider = InferProvider<typeof waterHeaterCapability>
|
|
7920
|
+
|
|
7921
|
+
export function createCapRouter_waterHeater(
|
|
7922
|
+
getProvider: (ctx: TrpcContext) => WaterHeaterProvider | null,
|
|
7923
|
+
createRemoteProxy?: (capName: string, nodeId: string) => WaterHeaterProvider | null,
|
|
7924
|
+
) {
|
|
7925
|
+
return trpcRouter({
|
|
7926
|
+
getStatus: protectedProcedure
|
|
7927
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
7928
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
7929
|
+
.query(async ({ input, ctx }) => {
|
|
7930
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7931
|
+
const p = resolveProvider('water-heater', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7932
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7933
|
+
return p.getStatus(methodInput as any)
|
|
7934
|
+
}),
|
|
7935
|
+
setTargetTemp: adminProcedure
|
|
7936
|
+
.input(waterHeaterCapability.methods.setTargetTemp.input.loose())
|
|
7937
|
+
.output(waterHeaterCapability.methods.setTargetTemp.output)
|
|
7938
|
+
.mutation(async ({ input, ctx }) => {
|
|
7939
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7940
|
+
const p = resolveProvider('water-heater', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7941
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7942
|
+
return p.setTargetTemp(methodInput as any)
|
|
7943
|
+
}),
|
|
7944
|
+
setOperationMode: adminProcedure
|
|
7945
|
+
.input(waterHeaterCapability.methods.setOperationMode.input.loose())
|
|
7946
|
+
.output(waterHeaterCapability.methods.setOperationMode.output)
|
|
7947
|
+
.mutation(async ({ input, ctx }) => {
|
|
7948
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7949
|
+
const p = resolveProvider('water-heater', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7950
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7951
|
+
return p.setOperationMode(methodInput as any)
|
|
7952
|
+
}),
|
|
7953
|
+
setAway: adminProcedure
|
|
7954
|
+
.input(waterHeaterCapability.methods.setAway.input.loose())
|
|
7955
|
+
.output(waterHeaterCapability.methods.setAway.output)
|
|
7956
|
+
.mutation(async ({ input, ctx }) => {
|
|
7957
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7958
|
+
const p = resolveProvider('water-heater', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7959
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7960
|
+
return p.setAway(methodInput as any)
|
|
7961
|
+
}),
|
|
7962
|
+
})
|
|
7963
|
+
}
|
|
7964
|
+
|
|
7965
|
+
// ── weather (singleton) ─────────────────────────────────────────────
|
|
7966
|
+
|
|
7967
|
+
type WeatherProvider = InferProvider<typeof weatherCapability>
|
|
7968
|
+
|
|
7969
|
+
export function createCapRouter_weather(
|
|
7970
|
+
getProvider: (ctx: TrpcContext) => WeatherProvider | null,
|
|
7971
|
+
createRemoteProxy?: (capName: string, nodeId: string) => WeatherProvider | null,
|
|
7972
|
+
) {
|
|
7973
|
+
return trpcRouter({
|
|
7974
|
+
getStatus: protectedProcedure
|
|
7975
|
+
.input(DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
7976
|
+
.output(DEVICE_STATUS_METHOD.getStatus.output)
|
|
7977
|
+
.query(async ({ input, ctx }) => {
|
|
7978
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
7979
|
+
const p = resolveProvider('weather', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
7980
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
7981
|
+
return p.getStatus(methodInput as any)
|
|
7982
|
+
}),
|
|
7983
|
+
})
|
|
7984
|
+
}
|
|
7985
|
+
|
|
6134
7986
|
// ── webrtc (collection) ──────────────────────────────────────────────
|
|
6135
7987
|
|
|
6136
7988
|
type WebrtcProvider = InferProvider<typeof webrtcCapability>
|
|
@@ -6296,6 +8148,15 @@ export function createCapRouter_webrtcSession(
|
|
|
6296
8148
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
6297
8149
|
return p.hasAdaptiveBitrate(methodInput as any)
|
|
6298
8150
|
}),
|
|
8151
|
+
getSessionState: protectedProcedure
|
|
8152
|
+
.input(webrtcSessionCapability.methods.getSessionState.input.loose())
|
|
8153
|
+
.output(webrtcSessionCapability.methods.getSessionState.output)
|
|
8154
|
+
.query(async ({ input, ctx }) => {
|
|
8155
|
+
const { nodeId, ...methodInput } = input as { nodeId?: string } & Record<string, unknown>
|
|
8156
|
+
const p = resolveProvider('webrtc-session', nodeId, () => getProvider(ctx), createRemoteProxy)
|
|
8157
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
8158
|
+
return p.getSessionState(methodInput as any)
|
|
8159
|
+
}),
|
|
6299
8160
|
})
|
|
6300
8161
|
}
|
|
6301
8162
|
|
|
@@ -6439,20 +8300,36 @@ export interface GeneratedCapabilityRouterMap {
|
|
|
6439
8300
|
readonly addons: ReturnType<typeof createCapRouter_addons>
|
|
6440
8301
|
readonly adminUi: ReturnType<typeof createCapRouter_adminUi>
|
|
6441
8302
|
readonly advancedNotifier: ReturnType<typeof createCapRouter_advancedNotifier>
|
|
8303
|
+
readonly airQualitySensor: ReturnType<typeof createCapRouter_airQualitySensor>
|
|
8304
|
+
readonly alarmPanel: ReturnType<typeof createCapRouter_alarmPanel>
|
|
6442
8305
|
readonly alerts: ReturnType<typeof createCapRouter_alerts>
|
|
8306
|
+
readonly ambientLightSensor: ReturnType<typeof createCapRouter_ambientLightSensor>
|
|
6443
8307
|
readonly audioAnalysis: ReturnType<typeof createCapRouter_audioAnalysis>
|
|
6444
8308
|
readonly audioAnalyzer: ReturnType<typeof createCapRouter_audioAnalyzer>
|
|
6445
8309
|
readonly audioCodec: ReturnType<typeof createCapRouter_audioCodec>
|
|
6446
8310
|
readonly audioMetrics: ReturnType<typeof createCapRouter_audioMetrics>
|
|
6447
8311
|
readonly authProvider: ReturnType<typeof createCapRouter_authProvider>
|
|
8312
|
+
readonly automationControl: ReturnType<typeof createCapRouter_automationControl>
|
|
6448
8313
|
readonly backup: ReturnType<typeof createCapRouter_backup>
|
|
6449
8314
|
readonly battery: ReturnType<typeof createCapRouter_battery>
|
|
8315
|
+
readonly binary: ReturnType<typeof createCapRouter_binary>
|
|
6450
8316
|
readonly brightness: ReturnType<typeof createCapRouter_brightness>
|
|
8317
|
+
readonly broker: ReturnType<typeof createCapRouter_broker>
|
|
8318
|
+
readonly button: ReturnType<typeof createCapRouter_button>
|
|
6451
8319
|
readonly cameraCredentials: ReturnType<typeof createCapRouter_cameraCredentials>
|
|
6452
8320
|
readonly cameraPipelineConfig: ReturnType<typeof createCapRouter_cameraPipelineConfig>
|
|
6453
8321
|
readonly cameraStreams: ReturnType<typeof createCapRouter_cameraStreams>
|
|
8322
|
+
readonly carbonMonoxide: ReturnType<typeof createCapRouter_carbonMonoxide>
|
|
8323
|
+
readonly climateControl: ReturnType<typeof createCapRouter_climateControl>
|
|
8324
|
+
readonly color: ReturnType<typeof createCapRouter_color>
|
|
8325
|
+
readonly connectivity: ReturnType<typeof createCapRouter_connectivity>
|
|
8326
|
+
readonly consumables: ReturnType<typeof createCapRouter_consumables>
|
|
8327
|
+
readonly contact: ReturnType<typeof createCapRouter_contact>
|
|
8328
|
+
readonly control: ReturnType<typeof createCapRouter_control>
|
|
8329
|
+
readonly cover: ReturnType<typeof createCapRouter_cover>
|
|
6454
8330
|
readonly decoder: ReturnType<typeof createCapRouter_decoder>
|
|
6455
8331
|
readonly detectionPipeline: ReturnType<typeof createCapRouter_detectionPipeline>
|
|
8332
|
+
readonly deviceAdoption: ReturnType<typeof createCapRouter_deviceAdoption>
|
|
6456
8333
|
readonly deviceDiscovery: ReturnType<typeof createCapRouter_deviceDiscovery>
|
|
6457
8334
|
readonly deviceExport: ReturnType<typeof createCapRouter_deviceExport>
|
|
6458
8335
|
readonly deviceManager: ReturnType<typeof createCapRouter_deviceManager>
|
|
@@ -6462,12 +8339,23 @@ export interface GeneratedCapabilityRouterMap {
|
|
|
6462
8339
|
readonly deviceStatus: ReturnType<typeof createCapRouter_deviceStatus>
|
|
6463
8340
|
readonly doorbell: ReturnType<typeof createCapRouter_doorbell>
|
|
6464
8341
|
readonly embeddingEncoder: ReturnType<typeof createCapRouter_embeddingEncoder>
|
|
8342
|
+
readonly enumSensor: ReturnType<typeof createCapRouter_enumSensor>
|
|
8343
|
+
readonly eventEmitter: ReturnType<typeof createCapRouter_eventEmitter>
|
|
6465
8344
|
readonly events: ReturnType<typeof createCapRouter_events>
|
|
8345
|
+
readonly fanControl: ReturnType<typeof createCapRouter_fanControl>
|
|
6466
8346
|
readonly featureProbe: ReturnType<typeof createCapRouter_featureProbe>
|
|
8347
|
+
readonly flood: ReturnType<typeof createCapRouter_flood>
|
|
8348
|
+
readonly gas: ReturnType<typeof createCapRouter_gas>
|
|
8349
|
+
readonly humidifier: ReturnType<typeof createCapRouter_humidifier>
|
|
8350
|
+
readonly humiditySensor: ReturnType<typeof createCapRouter_humiditySensor>
|
|
8351
|
+
readonly image: ReturnType<typeof createCapRouter_image>
|
|
6467
8352
|
readonly integrations: ReturnType<typeof createCapRouter_integrations>
|
|
6468
8353
|
readonly intercom: ReturnType<typeof createCapRouter_intercom>
|
|
8354
|
+
readonly lawnMowerControl: ReturnType<typeof createCapRouter_lawnMowerControl>
|
|
6469
8355
|
readonly localNetwork: ReturnType<typeof createCapRouter_localNetwork>
|
|
8356
|
+
readonly lockControl: ReturnType<typeof createCapRouter_lockControl>
|
|
6470
8357
|
readonly logDestination: ReturnType<typeof createCapRouter_logDestination>
|
|
8358
|
+
readonly mediaPlayer: ReturnType<typeof createCapRouter_mediaPlayer>
|
|
6471
8359
|
readonly meshNetwork: ReturnType<typeof createCapRouter_meshNetwork>
|
|
6472
8360
|
readonly metricsProvider: ReturnType<typeof createCapRouter_metricsProvider>
|
|
6473
8361
|
readonly motion: ReturnType<typeof createCapRouter_motion>
|
|
@@ -6480,6 +8368,8 @@ export interface GeneratedCapabilityRouterMap {
|
|
|
6480
8368
|
readonly networkQuality: ReturnType<typeof createCapRouter_networkQuality>
|
|
6481
8369
|
readonly nodes: ReturnType<typeof createCapRouter_nodes>
|
|
6482
8370
|
readonly notificationOutput: ReturnType<typeof createCapRouter_notificationOutput>
|
|
8371
|
+
readonly notifier: ReturnType<typeof createCapRouter_notifier>
|
|
8372
|
+
readonly numericSensor: ReturnType<typeof createCapRouter_numericSensor>
|
|
6483
8373
|
readonly oauthIntegration: ReturnType<typeof createCapRouter_oauthIntegration>
|
|
6484
8374
|
readonly osd: ReturnType<typeof createCapRouter_osd>
|
|
6485
8375
|
readonly pipelineAnalytics: ReturnType<typeof createCapRouter_pipelineAnalytics>
|
|
@@ -6487,19 +8377,24 @@ export interface GeneratedCapabilityRouterMap {
|
|
|
6487
8377
|
readonly pipelineOrchestrator: ReturnType<typeof createCapRouter_pipelineOrchestrator>
|
|
6488
8378
|
readonly pipelineRunner: ReturnType<typeof createCapRouter_pipelineRunner>
|
|
6489
8379
|
readonly platformProbe: ReturnType<typeof createCapRouter_platformProbe>
|
|
8380
|
+
readonly powerMeter: ReturnType<typeof createCapRouter_powerMeter>
|
|
8381
|
+
readonly presence: ReturnType<typeof createCapRouter_presence>
|
|
8382
|
+
readonly pressureSensor: ReturnType<typeof createCapRouter_pressureSensor>
|
|
6490
8383
|
readonly privacyMask: ReturnType<typeof createCapRouter_privacyMask>
|
|
6491
8384
|
readonly ptz: ReturnType<typeof createCapRouter_ptz>
|
|
6492
8385
|
readonly ptzAutotrack: ReturnType<typeof createCapRouter_ptzAutotrack>
|
|
6493
8386
|
readonly reboot: ReturnType<typeof createCapRouter_reboot>
|
|
6494
8387
|
readonly recording: ReturnType<typeof createCapRouter_recording>
|
|
6495
|
-
readonly recordingEngine: ReturnType<typeof createCapRouter_recordingEngine>
|
|
6496
8388
|
readonly restreamer: ReturnType<typeof createCapRouter_restreamer>
|
|
8389
|
+
readonly scriptRunner: ReturnType<typeof createCapRouter_scriptRunner>
|
|
6497
8390
|
readonly settingsStore: ReturnType<typeof createCapRouter_settingsStore>
|
|
8391
|
+
readonly smoke: ReturnType<typeof createCapRouter_smoke>
|
|
6498
8392
|
readonly smtpProvider: ReturnType<typeof createCapRouter_smtpProvider>
|
|
6499
8393
|
readonly snapshot: ReturnType<typeof createCapRouter_snapshot>
|
|
6500
8394
|
readonly snapshotProvider: ReturnType<typeof createCapRouter_snapshotProvider>
|
|
6501
8395
|
readonly ssoBridge: ReturnType<typeof createCapRouter_ssoBridge>
|
|
6502
8396
|
readonly storage: ReturnType<typeof createCapRouter_storage>
|
|
8397
|
+
readonly storageEvictable: ReturnType<typeof createCapRouter_storageEvictable>
|
|
6503
8398
|
readonly storageProvider: ReturnType<typeof createCapRouter_storageProvider>
|
|
6504
8399
|
readonly streamBroker: ReturnType<typeof createCapRouter_streamBroker>
|
|
6505
8400
|
readonly streamCatalog: ReturnType<typeof createCapRouter_streamCatalog>
|
|
@@ -6507,10 +8402,18 @@ export interface GeneratedCapabilityRouterMap {
|
|
|
6507
8402
|
readonly streamingEngine: ReturnType<typeof createCapRouter_streamingEngine>
|
|
6508
8403
|
readonly switch: ReturnType<typeof createCapRouter_switch>
|
|
6509
8404
|
readonly system: ReturnType<typeof createCapRouter_system>
|
|
8405
|
+
readonly tamper: ReturnType<typeof createCapRouter_tamper>
|
|
8406
|
+
readonly temperatureSensor: ReturnType<typeof createCapRouter_temperatureSensor>
|
|
6510
8407
|
readonly toast: ReturnType<typeof createCapRouter_toast>
|
|
6511
8408
|
readonly turnProvider: ReturnType<typeof createCapRouter_turnProvider>
|
|
8409
|
+
readonly update: ReturnType<typeof createCapRouter_update>
|
|
6512
8410
|
readonly userManagement: ReturnType<typeof createCapRouter_userManagement>
|
|
6513
8411
|
readonly userPasskeys: ReturnType<typeof createCapRouter_userPasskeys>
|
|
8412
|
+
readonly vacuumControl: ReturnType<typeof createCapRouter_vacuumControl>
|
|
8413
|
+
readonly valve: ReturnType<typeof createCapRouter_valve>
|
|
8414
|
+
readonly vibration: ReturnType<typeof createCapRouter_vibration>
|
|
8415
|
+
readonly waterHeater: ReturnType<typeof createCapRouter_waterHeater>
|
|
8416
|
+
readonly weather: ReturnType<typeof createCapRouter_weather>
|
|
6514
8417
|
readonly webrtc: ReturnType<typeof createCapRouter_webrtc>
|
|
6515
8418
|
readonly webrtcSession: ReturnType<typeof createCapRouter_webrtcSession>
|
|
6516
8419
|
readonly zoneAnalytics: ReturnType<typeof createCapRouter_zoneAnalytics>
|