@viasoftbr/shared-ui 0.0.1 → 0.0.3

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.
Files changed (96) hide show
  1. package/README.md +89 -106
  2. package/dist/components/RemoteModule.d.ts +8 -0
  3. package/dist/components/display/Accordion.d.ts +8 -0
  4. package/dist/components/display/Section.d.ts +19 -0
  5. package/dist/components/display/Skeleton.d.ts +21 -0
  6. package/dist/components/display/index.d.ts +4 -0
  7. package/dist/components/encoder/DvB.d.ts +53 -0
  8. package/dist/components/encoder/Livecast.d.ts +37 -0
  9. package/dist/components/encoder/ViewLog.d.ts +5 -0
  10. package/dist/components/encoder/index.d.ts +4 -0
  11. package/dist/components/general/Copy2Clipboard.d.ts +4 -0
  12. package/dist/components/general/GridSelectionModal.d.ts +24 -0
  13. package/dist/components/general/Modal.d.ts +17 -0
  14. package/dist/components/general/Validation.d.ts +6 -0
  15. package/dist/components/general/index.d.ts +5 -0
  16. package/dist/components/groups/AudioGroup.d.ts +26 -0
  17. package/dist/components/groups/FilterGroup.d.ts +3 -0
  18. package/dist/components/groups/Middleware/Auth.d.ts +14 -0
  19. package/dist/components/groups/Middleware/Channels.d.ts +26 -0
  20. package/dist/components/groups/Middleware/MOS.d.ts +24 -0
  21. package/dist/components/groups/Middleware/Service.d.ts +16 -0
  22. package/dist/components/groups/Middleware/index.d.ts +5 -0
  23. package/dist/components/groups/PreviewGroup.d.ts +3 -0
  24. package/dist/components/groups/ProtocolGroup.d.ts +10 -0
  25. package/dist/components/groups/VideoGroup.d.ts +3 -0
  26. package/dist/components/groups/index.d.ts +7 -0
  27. package/dist/components/index.d.ts +11 -0
  28. package/dist/components/input/CheckboxField.d.ts +9 -0
  29. package/dist/components/input/ColorField.d.ts +9 -0
  30. package/dist/components/input/DatePicker.d.ts +12 -0
  31. package/dist/components/input/EditInPlaceField.d.ts +7 -0
  32. package/dist/components/input/InputField.d.ts +15 -0
  33. package/dist/components/input/Protocol.d.ts +10 -0
  34. package/dist/components/input/RangeField.d.ts +13 -0
  35. package/dist/components/input/SelectField.d.ts +13 -0
  36. package/dist/components/input/SliderField.d.ts +15 -0
  37. package/dist/components/input/SwitchField.d.ts +11 -0
  38. package/dist/components/input/index.d.ts +11 -0
  39. package/dist/components/main/Footer.d.ts +2 -0
  40. package/dist/components/main/Header.d.ts +7 -0
  41. package/dist/components/main/PageHeader.d.ts +14 -0
  42. package/dist/components/main/SaveDiscard.d.ts +13 -0
  43. package/dist/components/main/Sidebar.d.ts +10 -0
  44. package/dist/components/main/index.d.ts +6 -0
  45. package/dist/components/network/AddNetwork.d.ts +6 -0
  46. package/dist/components/network/InterfacesTable.d.ts +19 -0
  47. package/dist/components/network/InterfacesTimeseries.d.ts +21 -0
  48. package/dist/components/network/index.d.ts +4 -0
  49. package/dist/components/network/validators.d.ts +7 -0
  50. package/dist/components/system/RequireAuth.d.ts +8 -0
  51. package/dist/components/system/Wizard.d.ts +6 -0
  52. package/dist/components/system/index.d.ts +3 -0
  53. package/dist/components/xcoder/Fflog.d.ts +5 -0
  54. package/dist/components/xcoder/LiveLog.d.ts +5 -0
  55. package/dist/components/xcoder/Metrics.d.ts +8 -0
  56. package/dist/components/xcoder/Panel.d.ts +6 -0
  57. package/dist/components/xcoder/Preview.d.ts +11 -0
  58. package/dist/components/xcoder/StreamControl.d.ts +5 -0
  59. package/dist/components/xcoder/VUMeter.d.ts +8 -0
  60. package/dist/components/xcoder/VideoPlayer.d.ts +13 -0
  61. package/dist/components/xcoder/index.d.ts +8 -0
  62. package/dist/components.js +182 -118
  63. package/dist/context/AuthContext.d.ts +17 -0
  64. package/dist/context/ThemeContext.d.ts +11 -0
  65. package/dist/context/index.d.ts +3 -0
  66. package/dist/context.js +25 -9
  67. package/dist/hooks/index.d.ts +3 -0
  68. package/dist/hooks/useApi.d.ts +1 -0
  69. package/dist/hooks/useAvailableSubservices.d.ts +13 -0
  70. package/dist/hooks/useSettings.d.ts +45 -0
  71. package/dist/hooks.js +25 -9
  72. package/dist/i18n.d.ts +2 -0
  73. package/dist/index.d.ts +6 -0
  74. package/dist/index.js +55895 -0
  75. package/dist/package.json +111 -0
  76. package/dist/services/api.d.ts +22 -0
  77. package/dist/services/auth.d.ts +15 -0
  78. package/dist/services/discovery.d.ts +12 -0
  79. package/dist/services/hostConfig.d.ts +20 -0
  80. package/dist/services/index.d.ts +9 -0
  81. package/dist/services/loadRemoteModule.d.ts +9 -0
  82. package/dist/services/metadataLoader.d.ts +9 -0
  83. package/dist/services/registry.d.ts +42 -0
  84. package/dist/services/users.d.ts +18 -0
  85. package/dist/services/wizard.d.ts +3 -0
  86. package/dist/services.js +61 -28
  87. package/dist/types/alarm.d.ts +21 -0
  88. package/dist/types/auth.d.ts +18 -0
  89. package/dist/types/group.d.ts +32 -0
  90. package/dist/types/index.d.ts +6 -0
  91. package/dist/types/module.d.ts +13 -0
  92. package/dist/types/plugin.types.d.ts +30 -0
  93. package/dist/types/protocol.d.ts +12 -0
  94. package/dist/types/websocket.d.ts +27 -0
  95. package/dist/types/wizard.d.ts +12 -0
  96. package/package.json +35 -4
