@camstack/sdk 1.2.127 → 1.2.129

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,5 +1,5 @@
1
1
  /**
2
- * Re-export AppRouter type from @camstack/types (pre-generated from server router).
3
- * Type-only — no runtime dependency on the backend package.
4
- */
5
- export type { AppRouter as BackendAppRouter } from '@camstack/types';
2
+ * Re-export AppRouter type from @camstack/types (pre-generated from server router).
3
+ * Type-only — no runtime dependency on the backend package.
4
+ */
5
+ export type { AppRouter as BackendAppRouter } from "@camstack/types";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @deprecated Import BaseDevice from '@camstack/types' instead.
3
- * This re-export is kept for backwards compatibility.
4
- */
5
- export { BaseDevice } from '@camstack/types';
2
+ * @deprecated Import BaseDevice from '@camstack/types' instead.
3
+ * This re-export is kept for backwards compatibility.
4
+ */
5
+ export { BaseDevice } from "@camstack/types";
package/dist/camera.d.ts CHANGED
@@ -1,35 +1,35 @@
1
1
  /**
2
- * Camera & PTZ types — shared between CamStack app and proxy.
3
- */
2
+ * Camera & PTZ types — shared between CamStack app and proxy.
3
+ */
4
4
  /** Streaming method. */
5
- export type StreamMethod = 'webrtc' | 'mjpeg';
5
+ export type StreamMethod = "webrtc" | "mjpeg";
6
6
  /** PTZ command. */
7
7
  export interface PanTiltZoomCommand {
8
- movement?: 'Relative' | 'Absolute' | 'Continuous' | 'Home' | 'Preset';
9
- pan?: number;
10
- tilt?: number;
11
- zoom?: number;
12
- preset?: string;
13
- timeout?: number;
8
+ movement?: "Relative" | "Absolute" | "Continuous" | "Home" | "Preset";
9
+ pan?: number;
10
+ tilt?: number;
11
+ zoom?: number;
12
+ preset?: string;
13
+ timeout?: number;
14
14
  }
15
15
  /** PTZ capabilities reported by the device. */
16
16
  export interface PanTiltZoomCapabilities {
17
- pan?: boolean;
18
- tilt?: boolean;
19
- zoom?: boolean;
20
- presets?: Record<string, string>;
17
+ pan?: boolean;
18
+ tilt?: boolean;
19
+ zoom?: boolean;
20
+ presets?: Record<string, string>;
21
21
  }
22
22
  /** Accessory switch kinds exposed by the Advanced Notifier plugin. */
23
- export type CameraAccessorySwitchKind = 'siren_on_motion' | 'siren' | 'light_on_motion' | 'light' | 'pir' | 'autotracking';
23
+ export type CameraAccessorySwitchKind = "siren_on_motion" | "siren" | "light_on_motion" | "light" | "pir" | "autotracking";
24
24
  /** Extended camera status with accessory switches (from AN plugin). */
25
25
  export interface CameraStatusEntry {
26
- notificationsEnabled: boolean;
27
- isRecording: boolean;
28
- isSnapshotsEnabled: boolean;
29
- isRebroadcastEnabled: boolean;
30
- accessorySwitchStates: Partial<Record<CameraAccessorySwitchKind, boolean>>;
26
+ notificationsEnabled: boolean;
27
+ isRecording: boolean;
28
+ isSnapshotsEnabled: boolean;
29
+ isRebroadcastEnabled: boolean;
30
+ accessorySwitchStates: Partial<Record<CameraAccessorySwitchKind, boolean>>;
31
31
  }
32
32
  /** Batch camera status response. */
33
33
  export interface CamerasStatusResult {
34
- cameras: Record<string, CameraStatusEntry>;
34
+ cameras: Record<string, CameraStatusEntry>;
35
35
  }
