@camstack/addon-provider-reolink 1.2.246 → 1.2.247
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/CHANGELOG.md +6 -0
- package/dist/addon.js +51 -4
- package/dist/addon.mjs +51 -4
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.247] - 2026-11-19
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- The Reolink addon no longer floods the hub with integration lookups that slowed the whole system and restarted the addon every few minutes
|
|
15
|
+
|
|
10
16
|
## [1.2.246] - 2026-11-19
|
|
11
17
|
|
|
12
18
|
### Changed
|
package/dist/addon.js
CHANGED
|
@@ -242837,6 +242837,27 @@ var reolinkConnectionsEntryKind = defineEntryKind("connections", {
|
|
|
242837
242837
|
/** Every kind this addon declares, keyed by its name. */
|
|
242838
242838
|
var reolinkRecordKinds = { connections: reolinkConnectionsEntryKind };
|
|
242839
242839
|
/**
|
|
242840
|
+
* What the addon last learned of each integration's registry row. The request path
|
|
242841
|
+
* (`listInstances` / `getInstance`) reads ONLY this — the hub's own `integrations.get` projects
|
|
242842
|
+
* the switches by calling this provider's `listInstances` again, so asking the hub from there is
|
|
242843
|
+
* an unbounded call cycle. It is filled off the request path (the integration reconcile, the
|
|
242844
|
+
* form schema read); a failed read leaves it as it was.
|
|
242845
|
+
*/
|
|
242846
|
+
var ReolinkEvidenceCache = class {
|
|
242847
|
+
rows = /* @__PURE__ */ new Map();
|
|
242848
|
+
get(id) {
|
|
242849
|
+
return this.rows.get(id) ?? null;
|
|
242850
|
+
}
|
|
242851
|
+
set(id, evidence) {
|
|
242852
|
+
this.rows.set(id, evidence);
|
|
242853
|
+
}
|
|
242854
|
+
/** The registry's full answer for this addon: integrations it no longer lists are dropped. */
|
|
242855
|
+
replaceAll(entries) {
|
|
242856
|
+
this.rows.clear();
|
|
242857
|
+
for (const [id, evidence] of entries) this.rows.set(id, evidence);
|
|
242858
|
+
}
|
|
242859
|
+
};
|
|
242860
|
+
/**
|
|
242840
242861
|
* The connection test: the stored hub under the edited form. A saved password is never retyped
|
|
242841
242862
|
* (the form hands back its redacted view), so the keychain value stands in.
|
|
242842
242863
|
*/
|
|
@@ -242940,7 +242961,7 @@ function reolinkInstancesProvider(instances, deps) {
|
|
|
242940
242961
|
const base = instances.toProvider();
|
|
242941
242962
|
const withAddDevice = async (instance) => ({
|
|
242942
242963
|
...instance,
|
|
242943
|
-
addDevice: await
|
|
242964
|
+
addDevice: await integrationIsHubCached(instances, deps.evidenceCache, instance.id) ? "children" : "scan"
|
|
242944
242965
|
});
|
|
242945
242966
|
return {
|
|
242946
242967
|
...base,
|
|
@@ -242952,6 +242973,7 @@ function reolinkInstancesProvider(instances, deps) {
|
|
|
242952
242973
|
instanceFormSchema: async ({ id }) => {
|
|
242953
242974
|
if (id === null) return buildHubInstanceSchema();
|
|
242954
242975
|
const [evidence, body] = await Promise.all([deps.registryEvidenceOf(id), instances.getResolved(id)]);
|
|
242976
|
+
if (evidence !== null) deps.evidenceCache.set(id, evidence);
|
|
242955
242977
|
return evidence !== null && isHubIntegration({
|
|
242956
242978
|
originStableId: evidence.originStableId,
|
|
242957
242979
|
info: evidence.info,
|
|
@@ -242973,6 +242995,20 @@ async function integrationIsHub(instances, deps, id) {
|
|
|
242973
242995
|
settings: body === null ? {} : hubSettingsOf(body)
|
|
242974
242996
|
});
|
|
242975
242997
|
}
|
|
242998
|
+
/**
|
|
242999
|
+
* `integrationIsHub` from the cache alone, for the request path: no evidence yet reads as "not a
|
|
243000
|
+
* hub" (the same answer as a registry that cannot name the integration) and never asks the hub.
|
|
243001
|
+
*/
|
|
243002
|
+
async function integrationIsHubCached(instances, cache, id) {
|
|
243003
|
+
const evidence = cache.get(id);
|
|
243004
|
+
if (evidence === null) return false;
|
|
243005
|
+
const body = await instances.getResolved(id);
|
|
243006
|
+
return isHubIntegration({
|
|
243007
|
+
originStableId: evidence.originStableId,
|
|
243008
|
+
info: evidence.info,
|
|
243009
|
+
settings: body === null ? {} : hubSettingsOf(body)
|
|
243010
|
+
});
|
|
243011
|
+
}
|
|
242976
243012
|
//#endregion
|
|
242977
243013
|
//#region src/mailbox-link-store.ts
|
|
242978
243014
|
var INTEGRATIONS_MAX = 1e3;
|
|
@@ -244026,6 +244062,7 @@ var ReolinkProviderAddon = class extends BaseDeviceProvider {
|
|
|
244026
244062
|
autodetectCache = new AutodetectCache();
|
|
244027
244063
|
hubManager = null;
|
|
244028
244064
|
instances = null;
|
|
244065
|
+
evidenceCache = new ReolinkEvidenceCache();
|
|
244029
244066
|
hubIntegrationProbe = null;
|
|
244030
244067
|
/**
|
|
244031
244068
|
* The camera mailbox bridge (`email-push-bridge.ts`, D999): battery cameras mail motion to a
|
|
@@ -244287,7 +244324,12 @@ var ReolinkProviderAddon = class extends BaseDeviceProvider {
|
|
|
244287
244324
|
const instances = this.instances;
|
|
244288
244325
|
if (manager === null || instances === null) return;
|
|
244289
244326
|
try {
|
|
244290
|
-
const
|
|
244327
|
+
const all = await this.ctx.api.integrations.list.query();
|
|
244328
|
+
this.evidenceCache.replaceAll(all.filter((i) => i.addonId === this.ctx.id).map((i) => [i.id, {
|
|
244329
|
+
originStableId: i.originStableId,
|
|
244330
|
+
info: { ...i.info }
|
|
244331
|
+
}]));
|
|
244332
|
+
const withConnection = await readHubConnections(instances, all.filter((i) => i.addonId === this.ctx.id && i.enabled));
|
|
244291
244333
|
await manager.reconcile(withConnection);
|
|
244292
244334
|
} catch (err) {
|
|
244293
244335
|
this.ctx.logger.warn("Reolink integration reconcile failed — sessions left as they were", { meta: { error: errMsg$3(err) } });
|
|
@@ -244474,10 +244516,12 @@ var ReolinkProviderAddon = class extends BaseDeviceProvider {
|
|
|
244474
244516
|
const registryEvidenceOf = async (id) => {
|
|
244475
244517
|
try {
|
|
244476
244518
|
const integration = await this.ctx.api.integrations.get.query({ id });
|
|
244477
|
-
|
|
244519
|
+
const evidence = {
|
|
244478
244520
|
originStableId: integration.originStableId,
|
|
244479
244521
|
info: { ...integration.info }
|
|
244480
244522
|
};
|
|
244523
|
+
this.evidenceCache.set(id, evidence);
|
|
244524
|
+
return evidence;
|
|
244481
244525
|
} catch (err) {
|
|
244482
244526
|
this.ctx.logger.warn("Reolink integration form: instance lookup failed — hub form shown", { meta: {
|
|
244483
244527
|
integrationId: id,
|
|
@@ -244538,7 +244582,10 @@ var ReolinkProviderAddon = class extends BaseDeviceProvider {
|
|
|
244538
244582
|
});
|
|
244539
244583
|
regs.push({
|
|
244540
244584
|
capability: integrationInstancesCapability,
|
|
244541
|
-
provider: reolinkInstancesProvider(instances, {
|
|
244585
|
+
provider: reolinkInstancesProvider(instances, {
|
|
244586
|
+
registryEvidenceOf,
|
|
244587
|
+
evidenceCache: this.evidenceCache
|
|
244588
|
+
})
|
|
244542
244589
|
});
|
|
244543
244590
|
return { providers: regs };
|
|
244544
244591
|
}
|
package/dist/addon.mjs
CHANGED
|
@@ -242829,6 +242829,27 @@ var reolinkConnectionsEntryKind = defineEntryKind("connections", {
|
|
|
242829
242829
|
/** Every kind this addon declares, keyed by its name. */
|
|
242830
242830
|
var reolinkRecordKinds = { connections: reolinkConnectionsEntryKind };
|
|
242831
242831
|
/**
|
|
242832
|
+
* What the addon last learned of each integration's registry row. The request path
|
|
242833
|
+
* (`listInstances` / `getInstance`) reads ONLY this — the hub's own `integrations.get` projects
|
|
242834
|
+
* the switches by calling this provider's `listInstances` again, so asking the hub from there is
|
|
242835
|
+
* an unbounded call cycle. It is filled off the request path (the integration reconcile, the
|
|
242836
|
+
* form schema read); a failed read leaves it as it was.
|
|
242837
|
+
*/
|
|
242838
|
+
var ReolinkEvidenceCache = class {
|
|
242839
|
+
rows = /* @__PURE__ */ new Map();
|
|
242840
|
+
get(id) {
|
|
242841
|
+
return this.rows.get(id) ?? null;
|
|
242842
|
+
}
|
|
242843
|
+
set(id, evidence) {
|
|
242844
|
+
this.rows.set(id, evidence);
|
|
242845
|
+
}
|
|
242846
|
+
/** The registry's full answer for this addon: integrations it no longer lists are dropped. */
|
|
242847
|
+
replaceAll(entries) {
|
|
242848
|
+
this.rows.clear();
|
|
242849
|
+
for (const [id, evidence] of entries) this.rows.set(id, evidence);
|
|
242850
|
+
}
|
|
242851
|
+
};
|
|
242852
|
+
/**
|
|
242832
242853
|
* The connection test: the stored hub under the edited form. A saved password is never retyped
|
|
242833
242854
|
* (the form hands back its redacted view), so the keychain value stands in.
|
|
242834
242855
|
*/
|
|
@@ -242932,7 +242953,7 @@ function reolinkInstancesProvider(instances, deps) {
|
|
|
242932
242953
|
const base = instances.toProvider();
|
|
242933
242954
|
const withAddDevice = async (instance) => ({
|
|
242934
242955
|
...instance,
|
|
242935
|
-
addDevice: await
|
|
242956
|
+
addDevice: await integrationIsHubCached(instances, deps.evidenceCache, instance.id) ? "children" : "scan"
|
|
242936
242957
|
});
|
|
242937
242958
|
return {
|
|
242938
242959
|
...base,
|
|
@@ -242944,6 +242965,7 @@ function reolinkInstancesProvider(instances, deps) {
|
|
|
242944
242965
|
instanceFormSchema: async ({ id }) => {
|
|
242945
242966
|
if (id === null) return buildHubInstanceSchema();
|
|
242946
242967
|
const [evidence, body] = await Promise.all([deps.registryEvidenceOf(id), instances.getResolved(id)]);
|
|
242968
|
+
if (evidence !== null) deps.evidenceCache.set(id, evidence);
|
|
242947
242969
|
return evidence !== null && isHubIntegration({
|
|
242948
242970
|
originStableId: evidence.originStableId,
|
|
242949
242971
|
info: evidence.info,
|
|
@@ -242965,6 +242987,20 @@ async function integrationIsHub(instances, deps, id) {
|
|
|
242965
242987
|
settings: body === null ? {} : hubSettingsOf(body)
|
|
242966
242988
|
});
|
|
242967
242989
|
}
|
|
242990
|
+
/**
|
|
242991
|
+
* `integrationIsHub` from the cache alone, for the request path: no evidence yet reads as "not a
|
|
242992
|
+
* hub" (the same answer as a registry that cannot name the integration) and never asks the hub.
|
|
242993
|
+
*/
|
|
242994
|
+
async function integrationIsHubCached(instances, cache, id) {
|
|
242995
|
+
const evidence = cache.get(id);
|
|
242996
|
+
if (evidence === null) return false;
|
|
242997
|
+
const body = await instances.getResolved(id);
|
|
242998
|
+
return isHubIntegration({
|
|
242999
|
+
originStableId: evidence.originStableId,
|
|
243000
|
+
info: evidence.info,
|
|
243001
|
+
settings: body === null ? {} : hubSettingsOf(body)
|
|
243002
|
+
});
|
|
243003
|
+
}
|
|
242968
243004
|
//#endregion
|
|
242969
243005
|
//#region src/mailbox-link-store.ts
|
|
242970
243006
|
var INTEGRATIONS_MAX = 1e3;
|
|
@@ -244018,6 +244054,7 @@ var ReolinkProviderAddon = class extends BaseDeviceProvider {
|
|
|
244018
244054
|
autodetectCache = new AutodetectCache();
|
|
244019
244055
|
hubManager = null;
|
|
244020
244056
|
instances = null;
|
|
244057
|
+
evidenceCache = new ReolinkEvidenceCache();
|
|
244021
244058
|
hubIntegrationProbe = null;
|
|
244022
244059
|
/**
|
|
244023
244060
|
* The camera mailbox bridge (`email-push-bridge.ts`, D999): battery cameras mail motion to a
|
|
@@ -244279,7 +244316,12 @@ var ReolinkProviderAddon = class extends BaseDeviceProvider {
|
|
|
244279
244316
|
const instances = this.instances;
|
|
244280
244317
|
if (manager === null || instances === null) return;
|
|
244281
244318
|
try {
|
|
244282
|
-
const
|
|
244319
|
+
const all = await this.ctx.api.integrations.list.query();
|
|
244320
|
+
this.evidenceCache.replaceAll(all.filter((i) => i.addonId === this.ctx.id).map((i) => [i.id, {
|
|
244321
|
+
originStableId: i.originStableId,
|
|
244322
|
+
info: { ...i.info }
|
|
244323
|
+
}]));
|
|
244324
|
+
const withConnection = await readHubConnections(instances, all.filter((i) => i.addonId === this.ctx.id && i.enabled));
|
|
244283
244325
|
await manager.reconcile(withConnection);
|
|
244284
244326
|
} catch (err) {
|
|
244285
244327
|
this.ctx.logger.warn("Reolink integration reconcile failed — sessions left as they were", { meta: { error: errMsg$3(err) } });
|
|
@@ -244466,10 +244508,12 @@ var ReolinkProviderAddon = class extends BaseDeviceProvider {
|
|
|
244466
244508
|
const registryEvidenceOf = async (id) => {
|
|
244467
244509
|
try {
|
|
244468
244510
|
const integration = await this.ctx.api.integrations.get.query({ id });
|
|
244469
|
-
|
|
244511
|
+
const evidence = {
|
|
244470
244512
|
originStableId: integration.originStableId,
|
|
244471
244513
|
info: { ...integration.info }
|
|
244472
244514
|
};
|
|
244515
|
+
this.evidenceCache.set(id, evidence);
|
|
244516
|
+
return evidence;
|
|
244473
244517
|
} catch (err) {
|
|
244474
244518
|
this.ctx.logger.warn("Reolink integration form: instance lookup failed — hub form shown", { meta: {
|
|
244475
244519
|
integrationId: id,
|
|
@@ -244530,7 +244574,10 @@ var ReolinkProviderAddon = class extends BaseDeviceProvider {
|
|
|
244530
244574
|
});
|
|
244531
244575
|
regs.push({
|
|
244532
244576
|
capability: integrationInstancesCapability,
|
|
244533
|
-
provider: reolinkInstancesProvider(instances, {
|
|
244577
|
+
provider: reolinkInstancesProvider(instances, {
|
|
244578
|
+
registryEvidenceOf,
|
|
244579
|
+
evidenceCache: this.evidenceCache
|
|
244580
|
+
})
|
|
244534
244581
|
});
|
|
244535
244582
|
return { providers: regs };
|
|
244536
244583
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-reolink",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.247",
|
|
4
4
|
"description": "Reolink camera device provider addon for CamStack — native Baichuan protocol",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"werift"
|
|
97
97
|
],
|
|
98
98
|
"requires": {
|
|
99
|
-
"server": ">=1.2.
|
|
99
|
+
"server": ">=1.2.909"
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
102
|
"files": [
|