@@ -0,0 +1,111 @@
1
+ {
2
+ "name": "@viasoftbr/shared-ui",
3
+ "version": "0.0.3",
4
+ "description": "Shared frontend utilities, components and i18n for Viasoft plugins and micro-frontends",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ },
13
+ "./index": {
14
+ "import": "./dist/index.js",
15
+ "types": "./dist/index.d.ts"
16
+ },
17
+ "./context": {
18
+ "import": "./dist/context.js",
19
+ "types": "./dist/context/index.d.ts"
20
+ },
21
+ "./components": {
22
+ "import": "./dist/components.js",
23
+ "types": "./dist/components/index.d.ts"
24
+ },
25
+ "./services": {
26
+ "import": "./dist/services.js",
27
+ "types": "./dist/services/index.d.ts"
28
+ },
29
+ "./types": {
30
+ "import": "./dist/types.js",
31
+ "types": "./dist/types/index.d.ts"
32
+ },
33
+ "./i18n": {
34
+ "import": "./dist/i18n.js",
35
+ "types": "./dist/i18n.d.ts"
36
+ },
37
+ "./jsmpeg": {
38
+ "default": "./dist/jsmpeg.vu.min.js"
39
+ },
40
+ "./locales/*": {
41
+ "default": "./dist/locales/*"
42
+ }
43
+ },
44
+ "scripts": {
45
+ "build": "node scripts/build.js",
46
+ "dev": "node scripts/build.js --watch",
47
+ "typecheck": "tsc --noEmit"
48
+ },
49
+ "peerDependencies": {
50
+ "react": "^19.0.0"
51
+ },
52
+ "devDependencies": {
53
+ "@types/react": "^19.2.13",
54
+ "esbuild": "^0.20.0",
55
+ "typescript": "^5.0.0"
56
+ },
57
+ "files": [
58
+ "dist"
59
+ ],
60
+ "overrides": {
61
+ "use-sync-external-store": "1.6.1"
62
+ },
63
+ "resolutions": {
64
+ "use-sync-external-store": "1.6.1"
65
+ },
66
+ "pnpm": {
67
+ "overrides": {
68
+ "use-sync-external-store": "1.6.1"
69
+ }
70
+ },
71
+ "keywords": [
72
+ "viasoft",
73
+ "shared",
74
+ "utils",
75
+ "components",
76
+ "i18n",
77
+ "microfrontend"
78
+ ],
79
+ "author": "Viasoft",
80
+ "license": "MIT",
81
+ "publishConfig": {
82
+ "access": "public"
83
+ },
84
+ "dependencies": {
85
+ "@headlessui/react": "^2.2.9",
86
+ "@reduxjs/toolkit": "^2.10.1",
87
+ "@tanstack/react-query": "^5.90.10",
88
+ "@types/react-dom": "^19.2.3",
89
+ "@viasoftbr/shared-utils": "^0.0.1",
90
+ "axios": "^1.13.2",
91
+ "i18next": "^25.7.3",
92
+ "json-server": "1.0.0-beta.3",
93
+ "lucide-react": "^0.460.0",
94
+ "react": "^19.2.4",
95
+ "react-dom": "^19.2.4",
96
+ "react-i18next": "^16.5.0",
97
+ "react-redux": "^9.2.0",
98
+ "react-router-dom": "^6.20.1",
99
+ "react-tooltip": "^5.30.0",
100
+ "redux-batch-middleware": "^0.2.0",
101
+ "tailwind-scrollbar": "^4.0.2"
102
+ },
103
+ "repository": {
104
+ "type": "git",
105
+ "url": "git+https://github.com/viasoftbr/shared-ui.git"
106
+ },
107
+ "bugs": {
108
+ "url": "https://github.com/viasoftbr/shared-ui/issues"
109
+ },
110
+ "homepage": "https://github.com/viasoftbr/shared-ui#readme"
111
+ }
@@ -0,0 +1,22 @@
1
+ import { ProtocolSettings } from '../types/protocol';
2
+ export declare const api: import("axios").AxiosInstance;
3
+ export declare const authApi: import("axios").AxiosInstance;
4
+ export declare function getAccessToken(): string | null;
5
+ export declare function setAccessToken(token: string | null): void;
6
+ export declare function getRefreshToken(): string | null;
7
+ export declare function setRefreshToken(token: string | null): void;
8
+ export declare function clearTokens(): void;
9
+ export declare const fetchApi: {
10
+ getJson: <T>(path: string, params?: Record<string, any>, headers?: Record<string, string>) => Promise<T>;
11
+ getText: (path: string, params?: Record<string, any>, headers?: Record<string, string>) => Promise<string>;
12
+ getVoid: (path: string, params?: Record<string, any>, headers?: Record<string, string>) => Promise<void>;
13
+ postJson: <T>(path: string, payload?: any, headers?: Record<string, string>) => Promise<T>;
14
+ patchJson: <T>(path: string, payload?: any, headers?: Record<string, string>) => Promise<T>;
15
+ putJson: <T>(path: string, payload?: any, headers?: Record<string, string>) => Promise<T>;
16
+ deleteJson: <T>(path: string, headers?: Record<string, string>) => Promise<T>;
17
+ deleteVoid: (path: string, headers?: Record<string, string>) => Promise<void>;
18
+ };
19
+ export declare function buildWsUrl(path?: string): string;
20
+ export declare function encodeFfurl(settings: ProtocolSettings): Promise<string>;
21
+ export declare function decodeFfurl(ffurl: string): Promise<ProtocolSettings>;
22
+ export declare function subscribeToWebsocket(url: string, onMessage: (data: any) => void): () => void;
@@ -0,0 +1,15 @@
1
+ import { User } from '../types';
2
+ interface LoginResponse {
3
+ accessToken: string;
4
+ refreshToken: string;
5
+ user: User;
6
+ }
7
+ export declare const authService: {
8
+ login: (username: string, password: string) => Promise<LoginResponse>;
9
+ refresh: () => Promise<{
10
+ accessToken: string;
11
+ refreshToken: string;
12
+ }>;
13
+ logout: () => Promise<void>;
14
+ };
15
+ export {};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Discovery helpers for service availability.
3
+ * Calls the backend endpoint that lists available subservices.
4
+ */
5
+ export declare const discoveryService: {
6
+ /**
7
+ * GET /services/available (authenticated)
8
+ * Returns whatever the backend provides about available services/subservices.
9
+ */
10
+ available: () => Promise<any>;
11
+ };
12
+ export default discoveryService;
@@ -0,0 +1,20 @@
1
+ export interface HostStaticRoute {
2
+ path: string;
3
+ pageId?: string;
4
+ public?: boolean;
5
+ level?: string;
6
+ }
7
+ export interface HostConfig {
8
+ version?: string;
9
+ pluginsManifestUrl?: string;
10
+ defaultRoute?: string;
11
+ staticRoutes?: HostStaticRoute[];
12
+ features?: Record<string, any>;
13
+ }
14
+ declare class HostConfigLoader {
15
+ private cache?;
16
+ loadHostConfig(url?: string): Promise<HostConfig>;
17
+ clearCache(): void;
18
+ }
19
+ export declare const hostConfigLoader: HostConfigLoader;
20
+ export {};
@@ -0,0 +1,9 @@
1
+ export * from './api';
2
+ export * from './auth';
3
+ export * from './loadRemoteModule';
4
+ export * from './metadataLoader';
5
+ export * from './registry';
6
+ export * from './hostConfig';
7
+ export * from './users';
8
+ export * from './wizard';
9
+ export * from './discovery';
@@ -0,0 +1,9 @@
1
+ import type { ComponentType } from 'react';
2
+ declare global {
3
+ var __federation_shared__: Record<string, Record<string, unknown>>;
4
+ }
5
+ export declare function loadRemoteModule(config: {
6
+ scope: string;
7
+ url: string;
8
+ module: string;
9
+ }): Promise<ComponentType>;
@@ -0,0 +1,9 @@
1
+ import type { PageMetadata } from "../types/plugin.types";
2
+ export declare class MetadataLoader {
3
+ private metadataCache;
4
+ loadMetadata(metadataUrl: string): Promise<PageMetadata[]>;
5
+ loadFromDirectory(directoryUrl: string): Promise<PageMetadata[]>;
6
+ clearCache(): void;
7
+ getCachedMetadata(metadataUrl: string): PageMetadata[] | undefined;
8
+ }
9
+ export declare const metadataLoader: MetadataLoader;
@@ -0,0 +1,42 @@
1
+ import type React from 'react';
2
+ export type RouteLevel = 'readonly' | 'operator' | 'admin' | 'public';
3
+ export interface RouteConfig {
4
+ path: string;
5
+ componentName?: string;
6
+ pageId?: string;
7
+ title?: string;
8
+ level?: RouteLevel;
9
+ }
10
+ export interface PageConfig {
11
+ id: string;
12
+ name: string;
13
+ path: string;
14
+ component: React.ComponentType<any>;
15
+ icon?: React.ComponentType<any> | React.ReactNode;
16
+ }
17
+ export interface PluginRegistry {
18
+ registerComponent(name: string, component: React.ComponentType): void;
19
+ getComponent(name: string): React.ComponentType | undefined;
20
+ registerService<T = any>(name: string, service: T): void;
21
+ getService<T = any>(name: string): T | undefined;
22
+ registerRoute(route: RouteConfig): void;
23
+ getRoutes(): RouteConfig[];
24
+ registerPage(page: PageConfig): void;
25
+ getPages(): PageConfig[];
26
+ }
27
+ declare class PluginRegistryImpl implements PluginRegistry {
28
+ private components;
29
+ private services;
30
+ private routes;
31
+ private pages;
32
+ registerComponent(name: string, component: React.ComponentType): void;
33
+ getComponent(name: string): React.ComponentType<{}> | undefined;
34
+ registerService<T = any>(name: string, service: T): void;
35
+ getService<T = any>(name: string): T | undefined;
36
+ registerRoute(route: RouteConfig): void;
37
+ getRoutes(): RouteConfig[];
38
+ registerPage(page: PageConfig): void;
39
+ getPages(): PageConfig[];
40
+ }
41
+ export declare const registry: PluginRegistryImpl;
42
+ export {};
@@ -0,0 +1,18 @@
1
+ import { Role, User } from '../types';
2
+ export declare const userService: {
3
+ list: () => Promise<User[]>;
4
+ getById: (id: string) => Promise<User>;
5
+ create: (payload: {
6
+ name?: string;
7
+ username: string;
8
+ password: string;
9
+ role?: Role;
10
+ }) => Promise<User>;
11
+ update: (id: string, payload: Partial<{
12
+ name: string;
13
+ username: string;
14
+ password: string;
15
+ role: Role;
16
+ }>) => Promise<User>;
17
+ delete: (id: string) => Promise<void>;
18
+ };
@@ -0,0 +1,3 @@
1
+ export declare const getDeviceInfo: (basePath?: string) => Promise<any>;
2
+ export declare const saveConfig: (payload: any, basePath?: string) => Promise<any>;
3
+ export declare const isFirstRun: (basePath?: string) => Promise<boolean>;
package/dist/services.js CHANGED
@@ -2640,19 +2640,36 @@ var {
2640
2640
  } = axios_default;
