@camstack/types 1.2.384 → 1.2.385

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.
@@ -1,4 +1,5 @@
1
1
  import type { BulkUpdateState } from '../capabilities/addons.cap.js';
2
+ import type { AlertEpisodePayload } from '../notification/alert-episode.js';
2
3
  import type { MotionRegion } from '../capabilities/motion-detection.cap.js';
3
4
  import type { DetectionSource } from '../capabilities/pipeline-analytics.cap.js';
4
5
  import type { CamProfile } from '../capabilities/schemas/streaming-shared.js';
@@ -1557,6 +1558,7 @@ export interface EventCatalog {
1557
1558
  alertId: string;
1558
1559
  patch: Record<string, unknown>;
1559
1560
  };
1561
+ 'alert.episode': AlertEpisodePayload;
1560
1562
  /**
1561
1563
  * Per-broker stream health transition. Fired by the stream-broker
1562
1564
  * watchdog. `camStreamId` is the canonical identity of the source
@@ -843,3 +843,28 @@ export declare const StorageCleanupStatusInputSchema: z.ZodObject<{
843
843
  jobId: z.ZodOptional<z.ZodString>;
844
844
  }, z.core.$strip>;
845
845
  export type StorageCleanupStatusInput = z.infer<typeof StorageCleanupStatusInputSchema>;
846
+ /** The orchestrator's answer to "may a mover touch these locations now?". */
847
+ export interface MoverClearanceAnswer {
848
+ readonly clear: boolean;
849
+ readonly repointLocationId?: string | undefined;
850
+ }
851
+ export interface MoverStartDeps {
852
+ /** `storageMigration.moverClearance` — the orchestrator owns one claim per physical root. */
853
+ readonly clearance: (locationIds: readonly string[]) => Promise<MoverClearanceAnswer>;
854
+ /** Registers and starts the job; returns its id. */
855
+ readonly start: () => string;
856
+ readonly cancel: (jobId: string) => void;
857
+ /** The locations the job reads or writes (`*` = every eventMedia location). */
858
+ readonly locationIds: readonly string[];
859
+ }
860
+ /**
861
+ * Start a mover only when no single-location repoint holds an overlapping
862
+ * physical root. Asks BEFORE (cheap refusal, no job) and AFTER registering the
863
+ * job: the repoint announces its claim and then lists movers, so a mover that
864
+ * registers first is seen by it and one that registers second sees the claim —
865
+ * neither side can miss the other (2026-10-20: a repoint and a relocate job
866
+ * moved and deleted the same event media with no lock between them).
867
+ *
868
+ * Fail CLOSED: a clearance that cannot be asked refuses the start.
869
+ */
870
+ export declare function startMoverUnderClearance(deps: MoverStartDeps): Promise<string>;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * An alert EPISODE as a notification subject.
3
+ *
4
+ * The alert centre sends nothing of its own. A critical or error alert reaches
5
+ * the operator through Notification Center system-event rules, and this file is
6
+ * the one vocabulary the two sides share: the alert centre mints the episode
7
+ * identity and announces its two edges on the bus (`alert.episode`), and
8
+ * Notification Center derives the same identity when it RECONCILES from the
9
+ * alerts store, because a bus event may be dropped (D8, D11).
10
+ *
11
+ * ## Episode identity
12
+ *
13
+ * `metadata.episodeId`, minted by the alert centre when an alert opens (new, or
14
+ * re-opened after it was completed/dismissed, or its emitter changed
15
+ * `metadata.episodeKey`) and kept through every re-emit while it stays open. An
16
+ * alert row written before the alert centre minted ids has none: its episode is
17
+ * `<id>@<createdAt>`, derived here so both sides agree.
18
+ */
19
+ import { z } from 'zod';
20
+ import { type Alert, type AlertSeverity, type AlertStatus } from '../capabilities/alerts.cap.js';
21
+ import type { NcSystemEventKind } from '../capabilities/notification-rules.cap.js';
22
+ export type AlertEpisodePhase = 'raised' | 'resolved';
23
+ /** The bus payload of `EventCategory.AlertEpisode`. */
24
+ export declare const AlertEpisodePayloadSchema: z.ZodObject<{
25
+ phase: z.ZodEnum<{
26
+ raised: "raised";
27
+ resolved: "resolved";
28
+ }>;
29
+ episodeId: z.ZodString;
30
+ alertId: z.ZodString;
31
+ severity: z.ZodEnum<{
32
+ critical: "critical";
33
+ error: "error";
34
+ info: "info";
35
+ success: "success";
36
+ warning: "warning";
37
+ }>;
38
+ category: z.ZodString;
39
+ title: z.ZodString;
40
+ message: z.ZodString;
41
+ sourceType: z.ZodOptional<z.ZodString>;
42
+ sourceId: z.ZodOptional<z.ZodString>;
43
+ nodeId: z.ZodOptional<z.ZodString>;
44
+ actionUrl: z.ZodOptional<z.ZodString>;
45
+ at: z.ZodNumber;
46
+ }, z.core.$strip>;
47
+ export type AlertEpisodePayload = z.infer<typeof AlertEpisodePayloadSchema>;
48
+ /** The payload of an `alert.episode` event's `data`, or `null` when it is not one. */
49
+ export declare function parseAlertEpisodePayload(data: unknown): AlertEpisodePayload | null;
50
+ /** An episode is closed once its alert is completed or dismissed. */
51
+ export declare function isAlertEpisodeOpen(status: AlertStatus): boolean;
52
+ /** Only these severities are ever announced. */
53
+ export declare function isAlertEpisodeSeverity(severity: AlertSeverity): boolean;
54
+ export declare function alertEpisodeId(alert: Pick<Alert, 'id' | 'createdAt' | 'metadata'>): string;
55
+ /** The node an alert is about, from the places emitters put it. */
56
+ export declare function alertNodeId(alert: Pick<Alert, 'source' | 'metadata'>): string | undefined;
57
+ /**
58
+ * The system-event kind of an episode edge, or `null` when none is announced
59
+ * (an `error` episode announces its opening only).
60
+ */
61
+ export declare function alertEpisodeKind(severity: AlertSeverity, phase: AlertEpisodePhase): NcSystemEventKind | null;
62
+ export declare function alertEpisodePayload(alert: Alert, phase: AlertEpisodePhase, at: number): AlertEpisodePayload;
@@ -1,4 +1,4 @@
1
- const require_event_category = require("./event-category-Hoe-mqbd.js");
1
+ const require_event_category = require("./event-category-eSqkye-K.js");
2
2
  let zod = require("zod");
