@camstack/server 1.1.58 → 1.1.60

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.
@@ -179,11 +179,15 @@ async function passkeySecondFactorOptedIn(userId, provider) {
179
179
  // `redirect` buttons (OIDC / magic-link) + pre-auth `widget`s (passkey).
180
180
  // The widget arm is enriched server-side with a public `bundleUrl` from
181
181
  // `addonId` + `bundle`, so the addon never encodes the static-route
182
- // scheme. `?v=<now>` guards against a stale cached bundle after an addon
183
- // update (the login page loads rarely, so cache-busting is free here).
182
+ // scheme. The version is a PATH prefix (`v<…>/`), not a `?v=` query, so the
183
+ // bundle's relative sibling imports inherit it and a CDN busts the WHOLE
184
+ // bundle atomically on deploy (see the stamping site below).
184
185
  const PublicWidgetLoginMethodSchema = types_1.WidgetLoginMethodSchema.extend({
185
186
  bundleUrl: zod_1.z.string(),
186
187
  });
188
+ /** Stable per hub PROCESS — busts the login widget bundle URL on each
189
+ * restart/deploy while caching cleanly within the process's uptime. */
190
+ const AUTH_BUNDLE_VERSION = String(Date.now());
187
191
  const PublicLoginMethodSchema = zod_1.z.discriminatedUnion('kind', [
188
192
  types_1.RedirectLoginMethodSchema,
189
193
  PublicWidgetLoginMethodSchema,
@@ -961,10 +965,18 @@ function createAuthRouter(auth, registry, moleculer = null, shareTokens = null,
961
965
  }
962
966
  continue;
963
967
  }
964
- // Widget arm — stamp a public bundleUrl from addonId + bundle.
968
+ // Widget arm — stamp a public bundleUrl with the version in the
969
+ // PATH, not a `?v=` query. Module-Federation bundles import their
970
+ // fixed-name siblings (`./_stub.js`) by RELATIVE url, which never
971
+ // inherit a query — so a `?v=` busts only the entry and a CDN edge
972
+ // keeps serving a stale `_stub.js` (missing the newest widget). A
973
+ // path prefix makes every relative import inherit it → one atomic
974
+ // whole-bundle cache miss per deploy, on any CDN. `AUTH_BUNDLE_VERSION`
975
+ // is stable per hub process (busts on restart/deploy, caches within
976
+ // uptime). The `/api/addon-widgets` route strips the `v<…>/` segment.
965
977
  const parsed = PublicWidgetLoginMethodSchema.safeParse({
966
978
  ...raw,
967
- bundleUrl: `/api/addon-widgets/${raw.addonId}/${raw.bundle}?v=${Date.now()}`,
979
+ bundleUrl: `/api/addon-widgets/${raw.addonId}/v${AUTH_BUNDLE_VERSION}/${raw.bundle}`,
968
980
  });
969
981
  if (parsed.success) {
970
982
  out.push(parsed.data);
@@ -4919,6 +4919,15 @@ function createCapRouter_pipelineAnalytics(getProvider, createRemoteProxy) {
4919
4919
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
4920
4920
  return p.getAudioEvents(methodInput);
4921
4921
  }),
4922
+ getKeyEvents: trpc_middleware_js_1.protectedProcedure
4923
+ .input(types_76.pipelineAnalyticsCapability.methods.getKeyEvents.input.loose())
4924
+ .output(types_76.pipelineAnalyticsCapability.methods.getKeyEvents.output)
4925
+ .query(async ({ input, ctx }) => {
4926
+ const { nodeId, ...methodInput } = input;
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.getKeyEvents(methodInput);
4930
+ }),
4922
4931
  getEventDensity: trpc_middleware_js_1.protectedProcedure
4923
4932
  .input(types_76.pipelineAnalyticsCapability.methods.getEventDensity.input.loose())
4924
4933
  .output(types_76.pipelineAnalyticsCapability.methods.getEventDensity.output)
@@ -5661,6 +5670,15 @@ function createCapRouter_pipelineRunner(getProvider, createRemoteProxy) {
5661
5670
  const p = resolveProvider('pipeline-runner', input?.nodeId, () => getProvider(ctx), createRemoteProxy);
5662
5671
  return p.getLocalCameras();
5663
5672
  }),
5673
+ getNativeCrop: trpc_middleware_js_1.protectedProcedure
5674
+ .input(types_79.pipelineRunnerCapability.methods.getNativeCrop.input.loose())
5675
+ .output(types_79.pipelineRunnerCapability.methods.getNativeCrop.output)
5676
+ .query(async ({ input, ctx }) => {
5677
+ const { nodeId, ...methodInput } = input;
5678
+ const p = resolveProvider('pipeline-runner', nodeId, () => getProvider(ctx), createRemoteProxy);
5679
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5680
+ return p.getNativeCrop(methodInput);
5681
+ }),
5664
5682
  });