@@ -1,32 +1,32 @@
1
1
  /**
2
- * Detection classes — shared between CamStack app and proxy.
3
- * Aligned with the shared detection-class taxonomy.
4
- */
2
+ * Detection classes — shared between CamStack app and proxy.
3
+ * Aligned with the shared detection-class taxonomy.
4
+ */
5
5
  export declare enum DetectionClass {
6
- Motion = "motion",
7
- Person = "person",
8
- Vehicle = "vehicle",
9
- Animal = "animal",
10
- Audio = "audio",
11
- Face = "face",
12
- Plate = "plate",
13
- Package = "package",
14
- Doorbell = "doorbell",
15
- Sensor = "sensor"
6
+ Motion = "motion",
7
+ Person = "person",
8
+ Vehicle = "vehicle",
9
+ Animal = "animal",
10
+ Audio = "audio",
11
+ Face = "face",
12
+ Plate = "plate",
13
+ Package = "package",
14
+ Doorbell = "doorbell",
15
+ Sensor = "sensor"
16
16
  }
17
- export declare const animalClasses: string[];
18
- export declare const personClasses: string[];
19
- export declare const vehicleClasses: string[];
20
- export declare const faceClasses: string[];
21
- export declare const licensePlateClasses: string[];
22
- export declare const motionClasses: string[];
23
- export declare const packageClasses: string[];
24
- export declare const audioClasses: string[];
17
+ export declare const animalClasses: readonly string[];
18
+ export declare const personClasses: readonly string[];
19
+ export declare const vehicleClasses: readonly string[];
20
+ export declare const faceClasses: readonly string[];
21
+ export declare const licensePlateClasses: readonly string[];
22
+ export declare const motionClasses: readonly string[];
23
+ export declare const packageClasses: readonly string[];
24
+ export declare const audioClasses: readonly string[];
25
25
  /** Common YAMNet audio labels (advanced-notifier). Parent: Audio. */
26
- export declare const audioLabelClasses: string[];
27
- export declare const doorbellClasses: string[];
26
+ export declare const audioLabelClasses: readonly string[];
27
+ export declare const doorbellClasses: readonly string[];
28
28
  /** Sensor types (advanced-notifier SupportedSensorType). Parent: Sensor. */
29
- export declare const sensorLabelClasses: string[];
29
+ export declare const sensorLabelClasses: readonly string[];
30
30
  export declare const detectionClassesDefaultMap: Record<string, DetectionClass>;
31
31
  export declare const isFaceClassname: (c: string) => boolean;
32
32
  export declare const isPlateClassname: (c: string) => boolean;
@@ -41,13 +41,13 @@ export declare const isSensorLabelClassname: (c: string) => boolean;
41
41
  export declare const isLabelDetection: (c: string) => boolean;
42
42
  export declare const getParentClass: (className: string) => DetectionClass | undefined;
43
43
  export declare const getParentDetectionClass: (det: {
44
- label?: string;
45
- className: string;
44
+ label?: string;
45
+ className: string;
46
46
  }) => DetectionClass | undefined;
47
47
  export declare const defaultDetectionClasses: DetectionClass[];
48
48
  /** Default enabled classes: all except Motion. */
49
- export declare const DEFAULT_ENABLED_CLASSES: (DetectionClass.Person | DetectionClass.Vehicle | DetectionClass.Animal | DetectionClass.Audio | DetectionClass.Face | DetectionClass.Plate | DetectionClass.Package | DetectionClass.Doorbell | DetectionClass.Sensor)[];
50
- export type TimelineEventPreset = 'all' | 'important' | 'critical' | 'custom';
49
+ export declare const DEFAULT_ENABLED_CLASSES: DetectionClass[];
50
+ export type TimelineEventPreset = "all" | "important" | "critical" | "custom";
51
51
  /** Classes for "critical" preset: security-relevant only (person, doorbell, package). */
52
52
  export declare const TIMELINE_PRESET_CRITICAL: string[];
53
53
  /** Classes for "important" preset: critical + vehicle, animal, audio, face, plate. */
package/dist/index.cjs CHANGED
@@ -667,6 +667,9 @@ SuperJSON.allowErrorProps;
667
667
  * ui-library Provider can seed React Query with the same WS connection
668
668
  * — a future phase will narrow the surface further.
669
669
  */
670
+ function refreshFlag(options) {
671
+ return options.refreshable === true ? { refreshable: true } : {};
672
+ }
670
673
  var WS_KEEP_ALIVE_INTERVAL_MS = 1e4;
671
674
  var WS_KEEP_ALIVE_PONG_TIMEOUT_MS = 6e3;
672
675
  var WS_RECONNECT_RETRY_DELAY_MS = 2e3;
