All files / web/src/constants index.ts

100% Statements 24/24
100% Branches 0/0
100% Functions 0/0
100% Lines 24/24

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147                1x 1x                       1x 1x                         1x               1x       1x     1x 1x                               1x 1x                                     1x 1x                                             1x         1x         1x         1x         1x         1x         1x 1x 1x 1x 1x  
/**
 * RestFlow Constants Management System
 *
 * Unified export of all constants, providing a single import entry point
 * Usage: import { NODE_TYPE, API_ENDPOINTS, WORKFLOW_STATE } from '@/constants'
 */
 
// ===== API Related =====
export * from './api'
export {
  API_ENDPOINTS,
  API_PREFIX,
  type ApiEndpoints,
  type WorkflowEndpoints,
  type ExecutionEndpoints,
  type TriggerEndpoints,
  type AgentEndpoints,
  type SecretEndpoints
} from './api/endpoints'
 
// ===== Node Related =====
export * from './node'
export {
  NODE_TYPE,
  NODE_CATEGORY,
  TRIGGER_NODE_TYPES,
  NODE_TYPE_CATEGORY_MAP,
  NODE_TYPE_LABELS,
  NODE_TYPE_ICONS,
  NODE_TYPE_COLORS,
  type NodeTypeKey,
  type NodeCategoryKey,
  type NodeTypeValue,
  type NodeCategoryValue
} from './node/types'
export {
  MODEL_OPTIONS,
  MODEL_DISPLAY_NAMES,
  getModelDisplayName,
  getModelTagType,
  getModelsByProvider,
  type ModelOption
} from './node/models'
export {
  getNodeOutputSchema,
  hasNodeOutputSchema
} from '../utils/schemaGenerator'
export { NODE_OUTPUT_EXAMPLES } from './node/output-examples'
 
// ===== Workflow Related =====
export * from './workflow'
export {
  WORKFLOW_STATE,
  EXECUTION_MODE,
  NODE_EXECUTION_STATE,
  TASK_STATUS,
  WORKFLOW_STATE_TRANSITIONS,
  WORKFLOW_STATE_COLORS,
  NODE_STATE_COLORS,
  STATE_ICONS,
  type WorkflowState,
  type ExecutionMode,
  type NodeExecutionState,
  type TaskStatus
} from './workflow/states'
 
// ===== UI Related =====
export * from './ui/messages'
export {
  MESSAGES,
  SUCCESS_MESSAGES,
  ERROR_MESSAGES,
  VALIDATION_MESSAGES,
  CONFIRM_MESSAGES,
  LOADING_MESSAGES,
  HINT_MESSAGES,
  INFO_MESSAGES,
  type SuccessMessageKey,
  type ErrorMessageKey,
  type ValidationMessageKey,
  type ConfirmMessageKey,
  type LoadingMessageKey,
  type HintMessageKey,
  type InfoMessageKey
} from './ui/messages'
 
// ===== Time Related =====
export * from './common/time'
export {
  TIMING,
  API_TIMING,
  POLLING_TIMING,
  AUTO_SAVE_TIMING,
  INTERACTION_TIMING,
  ANIMATION_TIMING,
  NOTIFICATION_TIMING,
  TIME_UNITS,
  TIME_THRESHOLDS,
  RETRY_TIMING,
  CACHE_TIMING,
  delay,
  formatTimeDiff,
  type TimingKey,
  type ApiTimingKey,
  type PollingTimingKey
} from './common/time'
 
// ===== Common Constants =====
/**
 * Default page size
 */
export const DEFAULT_PAGE_SIZE = 20
 
/**
 * Maximum retry count
 */
export const MAX_RETRY_COUNT = 3
 
/**
 * Request timeout (milliseconds)
 */
export const REQUEST_TIMEOUT = 30000
 
/**
 * WebSocket reconnect delay (milliseconds)
 */
export const WS_RECONNECT_DELAY = 3000
 
/**
 * Node execution timeout (seconds)
 */
export const NODE_EXECUTION_TIMEOUT = 300
 
/**
 * Maximum file upload size (bytes)
 */
export const MAX_FILE_SIZE = 10 * 1024 * 1024 // 10MB
 
/**
 * Supported file types
 */
export const SUPPORTED_FILE_TYPES = {
  IMAGE: ['image/jpeg', 'image/png', 'image/gif', 'image/svg+xml'],
  DOCUMENT: ['application/pdf', 'text/plain', 'text/csv'],
  CODE: ['text/javascript', 'text/typescript', 'text/python', 'text/html', 'text/css'],
} as const