5665
5683
  }
5666
5684
  function createCapRouter_plateGallery(getProvider, createRemoteProxy) {
@@ -308,6 +308,10 @@ class MoleculerService {
308
308
  this.brokerSafe.createService((0, system_1.createHubCapForwardService)(onUnownedCall));
309
309
  const registry = new system_1.LocalChildRegistry({
310
310
  server: (0, system_1.createLocalTransport)().createServer(nodeId),
311
+ // This node's own id — lets the cap-call-out router serve a pin-to-self
312
+ // from the co-resident sibling instead of bouncing it through
313
+ // onUnownedCall (a pin to ANOTHER node still bypasses the sibling).
314
+ ownNodeId: nodeId,
311
315
  onUnownedCall,
312
316
  logger: {
313
317
  info: (msg, meta) => logger.info(msg, meta !== null && meta !== undefined
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.1.58",
3
+ "version": "1.1.60",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -23,19 +23,19 @@
23
23
  "test:watch": "vitest"
24
24
  },
25
25
  "dependencies": {
26
- "@camstack/addon-admin-ui": "1.1.47",
27
- "@camstack/addon-advanced-notifier": "1.1.21",
28
- "@camstack/addon-auth": "1.1.6",
29
- "@camstack/addon-decoder-nodeav": "1.1.9",
30
- "@camstack/addon-notifiers": "1.1.21",
31
- "@camstack/addon-pipeline": "1.1.52",
32
- "@camstack/addon-pipeline-orchestrator": "1.1.42",
33
- "@camstack/addon-post-analysis": "1.1.24",
34
- "@camstack/sdk": "1.1.22",
35
- "@camstack/shm-ring": "1.0.21",
36
- "@camstack/system": "1.1.45",
37
- "@camstack/types": "1.1.40",
38
- "@camstack/ui-library": "1.1.32",
26
+ "@camstack/addon-admin-ui": "1.1.49",
27
+ "@camstack/addon-advanced-notifier": "1.1.22",
28
+ "@camstack/addon-auth": "1.1.7",
29
+ "@camstack/addon-decoder-nodeav": "1.1.10",
30
+ "@camstack/addon-notifiers": "1.1.22",
31
+ "@camstack/addon-pipeline": "1.1.54",
32
+ "@camstack/addon-pipeline-orchestrator": "1.1.44",
33
+ "@camstack/addon-post-analysis": "1.1.26",
34
+ "@camstack/sdk": "1.1.23",
35
+ "@camstack/shm-ring": "1.0.22",
36
+ "@camstack/system": "1.1.47",
37
+ "@camstack/types": "1.1.42",
38
+ "@camstack/ui-library": "1.1.34",
39
39
  "@fastify/compress": "^9.0.0",
40
40
  "@fastify/cookie": "^11.0.2",
41
41
  "@fastify/multipart": "^10.0.0",