@camstack/server 1.1.12 → 1.1.14
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.
|
@@ -787,6 +787,19 @@ function buildIntegrationsProvider(ar, eb, loggingService, capabilityRegistry) {
|
|
|
787
787
|
const supportsLocationImport = kind === 'device-adoption'
|
|
788
788
|
? (d?.supportsLocationImport ?? m.supportsLocationImport ?? false)
|
|
789
789
|
: false;
|
|
790
|
+
// Integration wizard `mode` (LOCKED MODEL — supersedes `instanceMode`
|
|
791
|
+
// for wizard routing). Explicit manifest `mode` wins; otherwise derive:
|
|
792
|
+
// 1. broker cap AND a brokerKind → 'broker' (HA/MQTT shared session)
|
|
793
|
+
// 2. device-adoption (and NOT broker) → 'account'
|
|
794
|
+
// 3. device-provider only / old `instanceMode: unique` → 'standalone'
|
|
795
|
+
const explicitMode = d?.mode ?? m.mode;
|
|
796
|
+
const declaresBroker = capNames.includes('broker');
|
|
797
|
+
const mode = explicitMode ??
|
|
798
|
+
(declaresBroker && brokerKind
|
|
799
|
+
? 'broker'
|
|
800
|
+
: kind === 'device-adoption'
|
|
801
|
+
? 'account'
|
|
802
|
+
: 'standalone');
|
|
790
803
|
return {
|
|
791
804
|
addonId: m.id,
|
|
792
805
|
name: m.name ?? m.id,
|
|
@@ -794,6 +807,7 @@ function buildIntegrationsProvider(ar, eb, loggingService, capabilityRegistry) {
|
|
|
794
807
|
iconUrl: icon ? `/api/addon-assets/${m.id}/${icon}` : null,
|
|
795
808
|
color,
|
|
796
809
|
instanceMode,
|
|
810
|
+
mode,
|
|
797
811
|
discoveryMode,
|
|
798
812
|
kind,
|
|
799
813
|
brokerKind,
|
|
@@ -2686,6 +2686,15 @@ function createCapRouter_deviceManager(getProvider, createRemoteProxy) {
|
|
|
2686
2686
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2687
2687
|
return p.testCreationField(methodInput);
|
|
2688
2688
|
}),
|
|
2689
|
+
adoptionListCandidateFilters: trpc_middleware_js_1.adminProcedure
|
|
2690
|
+
.input(types_38.deviceManagerCapability.methods.adoptionListCandidateFilters.input.loose())
|
|
2691
|
+
.output(types_38.deviceManagerCapability.methods.adoptionListCandidateFilters.output)
|
|
2692
|
+
.query(async ({ input, ctx }) => {
|
|
2693
|
+
const { nodeId, ...methodInput } = input;
|
|
2694
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
2695
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2696
|
+
return p.adoptionListCandidateFilters(methodInput);
|
|
2697
|
+
}),
|
|
2689
2698
|
adoptionListCandidates: trpc_middleware_js_1.adminProcedure
|
|
2690
2699
|
.input(types_38.deviceManagerCapability.methods.adoptionListCandidates.input.loose())
|
|
2691
2700
|
.output(types_38.deviceManagerCapability.methods.adoptionListCandidates.output)
|
|
@@ -2731,6 +2740,51 @@ function createCapRouter_deviceManager(getProvider, createRemoteProxy) {
|
|
|
2731
2740
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2732
2741
|
return p.adoptionResync(methodInput);
|
|
2733
2742
|
}),
|
|
2743
|
+
discoveryProviders: trpc_middleware_js_1.adminProcedure
|
|
2744
|
+
.input(types_38.deviceManagerCapability.methods.discoveryProviders.input.loose())
|
|
2745
|
+
.output(types_38.deviceManagerCapability.methods.discoveryProviders.output)
|
|
2746
|
+
.query(async ({ input, ctx }) => {
|
|
2747
|
+
const { nodeId, ...methodInput } = input;
|
|
2748
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
2749
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2750
|
+
return p.discoveryProviders(methodInput);
|
|
2751
|
+
}),
|
|
2752
|
+
discoverAllProviders: trpc_middleware_js_1.adminProcedure
|
|
2753
|
+
.input(types_38.deviceManagerCapability.methods.discoverAllProviders.input.loose())
|
|
2754
|
+
.output(types_38.deviceManagerCapability.methods.discoverAllProviders.output)
|
|
2755
|
+
.mutation(async ({ input, ctx }) => {
|
|
2756
|
+
const { nodeId, ...methodInput } = input;
|
|
2757
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
2758
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2759
|
+
return p.discoverAllProviders(methodInput);
|
|
2760
|
+
}),
|
|
2761
|
+
discoverProvider: trpc_middleware_js_1.adminProcedure
|
|
2762
|
+
.input(types_38.deviceManagerCapability.methods.discoverProvider.input.loose())
|
|
2763
|
+
.output(types_38.deviceManagerCapability.methods.discoverProvider.output)
|
|
2764
|
+
.mutation(async ({ input, ctx }) => {
|
|
2765
|
+
const { nodeId, ...methodInput } = input;
|
|
2766
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
2767
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2768
|
+
return p.discoverProvider(methodInput);
|
|
2769
|
+
}),
|
|
2770
|
+
providerCreationType: trpc_middleware_js_1.adminProcedure
|
|
2771
|
+
.input(types_38.deviceManagerCapability.methods.providerCreationType.input.loose())
|
|
2772
|
+
.output(types_38.deviceManagerCapability.methods.providerCreationType.output)
|
|
2773
|
+
.query(async ({ input, ctx }) => {
|
|
2774
|
+
const { nodeId, ...methodInput } = input;
|
|
2775
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
2776
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2777
|
+
return p.providerCreationType(methodInput);
|
|
2778
|
+
}),
|
|
2779
|
+
providerDiscoveryParamsSchema: trpc_middleware_js_1.adminProcedure
|
|
2780
|
+
.input(types_38.deviceManagerCapability.methods.providerDiscoveryParamsSchema.input.loose())
|
|
2781
|
+
.output(types_38.deviceManagerCapability.methods.providerDiscoveryParamsSchema.output)
|
|
2782
|
+
.query(async ({ input, ctx }) => {
|
|
2783
|
+
const { nodeId, ...methodInput } = input;
|
|
2784
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
2785
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2786
|
+
return p.providerDiscoveryParamsSchema(methodInput);
|
|
2787
|
+
}),
|
|
2734
2788
|
testField: trpc_middleware_js_1.adminProcedure
|
|
2735
2789
|
.input(types_38.deviceManagerCapability.methods.testField.input.loose())
|
|
2736
2790
|
.output(types_38.deviceManagerCapability.methods.testField.output)
|
|
@@ -2866,6 +2920,24 @@ function createCapRouter_deviceProvider(getProvider, createRemoteProxy) {
|
|
|
2866
2920
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2867
2921
|
return p.discoverDevices(methodInput);
|
|
2868
2922
|
}),
|
|
2923
|
+
getDiscoveryParamsSchema: trpc_middleware_js_1.protectedProcedure
|
|
2924
|
+
.input(types_40.deviceProviderCapability.methods.getDiscoveryParamsSchema.input.loose())
|
|
2925
|
+
.output(types_40.deviceProviderCapability.methods.getDiscoveryParamsSchema.output)
|
|
2926
|
+
.query(async ({ input, ctx }) => {
|
|
2927
|
+
const { nodeId, addonId, ...methodInput } = input;
|
|
2928
|
+
const p = resolveProvider('device-provider', nodeId, () => getProvider(ctx, addonId), createRemoteProxy);
|
|
2929
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2930
|
+
return p.getDiscoveryParamsSchema(methodInput);
|
|
2931
|
+
}),
|
|
2932
|
+
getManualCreationType: trpc_middleware_js_1.protectedProcedure
|
|
2933
|
+
.input(types_40.deviceProviderCapability.methods.getManualCreationType.input.loose())
|
|
2934
|
+
.output(types_40.deviceProviderCapability.methods.getManualCreationType.output)
|
|
2935
|
+
.query(async ({ input, ctx }) => {
|
|
2936
|
+
const { nodeId, addonId, ...methodInput } = input;
|
|
2937
|
+
const p = resolveProvider('device-provider', nodeId, () => getProvider(ctx, addonId), createRemoteProxy);
|
|
2938
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
2939
|
+
return p.getManualCreationType(methodInput);
|
|
2940
|
+
}),
|
|
2869
2941
|
adoptDiscoveredDevice: trpc_middleware_js_1.adminProcedure
|
|
2870
2942
|
.input(types_40.deviceProviderCapability.methods.adoptDiscoveredDevice.input.loose())
|
|
2871
2943
|
.output(types_40.deviceProviderCapability.methods.adoptDiscoveredDevice.output)
|