@camstack/server 1.2.181 → 1.2.182
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.
|
@@ -429,6 +429,14 @@ function createCapRouter_addonSettings(getProvider, _createRemoteProxy) {
|
|
|
429
429
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
430
430
|
return p.updateGlobalSettings(input);
|
|
431
431
|
}),
|
|
432
|
+
getIntegrationSettings: trpc_middleware_js_1.protectedProcedure
|
|
433
|
+
.input(types_7.addonSettingsCapability.methods.getIntegrationSettings.input.loose())
|
|
434
|
+
.output(types_7.addonSettingsCapability.methods.getIntegrationSettings.output)
|
|
435
|
+
.query(async ({ input, ctx }) => {
|
|
436
|
+
const p = requireCapProvider('addon-settings', () => getProvider(ctx));
|
|
437
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
438
|
+
return p.getIntegrationSettings(input);
|
|
439
|
+
}),
|
|
432
440
|
getDeviceSettings: trpc_middleware_js_1.protectedProcedure
|
|
433
441
|
.input(types_7.addonSettingsCapability.methods.getDeviceSettings.input.loose())
|
|
434
442
|
.output(types_7.addonSettingsCapability.methods.getDeviceSettings.output)
|
|
@@ -81,6 +81,16 @@ function createAddonSettingsProvider(deps) {
|
|
|
81
81
|
}
|
|
82
82
|
return forkedUpdate(input.addonId, 'updateGlobalSettings', { patch: input.patch, ...(input.nodeId ? { nodeId: input.nodeId } : {}) }, input.nodeId);
|
|
83
83
|
},
|
|
84
|
+
async getIntegrationSettings(input) {
|
|
85
|
+
if (gateway.isInProcess(input.addonId, input.nodeId)) {
|
|
86
|
+
const addon = getAddon(input.addonId);
|
|
87
|
+
if (!addon || typeof addon.getIntegrationSettings !== 'function')
|
|
88
|
+
return null;
|
|
89
|
+
const result = await addon.getIntegrationSettings(input.nodeId);
|
|
90
|
+
return result ? reshapeForOutput(result) : null;
|
|
91
|
+
}
|
|
92
|
+
return forkedGet(input.addonId, 'getIntegrationSettings', { ...(input.nodeId ? { nodeId: input.nodeId } : {}) }, input.nodeId);
|
|
93
|
+
},
|
|
84
94
|
async getDeviceSettings(input) {
|
|
85
95
|
if (gateway.isInProcess(input.addonId, input.nodeId)) {
|
|
86
96
|
const addon = getAddon(input.addonId);
|