@@ -946,10 +949,11 @@ var System = class {
946
949
  this.mirror = null;
947
950
  this.mirrorInit = null;
948
951
  }
949
- async login(username, password) {
952
+ async login(username, password, options = {}) {
950
953
  const result = await this._trpcClient.auth.login.mutate({
951
954
  username,
952
- password
955
+ password,
956
+ ...refreshFlag(options)
953
957
  });
954
958
  if (typeof result === "object" && result !== null && "token" in result) {
955
959
  const r = result;
@@ -966,10 +970,11 @@ var System = class {
966
970
  * server mints the real session JWT, which we set as the active
967
971
  * token on this client.
968
972
  */
969
- async loginVerifyTotp(challengeToken, code) {
973
+ async loginVerifyTotp(challengeToken, code, options = {}) {
970
974
  const result = await this._trpcClient.auth.loginVerifyTotp.mutate({
971
975
  challengeToken,
972
- code
976
+ code,
977
+ ...refreshFlag(options)
973
978
  });
974
979
  if (typeof result === "object" && result !== null && "token" in result) {
975
980
  const token = result.token;
@@ -990,10 +995,11 @@ var System = class {
990
995
  * success the server mints the real session JWT, which we set as the
991
996
  * active token on this client.
992
997
  */
993
- async loginVerifyPasskey(challengeToken, response) {
998
+ async loginVerifyPasskey(challengeToken, response, options = {}) {
994
999
  const result = await this._trpcClient.auth.loginVerifyPasskey.mutate({
995
1000
  challengeToken,
996
- response
1001
+ response,
1002
+ ...refreshFlag(options)
997
1003
  });
998
1004
  if (typeof result === "object" && result !== null && "token" in result) {
999
1005
  const token = result.token;
@@ -1022,8 +1028,11 @@ var System = class {
1022
1028
  * `secondFactors`. That token is NOT persisted as the active session
1023
1029
  * — the caller completes the remaining factor via `loginVerifyTotp`.
1024
1030
  */
1025
- async passkeyLoginFinish(response) {
1026
- const result = await this._trpcClient.auth.passkeyLoginFinish.mutate({ response });
1031
+ async passkeyLoginFinish(response, options = {}) {
1032
+ const result = await this._trpcClient.auth.passkeyLoginFinish.mutate({
1033
+ response,
1034
+ ...refreshFlag(options)
1035
+ });
1027
1036
  if (typeof result === "object" && result !== null && "token" in result) {
1028
1037
  const r = result;
1029
1038
  const requiresSecondFactor = r.requiresTotp === true || Array.isArray(r.secondFactors) && r.secondFactors.length > 0;
@@ -1031,8 +1040,22 @@ var System = class {
1031
1040
  }
1032
1041
  return result;
1033
1042
  }
1034
- async logout() {
1035
- await this._trpcClient.auth.logout.mutate();
1043
+ /**
1044
+ * Swap a refresh token for a new access token and a ROTATED refresh token
1045
+ * (the old one stops working). Sets the new access token on this client.
1046
+ * Throws a tRPC UNAUTHORIZED when the session is over — sign in again.
1047
+ */
1048
+ async refreshSession(refreshToken) {
1049
+ const result = await this._trpcClient.auth.refreshSession.mutate({ refreshToken });
1050
+ this.setToken(result.token);
1051
+ return result;
1052
+ }
1053
+ /**
1054
+ * End this session on the hub (its tokens stop working at once);
1055
+ * `everywhere: true` ends every session of the user.
1056
+ */
1057
+ async logout(options = {}) {
1058
+ await this._trpcClient.auth.logout.mutate(options.everywhere === true ? { everywhere: true } : void 0);
1036
1059
  }
1037
1060
  async getMe() {
1038
1061
  return await this._trpcClient.auth.me.query();
@@ -1046,8 +1069,25 @@ var System = class {
1046
1069
  async confirmOwnTotp(input) {
1047
1070
  return await this._trpcClient.auth.confirmOwnTotp.mutate(input);
1048
1071
  }
1049
- async disableOwnTotp() {
1050
- return await this._trpcClient.auth.disableOwnTotp.mutate();
1072
+ /** Needs a fresh `reauthToken` from {@link reauthenticate}. */
1073
+ async disableOwnTotp(input) {
1074
+ return await this._trpcClient.auth.disableOwnTotp.mutate(input);
1075
+ }
1076
+ /**
1077
+ * Re-authentication, passkey path step 1: assertion options for the
1078
+ * caller's own passkeys. Feed `optionsJSON` to `startAuthentication`, then
1079
+ * pass the result to {@link reauthenticate} as `passkeyResponse`.
1080
+ */
1081
+ async reauthBeginPasskey() {
1082
+ return await this._trpcClient.auth.reauthBeginPasskey.mutate();
1083
+ }
1084
+ /**
1085
+ * Prove it is you — the current password or a passkey assertion — for a
1086
+ * 5-minute `reauthToken`, required by `disableOwnTotp`, `removeOwnPasskey`
1087
+ * and `auth.beginExternalLink` (valid only in this session).
1088
+ */
1089
+ async reauthenticate(input) {
1090
+ return await this._trpcClient.auth.reauthenticate.mutate(input);
1051
1091
  }
1052
1092
  async getOwnTotpStatus() {
1053
1093
  return await this._trpcClient.auth.getOwnTotpStatus.query();
@@ -1061,6 +1101,7 @@ var System = class {
1061
1101
  async listOwnPasskeys() {
1062
1102
  return await this._trpcClient.auth.listOwnPasskeys.query();
1063
1103
  }
1104
+ /** Needs a fresh `reauthToken` from {@link reauthenticate}. */
1064
1105
  async removeOwnPasskey(input) {
1065
1106
  return await this._trpcClient.auth.removeOwnPasskey.mutate(input);
1066
1107
  }
@@ -1410,6 +1451,119 @@ async function raceFastestEndpoint(candidates, timeoutMs) {
1410
1451
  }
1411
1452
  }
1412
1453
  //#endregion
1454
+ //#region src/session-keeper.ts
1455
+ var DEFAULT_MARGIN_MS = 5 * 6e4;
1456
+ var RETRY_MS = 3e4;
1457
+ var MIN_DELAY_MS = 1e3;
1458
+ /** Decode a JWT's `exp` (seconds) to epoch ms, or `null`. Never throws. */
1459
+ function jwtExpiresAt(token) {
1460
+ const part = token.split(".")[1];
1461
+ if (part === void 0) return null;
1462
+ try {
1463
+ const base64 = part.replace(/-/g, "+").replace(/_/g, "/");
1464
+ const json = typeof atob === "function" ? atob(base64) : Buffer.from(base64, "base64").toString("utf8");
1465
+ const payload = JSON.parse(json);
1466
+ if (payload === null || typeof payload !== "object") return null;
1467
+ const exp = Reflect.get(payload, "exp");
1468
+ return typeof exp === "number" && Number.isFinite(exp) ? exp * 1e3 : null;
1469
+ } catch {
1470
+ return null;
1471
+ }
1472
+ }
1473
+ /** Is `error` the hub saying the session is over (as opposed to a transport failure)? */
1474
+ function isSessionRefusal(error) {
1475
+ if (error === null || typeof error !== "object") return false;
1476
+ const data = Reflect.get(error, "data");
1477
+ const code = data !== null && typeof data === "object" ? Reflect.get(data, "code") : void 0;
1478
+ return code === "UNAUTHORIZED" || code === "FORBIDDEN";
1479
+ }
1480
+ var SessionKeeper = class {
1481
+ options;
1482
+ current = null;
1483
+ cancel = null;
1484
+ inflight = null;
1485
+ now;
1486
+ setTimer;
1487
+ constructor(options) {
1488
+ this.options = options;
1489
+ this.now = options.now ?? Date.now;
1490
+ this.setTimer = options.setTimer ?? ((fn, ms) => {
1491
+ const handle = setTimeout(fn, ms);
1492
+ return () => clearTimeout(handle);
1493
+ });
1494
+ }
1495
+ /** Take over `tokens` (a login, a restore from storage) and schedule its refresh. */
1496
+ adopt(tokens) {
1497
+ this.current = tokens;
1498
+ this.schedule();
1499
+ }
1500
+ /** The tokens the keeper holds now. */
1501
+ tokens() {
1502
+ return this.current;
1503
+ }
1504
+ /**
1505
+ * Refresh now if the access token expires within `marginMs` (default: the
1506
+ * keeper's margin) — call it before reconnecting after the app was in the
1507
+ * background. Resolves when done; concurrent callers share one refresh.
1508
+ */
1509
+ async ensureFresh(marginMs = this.margin()) {
1510
+ const current = this.current;
1511
+ if (current?.refreshToken === void 0) return;
1512
+ const expiresAt = this.expiresAtOf(current);
1513
+ if (expiresAt !== null && expiresAt - this.now() > marginMs) return;
1514
+ await this.refreshNow();
1515
+ }
1516
+ /** Refresh immediately. `null` when there is nothing to refresh or it failed. */
1517
+ refreshNow() {
1518
+ if (this.inflight !== null) return this.inflight;
1519
+ const refreshToken = this.current?.refreshToken;
1520
+ if (refreshToken === void 0) return Promise.resolve(null);
1521
+ this.inflight = this.options.refresh(refreshToken).then((next) => {
1522
+ this.current = next;
1523
+ this.options.onTokens(next);
1524
+ this.schedule();
1525
+ return next;
1526
+ }).catch((error) => {
1527
+ if (isSessionRefusal(error)) {
1528
+ this.stop();
1529
+ this.current = null;
1530
+ this.options.onExpired();
1531
+ } else this.arm(RETRY_MS);
1532
+ return null;
1533
+ }).finally(() => {
1534
+ this.inflight = null;
1535
+ });
1536
+ return this.inflight;
1537
+ }
1538
+ stop() {
1539
+ this.cancel?.();
1540
+ this.cancel = null;
1541
+ }
1542
+ margin() {
1543
+ return this.options.marginMs ?? DEFAULT_MARGIN_MS;
1544
+ }
1545
+ expiresAtOf(tokens) {
1546
+ return tokens.expiresAt ?? jwtExpiresAt(tokens.token);
1547
+ }
1548
+ schedule() {
1549
+ this.stop();
1550
+ const current = this.current;
1551
+ if (current?.refreshToken === void 0) return;
1552
+ const expiresAt = this.expiresAtOf(current);
1553
+ if (expiresAt === null) return;
1554
+ const remaining = expiresAt - this.now();
1555
+ const margin = Math.min(this.margin(), Math.max(0, remaining / 2));
1556
+ this.arm(Math.max(MIN_DELAY_MS, remaining - margin));
1557
+ }
1558
+ arm(ms) {
1559
+ this.stop();
1560
+ this.cancel = this.setTimer(() => {
1561
+ this.cancel = null;
1562
+ this.refreshNow();
1563
+ }, ms);
1564
+ }
1565
+ };
1566
+ //#endregion
1413
1567
  //#region src/detection.ts
1414
1568
  /**
1415
1569
  * Detection classes — shared between CamStack app and proxy.
@@ -1623,6 +1777,9 @@ var sensorLabelClasses = [
1623
1777
  "flooded",
1624
1778
  "entry_open"
1625
1779
  ];
1780
+ function listIncludes(list, value) {
1781
+ return list.includes(value);
1782
+ }
1626
1783
  var detectionClassesDefaultMap = {
1627
1784
  ...animalClasses.reduce((tot, curr) => ({
1628
1785
  ...tot,
@@ -1669,16 +1826,16 @@ var detectionClassesDefaultMap = {
1669
1826
  [curr]: "sensor"
1670
1827
  }), {})
1671
1828
  };
1672
- var isFaceClassname = (c) => faceClasses.includes(c);
1673
- var isPlateClassname = (c) => licensePlateClasses.includes(c);
1674
- var isAnimalClassname = (c) => animalClasses.includes(c);
1675
- var isPersonClassname = (c) => personClasses.includes(c);
1676
- var isVehicleClassname = (c) => vehicleClasses.includes(c);
1677
- var isMotionClassname = (c) => motionClasses.includes(c);
1678
- var isDoorbellClassname = (c) => doorbellClasses.includes(c);
1679
- var isPackageClassname = (c) => packageClasses.includes(c);
1680
- var isAudioClassname = (c) => audioClasses.includes(c) || audioLabelClasses.includes(c);
1681
- var isSensorLabelClassname = (c) => sensorLabelClasses.includes(c);
1829
+ var isFaceClassname = (c) => listIncludes(faceClasses, c);
1830
+ var isPlateClassname = (c) => listIncludes(licensePlateClasses, c);
1831
+ var isAnimalClassname = (c) => listIncludes(animalClasses, c);
1832
+ var isPersonClassname = (c) => listIncludes(personClasses, c);
1833
+ var isVehicleClassname = (c) => listIncludes(vehicleClasses, c);
1834
+ var isMotionClassname = (c) => listIncludes(motionClasses, c);
1835
+ var isDoorbellClassname = (c) => listIncludes(doorbellClasses, c);
1836
+ var isPackageClassname = (c) => listIncludes(packageClasses, c);
1837
+ var isAudioClassname = (c) => listIncludes(audioClasses, c) || listIncludes(audioLabelClasses, c);
1838
+ var isSensorLabelClassname = (c) => listIncludes(sensorLabelClasses, c);
1682
1839
  var isLabelDetection = (c) => isFaceClassname(c) || isPlateClassname(c);
1683
1840
  var getParentClass = (className) => detectionClassesDefaultMap[className];
1684
1841
  var getParentDetectionClass = (det) => {
@@ -1724,6 +1881,7 @@ function getClassesForTimelinePreset(preset, customClasses) {
1724
1881
  //#endregion
1725
1882
  exports.DEFAULT_ENABLED_CLASSES = DEFAULT_ENABLED_CLASSES;
1726
1883
  exports.DetectionClass = DetectionClass;
1884
+ exports.SessionKeeper = SessionKeeper;
1727
1885
  exports.System = System;
1728
1886
  exports.TIMELINE_PRESET_ALL = TIMELINE_PRESET_ALL;
1729
1887
  exports.TIMELINE_PRESET_CRITICAL = TIMELINE_PRESET_CRITICAL;
@@ -1749,7 +1907,9 @@ exports.isPackageClassname = isPackageClassname;
1749
1907
  exports.isPersonClassname = isPersonClassname;
1750
1908
  exports.isPlateClassname = isPlateClassname;
1751
1909
  exports.isSensorLabelClassname = isSensorLabelClassname;
1910
+ exports.isSessionRefusal = isSessionRefusal;
1752
1911
  exports.isVehicleClassname = isVehicleClassname;
1912
+ exports.jwtExpiresAt = jwtExpiresAt;
1753
1913
  exports.licensePlateClasses = licensePlateClasses;
1754
1914
  exports.motionClasses = motionClasses;
1755
1915
  exports.packageClasses = packageClasses;
package/dist/index.d.ts CHANGED
@@ -1,11 +1,13 @@
1
- export { System, createSystem, raceFastestEndpoint } from './system.js';
2
- export type { SystemConfig, UserInfo, SystemLiveEvent, SystemLiveEventListener, SecondFactorKind, } from './system.js';
3
- export type { DeviceInfo } from '@camstack/types';
4
- export type { BackendAppRouter } from './backend-router.js';
5
- export type { BackendAppRouter as AppRouter } from './backend-router.js';
6
- export type { BackendConnectionState } from './types.js';
7
- export { DetectionClass, animalClasses, personClasses, vehicleClasses, faceClasses, licensePlateClasses, motionClasses, packageClasses, audioClasses, audioLabelClasses, doorbellClasses, sensorLabelClasses, detectionClassesDefaultMap, isFaceClassname, isPlateClassname, isAnimalClassname, isPersonClassname, isVehicleClassname, isMotionClassname, isDoorbellClassname, isPackageClassname, isAudioClassname, isSensorLabelClassname, isLabelDetection, getParentClass, getParentDetectionClass, defaultDetectionClasses, DEFAULT_ENABLED_CLASSES, TIMELINE_PRESET_CRITICAL, TIMELINE_PRESET_IMPORTANT, TIMELINE_PRESET_ALL, getClassesForTimelinePreset, } from './detection.js';
8
- export type { TimelineEventPreset } from './detection.js';
9
- export type { TimelineEventSeverity, MotionFragmentType, DetectionEvent, MotionItem, TimelineArtifact, AudioLevelSegment, TimelineRecordingSegment, CameraDayDataResponse, ClusteredDayDataResponse, TimelineCluster, DetectionGroup, ClusteredDayDataQuery, GroupedEventsQuery, GroupedEventsResult, ClusterEventsQuery, ClusterEventsResult, ReelEvent, ReelEventsQuery, ReelEventsResult, } from './timeline.js';
10
- export type { StreamMethod, PanTiltZoomCommand, PanTiltZoomCapabilities, CameraAccessorySwitchKind, CameraStatusEntry, CamerasStatusResult, } from './camera.js';
11
- export type { StreamSourceEntry, NvrCamera, CameraAccessory, StreamInfo, NormalizedBoundingBox, DetectionData, EventSnapshotData, NvrEvent, RecordingSegment, MotionBucket, LiveDetection, LiveMotionData, LiveDetectionData, LiveAudioData, LiveMotionEvent, LiveDetectionEvent, LiveAudioEvent, LiveGenericEvent, LiveReviewEvent, LiveEvent, LiveEventType, VideoClipsQuery, NvrVideoClip, VideoClipsResult, VideoClipUrlResult, CameraDayData, CameraStatus, EventsQuery, MotionQuery, RecordingsQuery, NvrConfig, ProviderConfigs, } from './nvr.js';
1
+ export { System, createSystem, raceFastestEndpoint } from "./system.js";
2
+ export type { LoginOptions, LoginOutcome, RefreshedSession } from "./system.js";
3
+ export { isSessionRefusal, jwtExpiresAt, SessionKeeper, type SessionKeeperOptions, type SessionTokens } from "./session-keeper.js";
4
+ export type { SystemConfig, UserInfo, SystemLiveEvent, SystemLiveEventListener, SecondFactorKind } from "./system.js";
5
+ export type { DeviceInfo } from "@camstack/types";
6
+ export type { BackendAppRouter } from "./backend-router.js";
7
+ export type { BackendAppRouter as AppRouter } from "./backend-router.js";
8
+ export type { BackendConnectionState } from "./types.js";
9
+ export { DetectionClass, animalClasses, personClasses, vehicleClasses, faceClasses, licensePlateClasses, motionClasses, packageClasses, audioClasses, audioLabelClasses, doorbellClasses, sensorLabelClasses, detectionClassesDefaultMap, isFaceClassname, isPlateClassname, isAnimalClassname, isPersonClassname, isVehicleClassname, isMotionClassname, isDoorbellClassname, isPackageClassname, isAudioClassname, isSensorLabelClassname, isLabelDetection, getParentClass, getParentDetectionClass, defaultDetectionClasses, DEFAULT_ENABLED_CLASSES, TIMELINE_PRESET_CRITICAL, TIMELINE_PRESET_IMPORTANT, TIMELINE_PRESET_ALL, getClassesForTimelinePreset } from "./detection.js";
10
+ export type { TimelineEventPreset } from "./detection.js";
11
+ export type { TimelineEventSeverity, MotionFragmentType, DetectionEvent, MotionItem, TimelineArtifact, AudioLevelSegment, TimelineRecordingSegment, CameraDayDataResponse, ClusteredDayDataResponse, TimelineCluster, DetectionGroup, ClusteredDayDataQuery, GroupedEventsQuery, GroupedEventsResult, ClusterEventsQuery, ClusterEventsResult, ReelEvent, ReelEventsQuery, ReelEventsResult } from "./timeline.js";
12
+ export type { StreamMethod, PanTiltZoomCommand, PanTiltZoomCapabilities, CameraAccessorySwitchKind, CameraStatusEntry, CamerasStatusResult } from "./camera.js";
13
+ export type { StreamSourceEntry, NvrCamera, CameraAccessory, StreamInfo, NormalizedBoundingBox, DetectionData, EventSnapshotData, NvrEvent, RecordingSegment, MotionBucket, LiveDetection, LiveMotionData, LiveDetectionData, LiveAudioData, LiveMotionEvent, LiveDetectionEvent, LiveAudioEvent, LiveGenericEvent, LiveReviewEvent, LiveEvent, LiveEventType, VideoClipsQuery, NvrVideoClip, VideoClipsResult, VideoClipUrlResult, CameraDayData, CameraStatus, EventsQuery, MotionQuery, RecordingsQuery, NvrConfig, ProviderConfigs } from "./nvr.js";