3
3
  //#region src/audio/audio-chunk-format.ts
4
4
  /**
@@ -6388,6 +6388,7 @@ function createDeviceProxy(api, binding, opts) {
6388
6388
  const dishwasherInterface = {
6389
6389
  start: (input) => dispatch("dishwasher", "dishwasher", "start", "mutation", input),
6390
6390
  pause: (input) => dispatch("dishwasher", "dishwasher", "pause", "mutation", input),
6391
+ resume: (input) => dispatch("dishwasher", "dishwasher", "resume", "mutation", input),
6391
6392
  stop: (input) => dispatch("dishwasher", "dishwasher", "stop", "mutation", input),
6392
6393
  setProgram: (input) => dispatch("dishwasher", "dishwasher", "setProgram", "mutation", input),
6393
6394
  setPower: (input) => dispatch("dishwasher", "dishwasher", "setPower", "mutation", input),
@@ -6398,6 +6399,7 @@ function createDeviceProxy(api, binding, opts) {
6398
6399
  setVarioSpeedPlus: (input) => dispatch("dishwasher", "dishwasher", "setVarioSpeedPlus", "mutation", input),
6399
6400
  setChildLock: (input) => dispatch("dishwasher", "dishwasher", "setChildLock", "mutation", input),
6400
6401
  setOption: (input) => dispatch("dishwasher", "dishwasher", "setOption", "mutation", input),
6402
+ getOptions: (input) => dispatch("dishwasher", "dishwasher", "getOptions", "query", input),
6401
6403
  getStatus: (input) => dispatch("dishwasher", "dishwasher", "getStatus", "query", input)
6402
6404
  };
6403
6405
  const doorbellInterface = { getStatus: (input) => dispatch("doorbell", "doorbell", "getStatus", "query", input) };
@@ -1,4 +1,4 @@
1
- import { t as EventCategory } from "./event-category-BvOFi6PY.mjs";
1
+ import { t as EventCategory } from "./event-category-DOl51-Ij.mjs";
2
2
  import { z } from "zod";
3
3
  //#region src/audio/audio-chunk-format.ts
4
4
  /**
@@ -6388,6 +6388,7 @@ function createDeviceProxy(api, binding, opts) {
6388
6388
  const dishwasherInterface = {
6389
6389
  start: (input) => dispatch("dishwasher", "dishwasher", "start", "mutation", input),
6390
6390
  pause: (input) => dispatch("dishwasher", "dishwasher", "pause", "mutation", input),
6391
+ resume: (input) => dispatch("dishwasher", "dishwasher", "resume", "mutation", input),
6391
6392
  stop: (input) => dispatch("dishwasher", "dishwasher", "stop", "mutation", input),
6392
6393
  setProgram: (input) => dispatch("dishwasher", "dishwasher", "setProgram", "mutation", input),
6393
6394
  setPower: (input) => dispatch("dishwasher", "dishwasher", "setPower", "mutation", input),
@@ -6398,6 +6399,7 @@ function createDeviceProxy(api, binding, opts) {
6398
6399
  setVarioSpeedPlus: (input) => dispatch("dishwasher", "dishwasher", "setVarioSpeedPlus", "mutation", input),
6399
6400
  setChildLock: (input) => dispatch("dishwasher", "dishwasher", "setChildLock", "mutation", input),
6400
6401
  setOption: (input) => dispatch("dishwasher", "dishwasher", "setOption", "mutation", input),
6402
+ getOptions: (input) => dispatch("dishwasher", "dishwasher", "getOptions", "query", input),
6401
6403
  getStatus: (input) => dispatch("dishwasher", "dishwasher", "getStatus", "query", input)
6402
6404
  };
6403
6405
  const doorbellInterface = { getStatus: (input) => dispatch("doorbell", "doorbell", "getStatus", "query", input) };
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Where an OAuth round-trip ends: the admin-ui completion route
3
+ * (`/sso-complete`, the page every popup sign-in already lands on), with the
4
+ * OUTCOME in the URL fragment.
5
+ *
6
+ * The outcome is a status plus a reason CODE from a closed list. It never
7
+ * carries a token, a code, a client secret or a free-form error message: the
8
+ * page words each code itself, and an unknown code reads as `unknown` rather
9
+ * than being echoed. Fragment only, so nothing here reaches a server log.
10
+ *
11
+ * Pure and browser-safe.
12
+ */
13
+ /** The admin-ui route the hub's OAuth completions land on (relative to its mount). */
14
+ export declare const OAUTH_LANDING_PATH = "/sso-complete";
15
+ export declare const OAUTH_LANDING_REASONS: readonly ['access_denied', 'invalid_state', 'invalid_request', 'unknown_broker', 'not_configured', 'exchange_failed', 'no_refresh_token', 'unavailable', 'unknown'];
16
+ export type OauthLandingReason = (typeof OAUTH_LANDING_REASONS)[number];
17
+ export declare function isOauthLandingReason(value: unknown): value is OauthLandingReason;
18
+ export interface OauthLandingOutcome {
19
+ readonly status: 'success' | 'error';
20
+ /** The addon that ran the flow — names the integration page to return to, when known. */
21
+ readonly addonId?: string;
22
+ /** The broker the flow signed in, when it was one. */
23
+ readonly brokerId?: string;
24
+ /** An OAuth integration id (`export-alexa`), when the flow was an account link. */
25
+ readonly integration?: string;
26
+ /** Why it failed; an error without one reads as `unknown`. */
27
+ readonly reason?: OauthLandingReason;
28
+ /** What the flow did; absent means a sign-in (connect). */
29
+ readonly action?: 'connect' | 'disconnect';
30
+ }
31
+ /**
32
+ * The landing URL for `outcome`. `origin` is the hub address the flow already
33
+ * runs on (from the `local-network` palette role, never a literal); `null`
34
+ * gives a hub-relative URL.
35
+ */
36
+ export declare function oauthLandingUrl(origin: string | null, outcome: OauthLandingOutcome): string;
37
+ /** Parse the fragment of a landing URL; `null` for anything that is not one. */
38
+ export declare function parseOauthLandingFragment(hash: string): OauthLandingOutcome | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.384",
3
+ "version": "1.2.385",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",