2641
2641
 
2642
2642
  // src/services/api.ts
2643
- var getApiBaseUrl = () => {
2644
- if (typeof import.meta !== "undefined" && import.meta.env?.VITE_API_BASE_URL) {
2645
- return import.meta.env.VITE_API_BASE_URL;
2643
+ var normalizeOrigin = (raw) => {
2644
+ if (!raw)
2645
+ return "";
2646
+ if (/^https?:\/\//i.test(raw) || /^wss?:\/\//i.test(raw))
2647
+ return raw.replace(/\/$/, "");
2648
+ return `http://${raw.replace(/\/$/, "")}`;
2649
+ };
2650
+ var getApiOrigin = () => {
2651
+ try {
2652
+ if (typeof import.meta !== "undefined" && import.meta.env?.VITE_API_BASE_URL) {
2653
+ return normalizeOrigin(import.meta.env.VITE_API_BASE_URL);
2654
+ }
2655
+ } catch (e) {
2646
2656
  }
2647
- return "192.168.100.9:3000";
2657
+ if (typeof window !== "undefined") {
2658
+ const win = window;
2659
+ if (win.__VIASOFT_API_BASE_URL)
2660
+ return normalizeOrigin(win.__VIASOFT_API_BASE_URL);
2661
+ if (window.location && window.location.origin)
2662
+ return window.location.origin.replace(/\/$/, "");
2663
+ }
2664
+ return "http://localhost:3000";
2648
2665
  };
2649
- var serverUrl = getApiBaseUrl();
2666
+ var apiOrigin = getApiOrigin();
2650
2667
  var api = axios_default.create({
2651
- baseURL: `http://${serverUrl}`,
2668
+ baseURL: apiOrigin,
2652
2669
  timeout: 1e4
2653
2670
  });
2654
2671
  var authApi = axios_default.create({
2655
- baseURL: `http://${serverUrl}`,
2672
+ baseURL: apiOrigin,
2656
2673
  timeout: 1e4
2657
2674
  });
2658
2675
  function getAccessToken() {
@@ -2816,18 +2833,18 @@ var fetchApi = {
2816
2833
  }
2817
2834
  }
2818
2835
  };
2819
- var serverOrigin = `http://${serverUrl}`;
2820
2836
  function buildWsUrl(path = "/") {
2821
2837
  try {
2822
- const origin2 = new URL(serverOrigin);
2838
+ const origin2 = new URL(apiOrigin);
2823
2839
  origin2.protocol = origin2.protocol === "https:" ? "wss:" : "ws:";
2824
2840
  if (!path.startsWith("/"))
2825
2841
  path = "/" + path;
2826
2842
  origin2.pathname = path;
2827
2843
  return origin2.toString();
2828
2844
  } catch (e) {
2829
- const proto = serverOrigin.startsWith("https") ? "wss" : "ws";
2830
- return `${proto}://${serverUrl}${path.startsWith("/") ? path : "/" + path}`;
2845
+ const proto = apiOrigin.startsWith("https") ? "wss" : "ws";
2846
+ const host = apiOrigin.replace(/^https?:\/\//, "").replace(/\/$/, "");
2847
+ return `${proto}://${host}${path.startsWith("/") ? path : "/" + path}`;
2831
2848
  }
2832
2849
  }
2833
2850
  async function encodeFfurl(settings) {
@@ -2893,7 +2910,6 @@ var authService = {
2893
2910
  // src/services/loadRemoteModule.ts
2894
2911
  import * as React from "react";
2895
2912
  import * as ReactDOM from "react-dom";
2896
- var loadedContainers = /* @__PURE__ */ new Map();
2897
2913
  var sharedScopeInitialized = false;
2898
2914
  function getSharedScope() {
2899
2915
  if (!globalThis.__federation_shared__) {
@@ -2920,28 +2936,46 @@ function getSharedScope() {
2920
2936
  }
2921
2937
  return globalThis.__federation_shared__;
2922
2938
  }
2939
+ var loadedContainers = /* @__PURE__ */ new Map();
2940
+ var initializedContainers = /* @__PURE__ */ new Set();
2923
2941
  async function loadContainer(url) {
2924
2942
  if (loadedContainers.has(url)) {
2925
- const cached = loadedContainers.get(url);
2926
- if (cached)
2927
- return cached;
2943
+ return loadedContainers.get(url);
2928
2944
  }
2929
- const promise = import(
2930
- /* @vite-ignore */
2931
- url
2932
- );
2933
- loadedContainers.set(url, promise);
2934
- return promise;
2945
+ const loadPromise = (async () => {
2946
+ try {
2947
+ const container = await import(
2948
+ /* @vite-ignore */
2949
+ url
2950
+ );
2951
+ if (container.init && !initializedContainers.has(url)) {
2952
+ await container.init(getSharedScope());
2953
+ initializedContainers.add(url);
2954
+ }
2955
+ return container;
2956
+ } catch (error) {
2957
+ loadedContainers.delete(url);
2958
+ initializedContainers.delete(url);
2959
+ throw error;
2960
+ }
2961
+ })();
2962
+ loadedContainers.set(url, loadPromise);
2963
+ return loadPromise;
2935
2964
  }
2936
2965
  async function loadRemoteModule(config) {
2937
2966
  const container = await loadContainer(config.url);
2938
- if (!container || typeof container.init !== "function") {
2939
- throw new Error(`Container inv\xE1lido: ${config.scope}`);
2967
+ if (!container || typeof container.get !== "function") {
2968
+ throw new Error(`Container inv\xE1lido ou sem m\xE9todo get: ${config.scope}`);
2969
+ }
2970
+ if (typeof container.dynamicLoadingCss === "function") {
2971
+ try {
2972
+ await container.dynamicLoadingCss([]);
2973
+ } catch (err) {
2974
+ console.warn(`Aviso: Falha ao carregar CSS global do remote ${config.scope}`, err);
2975
+ }
2940
2976
  }
2941
- const shareScope = getSharedScope();
2942
- container.init(shareScope);
2943
2977
  const factory2 = await container.get(config.module);
2944
- const moduleExports = factory2();
2978
+ const moduleExports = await factory2();
2945
2979
  if (moduleExports && typeof moduleExports === "object" && "default" in moduleExports) {
2946
2980
  return moduleExports.default;
2947
2981
  }
@@ -2975,7 +3009,7 @@ var MetadataLoader = class {
2975
3009
  );
2976
3010
  }
2977
3011
  metadata.forEach((page, index) => {
2978
- if (!page.id || !page.name || !page.path || !page.bundleUrl) {
3012
+ if (!page.id || !page.name || !page.path || !page.url) {
2979
3013
  throw new Error(
2980
3014
  `Invalid page metadata at index ${index}: missing required fields`
2981
3015
  );
@@ -3202,7 +3236,6 @@ export {
3202
3236
  metadataLoader,
3203
3237
  registry,
3204
3238
  saveConfig,
3205
- serverOrigin,
3206
3239
  setAccessToken,
3207
3240
  setRefreshToken,
3208
3241
  subscribeToWebsocket,
@@ -0,0 +1,21 @@
1
+ export type AlarmType = "critical" | "warning";
2
+ export interface Alarm {
3
+ status: AlarmType;
4
+ code: string;
5
+ details: string;
6
+ alias: string;
7
+ enabled: boolean;
8
+ }
9
+ export interface GetAlarmsResponse {
10
+ alarms: Alarm[];
11
+ }
12
+ export type AlarmAction = "activate" | "deactivate";
13
+ export interface ManageAlarmRequest {
14
+ code: string;
15
+ action: AlarmAction;
16
+ }
17
+ export interface ManageAlarmResponse {
18
+ message: string;
19
+ code: string;
20
+ action: AlarmAction;
21
+ }
@@ -0,0 +1,18 @@
1
+ export declare enum Role {
2
+ Admin = "admin",
3
+ Operator = "operator",
4
+ SuperAdmin = "superadmin",
5
+ ReadOnly = "readonly"
6
+ }
7
+ export interface JwtPayload {
8
+ sub: string;
9
+ exp: number;
10
+ iat: number;
11
+ roles: Role[];
12
+ }
13
+ export interface User {
14
+ id: string;
15
+ username: string;
16
+ role: Role;
17
+ name?: string;
18
+ }
@@ -0,0 +1,32 @@
1
+ interface GroupProps {
2
+ expanded: boolean;
3
+ onToggle: (section: string) => void;
4
+ available?: string[];
5
+ children?: React.ReactNode;
6
+ title?: string;
7
+ loading?: boolean;
8
+ }
9
+ interface AudioProps {
10
+ audioSource: 'SDI' | 'USB';
11
+ audioCodec: 'aac' | 'he_aac' | 'he_aac_v2';
12
+ audioBitrate: string;
13
+ audioSampleRate: "24kHz" | "48kHz" | "96kHz" | "192kHz";
14
+ audioChannels: "stero" | "monol" | "monor";
15
+ }
16
+ interface FilterProps {
17
+ inputVideoFilter: string;
18
+ resizeVideo: string;
19
+ videoFps: string;
20
+ }
21
+ interface PreviewProps {
22
+ enablePreviewWeb: boolean;
23
+ enablePreviewLcd: string;
24
+ enablePreviewHdmi: string;
25
+ }
26
+ interface VideoProps {
27
+ videoConnection: string;
28
+ noLockedMode: 'black' | 'colorbar';
29
+ videoFormat: string;
30
+ videoCodec: 'mpeg2' | 'h264' | 'hevc' | 'hevc_qsv';
31
+ videoBitrate: string;
32
+ }
@@ -0,0 +1,6 @@
1
+ export * from './auth.ts';
2
+ export * from './module.ts';
3
+ export * from './plugin.types.ts';
4
+ export * from './protocol.ts';
5
+ export * from './websocket.ts';
6
+ export * from './wizard.ts';
@@ -0,0 +1,13 @@
1
+ export interface ModuleDefinition {
2
+ id: string;
3
+ name: string;
4
+ label: string;
5
+ icon: string;
6
+ group: string;
7
+ path: string;
8
+ url: string;
9
+ module: string;
10
+ }
11
+ export interface ModulesConfig {
12
+ modules: ModuleDefinition[];
13
+ }
@@ -0,0 +1,30 @@
1
+ import type React from "react";
2
+ export interface PageMetadata {
3
+ id: string;
4
+ name: string;
5
+ path: string;
6
+ url: string;
7
+ description?: string;
8
+ group?: string;
9
+ version?: string;
10
+ author?: string;
11
+ dependencies?: string[];
12
+ componentName?: string;
13
+ }
14
+ export interface DynamicPageComponent {
15
+ default: React.ComponentType<Record<string, unknown>>;
16
+ metadata?: Partial<PageMetadata>;
17
+ }
18
+ export interface PageRegistry {
19
+ [pageId: string]: {
20
+ metadata: PageMetadata;
21
+ component: React.ComponentType<Record<string, unknown>>;
22
+ loaded: boolean;
23
+ loadPromise?: Promise<DynamicPageComponent>;
24
+ };
25
+ }
26
+ export interface PluginLoader {
27
+ loadPlugin(metadata: PageMetadata): Promise<DynamicPageComponent>;
28
+ getLoadedPlugins(): PageRegistry;
29
+ unloadPlugin(pageId: string): void;
30
+ }
@@ -0,0 +1,12 @@
1
+ export interface ProtocolSettings {
2
+ protocol: string;
3
+ ip: string;
4
+ port?: string;
5
+ interface?: string;
6
+ mode?: string;
7
+ streamid?: string;
8
+ passphrase?: string;
9
+ hash?: string;
10
+ latency?: string;
11
+ ffurl?: string;
12
+ }
@@ -0,0 +1,27 @@
1
+ export interface XcoderService {
2
+ status: "idle" | "stoped" | "waiting_signal" | "running";
3
+ mode: "input" | "output";
4
+ sdiFormat: string;
5
+ log: string;
6
+ decklinkEvents: string;
7
+ name: string;
8
+ }
9
+ export interface SystemInfo {
10
+ uptime: number;
11
+ loadAverage: number[];
12
+ memoryTotal: number;
13
+ memoryFree: number;
14
+ memoryUsed: number;
15
+ swapTotal: number;
16
+ swapFree: number;
17
+ swapUsed: number;
18
+ dmesg: string;
19
+ cpuTemperature: number;
20
+ cpuClockSpeed: number;
21
+ }
22
+ export interface WebSocketData {
23
+ services: {
24
+ [key: string]: XcoderService;
25
+ };
26
+ system: SystemInfo;
27
+ }
@@ -0,0 +1,12 @@
1
+ export type PortRange = {
2
+ start: number;
3
+ end: number;
4
+ };
5
+ export type FinalData = {
6
+ step?: string;
7
+ deviceName?: string;
8
+ devicePassword?: string;
9
+ service1Enabled?: boolean;
10
+ portRange?: PortRange;
11
+ timestamp?: string;
12
+ };