@camstack/server 1.2.111 → 1.2.112

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.
@@ -82,8 +82,8 @@ const site_location_js_1 = require("./site-location.js");
82
82
  function getRetention(registry) {
83
83
  return (registry?.getSingleton('analysis-data-persistence')?.retention ?? null);
84
84
  }
85
- function buildSystemProvider(feature, registry, moleculer, logger) {
86
- const siteLocation = buildSiteLocationService(moleculer, logger);
85
+ function buildSystemProvider(feature, registry, logger) {
86
+ const siteLocation = buildSiteLocationService(registry, logger);
87
87
  return {
88
88
  info: async () => feature.getManifest(),
89
89
  health: async () => ({ status: 'ok', uptime: process.uptime() }),
@@ -117,24 +117,28 @@ function buildSystemProvider(feature, registry, moleculer, logger) {
117
117
  };
118
118
  }
119
119
  /**
120
- * Site location, backed by the `system-settings` collection through the broker.
120
+ * Site location, backed by the `system-settings` collection through the
121
+ * hub-resident `settings-store` CAP, resolved lazily from the registry —
122
+ * the cap boots after this provider is constructed, and there is NO
123
+ * `settings-store.*` Moleculer action to call (that path returned
124
+ * "Service 'settings-store.get' is not found" in production while the
125
+ * tests' fake gateway hid it).
121
126
  *
122
- * Without a broker (unit tests that build the provider bare) the store fails
123
- * closed: reads throw, so the derivation cannot fire and cannot invent a
124
- * location out of a missing dependency.
127
+ * Without a registry (unit tests that build the provider bare) the store
128
+ * fails closed: reads throw, so the derivation cannot fire and cannot
129
+ * invent a location out of a missing dependency.
125
130
  */
126
- function buildSiteLocationService(moleculer, logger) {
127
- const broker = moleculer?.broker;
131
+ function buildSiteLocationService(registry, logger) {
132
+ const resolve = () => {
133
+ const provider = registry?.getSingleton('settings-store') ?? null;
134
+ if (provider === null)
135
+ throw new Error('settings-store unavailable: cap not registered yet');
136
+ return provider;
137
+ };
128
138
  const store = {
129
- get: async (input) => {
130
- if (broker === undefined)
131
- throw new Error('settings-store unavailable: no broker');
132
- return broker.call('settings-store.get', input);
133
- },
139
+ get: async (input) => resolve().get(input),
134
140
  set: async (input) => {
135
- if (broker === undefined)
136
- throw new Error('settings-store unavailable: no broker');
137
- await broker.call('settings-store.set', input);
141
+ await resolve().set(input);
138
142
  },
139
143
  };
140
144
  return new site_location_js_1.SiteLocationService({
@@ -191,7 +191,7 @@ function buildServerProviders(services) {
191
191
  const wrap = (fn) => (ctx) => fn(ctx);
192
192
  return {
193
193
  'network-quality': wrap(() => (0, cap_providers_js_1.buildNetworkQualityProvider)(services.networkQualityService)),
194
- system: wrap(() => (0, cap_providers_js_1.buildSystemProvider)(services.featureService, services.capabilityRegistry, services.moleculer, services.loggingService.createLogger('site-location'))),
194
+ system: wrap(() => (0, cap_providers_js_1.buildSystemProvider)(services.featureService, services.capabilityRegistry, services.loggingService.createLogger('site-location'))),
195
195
  toast: wrap((ctx) => (0, cap_providers_js_1.buildToastProvider)(services.toastService, ctx)),
196
196
  integrations: wrap(() => (0, cap_providers_js_1.buildIntegrationsProvider)(services.addonRegistry, services.eventBus, services.loggingService, services.capabilityRegistry)),
197
197
  nodes: wrap(() => (0, cap_providers_js_1.buildNodesProvider)(services.agentRegistry, services.moleculer, services.addonRegistry, (0, cap_providers_js_1.createNodeRootPackageLookup)(services.moleculer, services.serverUpdateService), services.loggingService.createLogger('nodes'))),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.2.111",
3
+ "version": "1.2.112",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -33,18 +33,18 @@
33
33
  ]
34
34
  },
35
35
  "dependencies": {
36
- "@camstack/addon-admin-ui": "1.2.60",
36
+ "@camstack/addon-admin-ui": "1.2.61",
37
37
  "@camstack/addon-agent-ui": "1.2.17",
38
38
  "@camstack/addon-auth": "1.2.19",
39
39
  "@camstack/addon-decoder-nodeav": "1.2.16",
40
40
  "@camstack/addon-notifiers": "1.2.21",
41
- "@camstack/addon-pipeline": "1.2.77",
42
- "@camstack/addon-pipeline-orchestrator": "1.2.58",
43
- "@camstack/addon-post-analysis": "1.2.76",
41
+ "@camstack/addon-pipeline": "1.2.78",
42
+ "@camstack/addon-pipeline-orchestrator": "1.2.59",
43
+ "@camstack/addon-post-analysis": "1.2.77",
44
44
  "@camstack/sdk": "1.2.19",
45
45
  "@camstack/shm-ring": "1.1.16",
46
46
  "@camstack/system": "1.2.91",
47
- "@camstack/types": "1.2.73",
47
+ "@camstack/types": "1.2.74",
48
48
  "@camstack/ui-library": "1.2.51",
49
49
  "@fastify/compress": "^9.0.0",
50
50
  "@fastify/cookie": "^11.0.2",