| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378 |
- export declare enum OrgStatus {
- ACTIVE = "active",
- SUSPENDED = "suspended",
- TRIAL = "trial"
- }
- export declare enum ProjectStatus {
- PLANNING = "planning",
- ACTIVE = "active",
- PAUSED = "paused",
- COMPLETED = "completed",
- ARCHIVED = "archived"
- }
- export declare enum DeviceStatus {
- OFFLINE = "offline",
- ONLINE = "online",
- CAPTURING = "capturing",
- UPLOADING = "uploading",
- DEGRADED = "degraded",
- UPDATING = "updating",
- ERROR = "error"
- }
- export declare enum DeviceCommandType {
- CAPTURE_NOW = "capture_now",
- REBOOT = "reboot",
- SYNC_CONFIG = "sync_config",
- UPDATE_FIRMWARE = "update_firmware",
- TRIGGER_UPLOAD = "trigger_upload"
- }
- export declare enum CaptureStatus {
- PENDING = "pending",
- UPLOADED = "uploaded",
- PROCESSING = "processing",
- READY = "ready",
- FAILED = "failed"
- }
- export declare enum VideoStatus {
- PENDING = "pending",
- PROCESSING = "processing",
- READY = "ready",
- FAILED = "failed"
- }
- export declare enum AlertSeverity {
- INFO = "info",
- WARNING = "warning",
- ERROR = "error",
- CRITICAL = "critical"
- }
- export declare enum AlertType {
- DEVICE_OFFLINE = "device_offline",
- DEVICE_ERROR = "device_error",
- STORAGE_FULL = "storage_full",
- UPLOAD_FAILED = "upload_failed",
- CAPTURE_MISSED = "capture_missed",
- VIDEO_FAILED = "video_failed",
- FIRMWARE_UPDATE_AVAILABLE = "firmware_update_available"
- }
- export declare enum UserRole {
- SUPER_ADMIN = "super_admin",
- ORG_ADMIN = "org_admin",
- PROJECT_MANAGER = "project_manager",
- VIEWER = "viewer"
- }
- export declare enum CommandResultStatus {
- PENDING = "pending",
- DELIVERED = "delivered",
- ACKNOWLEDGED = "acknowledged",
- SUCCESS = "success",
- FAILED = "failed",
- TIMEOUT = "timeout"
- }
- export interface Organization {
- id: string;
- name: string;
- status: OrgStatus;
- planTier: string;
- createdAt: Date;
- updatedAt: Date;
- }
- export interface User {
- id: string;
- email: string;
- name: string;
- avatarUrl: string | null;
- provider: 'google' | 'email' | 'api_key';
- emailVerified: boolean;
- createdAt: Date;
- updatedAt: Date;
- }
- export interface Membership {
- userId: string;
- orgId: string;
- role: UserRole;
- invitedBy: string | null;
- joinedAt: Date;
- }
- export interface OrgMember extends User {
- role: UserRole;
- joinedAt: Date;
- }
- export interface AuthTokens {
- accessToken: string;
- refreshToken: string;
- expiresIn: number;
- }
- export interface AuthProvider {
- google?: {
- accessToken: string;
- refreshToken: string;
- expiresAt: number;
- };
- }
- export interface Project {
- id: string;
- orgId: string;
- name: string;
- description: string | null;
- timezone: string;
- startDate: Date | null;
- endDate: Date | null;
- status: ProjectStatus;
- captureInterval: number;
- resolution: string;
- createdAt: Date;
- updatedAt: Date;
- }
- export interface ProjectCreateInput {
- name: string;
- description?: string;
- timezone?: string;
- startDate?: string;
- endDate?: string;
- captureInterval?: number;
- resolution?: string;
- }
- export interface ProjectUpdateInput extends Partial<ProjectCreateInput> {
- status?: ProjectStatus;
- }
- export interface Device {
- id: string;
- projectId: string;
- orgId: string;
- serialNo: string;
- name: string;
- firmwareVersion: string | null;
- lastSeenAt: Date | null;
- status: DeviceStatus;
- config: DeviceConfig;
- createdAt: Date;
- updatedAt: Date;
- }
- export interface DeviceConfig {
- captureIntervalMinutes: number;
- resolution: string;
- quality: number;
- uploadOnWifiOnly: boolean;
- nightModeEnabled: boolean;
- nightModeStart: string;
- nightModeEnd: string;
- maxStorageGb: number;
- heartbeatIntervalSeconds: number;
- timezone: string;
- }
- export interface DeviceRegistrationInput {
- claimCode: string;
- serialNo: string;
- name: string;
- projectId: string;
- }
- export interface DeviceHeartbeatInput {
- deviceId: string;
- apiKey: string;
- status: DeviceStatus;
- tempC: number | null;
- batteryPct: number | null;
- storageFreeGb: number;
- capturesToday: number;
- lastCaptureAt: string | null;
- firmwareVersion: string;
- networkStatus: 'online' | 'offline' | 'degraded';
- }
- export interface DeviceCommandInput {
- deviceId: string;
- commandType: DeviceCommandType;
- payload?: Record<string, unknown>;
- scheduledAt?: string;
- }
- export interface Capture {
- id: string;
- projectId: string;
- deviceId: string;
- capturedAt: Date;
- uploadedAt: Date | null;
- fileKey: string | null;
- thumbnailKey: string | null;
- checksum: string | null;
- resolution: string;
- fileSizeBytes: number | null;
- exposureMs: number | null;
- iso: number | null;
- aperture: string | null;
- gpsLat: number | null;
- gpsLng: number | null;
- status: CaptureStatus;
- metadata: Record<string, unknown>;
- createdAt: Date;
- }
- export interface CaptureUploadInitResponse {
- captureId: string;
- uploadUrl: string;
- uploadMethod: 'PUT';
- uploadHeaders: Record<string, string>;
- expiresAt: string;
- }
- export interface CaptureCompleteInput {
- captureId: string;
- checksum: string;
- fileSizeBytes: number;
- metadata?: {
- exposureMs?: number;
- iso?: number;
- aperture?: string;
- gpsLat?: number;
- gpsLng?: number;
- };
- }
- export interface Video {
- id: string;
- projectId: string;
- periodStart: Date;
- periodEnd: Date;
- fps: number;
- resolution: string;
- fileKey: string | null;
- thumbnailKey: string | null;
- durationSec: number | null;
- status: VideoStatus;
- generatedAt: Date | null;
- fileSizeBytes: number | null;
- createdAt: Date;
- }
- export interface VideoGenerateInput {
- projectId: string;
- periodStart: string;
- periodEnd: string;
- fps?: number;
- resolution?: string;
- }
- export interface Alert {
- id: string;
- orgId: string;
- projectId: string | null;
- deviceId: string | null;
- type: AlertType;
- severity: AlertSeverity;
- message: string;
- data: Record<string, unknown>;
- state: 'open' | 'acknowledged' | 'resolved';
- openedAt: Date;
- acknowledgedAt: Date | null;
- acknowledgedBy: string | null;
- resolvedAt: Date | null;
- }
- export interface AlertRule {
- id: string;
- orgId: string;
- name: string;
- type: AlertType;
- condition: AlertCondition;
- cooldownMinutes: number;
- enabled: boolean;
- notifyEmail: boolean;
- notifySms: boolean;
- webhookUrl: string | null;
- }
- export interface AlertCondition {
- metric: string;
- operator: 'gt' | 'lt' | 'eq' | 'gte' | 'lte';
- value: number;
- windowMinutes?: number;
- }
- export interface Command {
- id: string;
- deviceId: string;
- commandType: DeviceCommandType;
- payload: Record<string, unknown> | null;
- queuedAt: Date;
- deliveredAt: Date | null;
- acknowledgedAt: Date | null;
- resultStatus: CommandResultStatus;
- resultData: Record<string, unknown> | null;
- }
- export interface ProjectAnalytics {
- projectId: string;
- totalCaptures: number;
- totalStorageBytes: number;
- avgCapturesPerDay: number;
- captureSuccessRate: number;
- uploadSuccessRate: number;
- activeDevices: number;
- offlineDevices: number;
- alertsOpen: number;
- periodStart: string;
- periodEnd: string;
- }
- export interface DeviceAnalytics {
- deviceId: string;
- totalCaptures: number;
- capturesToday: number;
- capturesThisWeek: number;
- avgUptimePercent: number;
- lastSeenAt: string | null;
- storageUsedGb: number;
- uploadQueueDepth: number;
- }
- export type WebSocketEvent = {
- event: 'device.status.changed';
- data: {
- deviceId: string;
- status: DeviceStatus;
- previousStatus: DeviceStatus;
- };
- } | {
- event: 'device.heartbeat';
- data: {
- deviceId: string;
- status: DeviceStatus;
- storageFreeGb: number;
- };
- } | {
- event: 'capture.upload.completed';
- data: {
- captureId: string;
- projectId: string;
- deviceId: string;
- };
- } | {
- event: 'video.generation.completed';
- data: {
- videoId: string;
- projectId: string;
- status: VideoStatus;
- };
- } | {
- event: 'alert.opened';
- data: {
- alertId: string;
- type: AlertType;
- severity: AlertSeverity;
- };
- } | {
- event: 'alert.resolved';
- data: {
- alertId: string;
- };
- };
- export interface PaginationInput {
- page?: number;
- limit?: number;
- cursor?: string;
- }
- export interface PaginatedResult<T> {
- data: T[];
- total: number;
- page: number;
- limit: number;
- hasNextPage: boolean;
- nextCursor: string | null;
- }
- export interface ApiResponse<T> {
- success: boolean;
- data?: T;
- error?: {
- code: string;
- message: string;
- details?: Record<string, unknown>;
- };
- }
- //# sourceMappingURL=index.d.ts.map
|