commit 301e179160e667b505b88e90c6a1021a607c89fd Author: Falknat Date: Sun Jan 11 15:01:35 2026 +0700 Инициализация проекта Загрузка проекта на GIT diff --git a/README.md b/README.md new file mode 100644 index 0000000..c618df1 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# Taskboard + +Kanban-доска для управления задачами команды. + +- 📋 Kanban-доска с колонками и карточками задач +- 👥 Страница команды с профилями участников +- 🏷️ Метки и департаменты для категоризации задач +- 📎 Прикрепление изображений к задачам + +## Технологии + +- Vue 3 +- PHP +- MySQL diff --git a/backend/app/class/database/class_Database.php b/backend/app/class/database/class_Database.php new file mode 100644 index 0000000..d8118fb --- /dev/null +++ b/backend/app/class/database/class_Database.php @@ -0,0 +1,40 @@ + 'mysql', + 'host' => DB_HOST, + 'database' => DB_NAME, + 'username' => DB_USER, + 'password' => DB_PASS, + 'port' => DB_PORT, + 'charset' => DB_CHARSET, + 'collation' => 'utf8mb4_unicode_ci', + 'error' => \PDO::ERRMODE_EXCEPTION + ]); + } catch (\PDOException $e) { + die('Ошибка подключения к БД: ' . $e->getMessage()); + exit; + } + } + return self::$db; + } +} diff --git a/backend/app/class/database/class_Medoo.php b/backend/app/class/database/class_Medoo.php new file mode 100644 index 0000000..a745e9f --- /dev/null +++ b/backend/app/class/database/class_Medoo.php @@ -0,0 +1,2311 @@ + 'mysql', + * 'database' => 'name', + * 'host' => 'localhost', + * 'username' => 'your_username', + * 'password' => 'your_password', + * + * // [optional] + * 'charset' => 'utf8mb4', + * 'port' => 3306, + * 'prefix' => 'PREFIX_' + * ]); + * ``` + * + * @param array $options Connection options + * @return Medoo + * @throws PDOException If the connection fails + * @link https://medoo.in/api/new + * @codeCoverageIgnore + */ + + public function __construct(array $options) + { + if (isset($options['prefix'])) { + $this->prefix = $options['prefix']; + } + + if (isset($options['testMode']) && $options['testMode'] == true) { + $this->testMode = true; + return; + } + + $options['type'] = $options['type'] ?? $options['database_type'] ?? null; + + if (!$options['type']) { + throw new InvalidArgumentException('Database type is required.'); + } + + if (!isset($options['pdo'])) { + $options['database'] = $options['database'] ?? $options['database_name']; + + if (!isset($options['socket'])) { + $options['host'] = $options['host'] ?? $options['server'] ?? false; + } + } + + $this->setupType($options['type']); + + if (isset($options['logging']) && is_bool($options['logging'])) { + $this->logging = $options['logging']; + } + + $commands = []; + + switch ($this->type) { + + case 'mysql': + // Make MySQL using standard quoted identifier. + $commands[] = 'SET SQL_MODE=ANSI_QUOTES'; + + break; + + case 'mssql': + // Keep MSSQL QUOTED_IDENTIFIER is ON for standard quoting. + $commands[] = 'SET QUOTED_IDENTIFIER ON'; + + // Make ANSI_NULLS is ON for NULL value. + $commands[] = 'SET ANSI_NULLS ON'; + + break; + } + + if (isset($options['pdo'])) { + if (!$options['pdo'] instanceof PDO) { + throw new InvalidArgumentException('Invalid PDO object supplied.'); + } + + $this->pdo = $options['pdo']; + + foreach ($commands as $value) { + $this->pdo->exec($value); + } + + return; + } + + if (isset($options['dsn'])) { + if (is_array($options['dsn']) && isset($options['dsn']['driver'])) { + $attr = $options['dsn']; + } else { + throw new InvalidArgumentException('Invalid DSN option supplied.'); + } + } else { + if (isset($options['port']) && is_numeric($options['port'])) { + $port = $options['port']; + } + + $isPort = isset($port); + + switch ($this->type) { + + case 'mysql': + $attr = [ + 'driver' => 'mysql', + 'dbname' => $options['database'] + ]; + + if (isset($options['socket'])) { + $attr['unix_socket'] = $options['socket']; + } else { + $attr['host'] = $options['host']; + + if ($isPort) { + $attr['port'] = $port; + } + } + + break; + + case 'pgsql': + $attr = [ + 'driver' => 'pgsql', + 'host' => $options['host'], + 'dbname' => $options['database'] + ]; + + if ($isPort) { + $attr['port'] = $port; + } + + break; + + case 'sybase': + $attr = [ + 'driver' => 'dblib', + 'host' => $options['host'], + 'dbname' => $options['database'] + ]; + + if ($isPort) { + $attr['port'] = $port; + } + + break; + + case 'oracle': + $attr = [ + 'driver' => 'oci', + 'dbname' => $options['host'] ? + '//' . $options['host'] . ($isPort ? ':' . $port : ':1521') . '/' . $options['database'] : + $options['database'] + ]; + + if (isset($options['charset'])) { + $attr['charset'] = $options['charset']; + } + + break; + + case 'mssql': + if (isset($options['driver']) && $options['driver'] === 'dblib') { + $attr = [ + 'driver' => 'dblib', + 'host' => $options['host'] . ($isPort ? ':' . $port : ''), + 'dbname' => $options['database'] + ]; + + if (isset($options['appname'])) { + $attr['appname'] = $options['appname']; + } + + if (isset($options['charset'])) { + $attr['charset'] = $options['charset']; + } + } else { + $attr = [ + 'driver' => 'sqlsrv', + 'Server' => $options['host'] . ($isPort ? ',' . $port : ''), + 'Database' => $options['database'] + ]; + + if (isset($options['appname'])) { + $attr['APP'] = $options['appname']; + } + + $config = [ + 'ApplicationIntent', + 'AttachDBFileName', + 'Authentication', + 'ColumnEncryption', + 'ConnectionPooling', + 'Encrypt', + 'Failover_Partner', + 'KeyStoreAuthentication', + 'KeyStorePrincipalId', + 'KeyStoreSecret', + 'LoginTimeout', + 'MultipleActiveResultSets', + 'MultiSubnetFailover', + 'Scrollable', + 'TraceFile', + 'TraceOn', + 'TransactionIsolation', + 'TransparentNetworkIPResolution', + 'TrustServerCertificate', + 'WSID', + ]; + + foreach ($config as $value) { + $keyname = strtolower(preg_replace(['/([a-z\d])([A-Z])/', '/([^_])([A-Z][a-z])/'], '$1_$2', $value)); + + if (isset($options[$keyname])) { + $attr[$value] = $options[$keyname]; + } + } + } + + break; + + case 'sqlite': + $attr = [ + 'driver' => 'sqlite', + $options['database'] + ]; + + break; + } + } + + if (!isset($attr)) { + throw new InvalidArgumentException('Incorrect connection options.'); + } + + $driver = $attr['driver']; + + if (!in_array($driver, PDO::getAvailableDrivers())) { + throw new InvalidArgumentException("Unsupported PDO driver: {$driver}."); + } + + unset($attr['driver']); + + $stack = []; + + foreach ($attr as $key => $value) { + $stack[] = is_int($key) ? $value : $key . '=' . $value; + } + + $dsn = $driver . ':' . implode(';', $stack); + + if ( + in_array($this->type, ['mysql', 'pgsql', 'sybase', 'mssql']) && + isset($options['charset']) + ) { + $commands[] = "SET NAMES '{$options['charset']}'" . ( + $this->type === 'mysql' && isset($options['collation']) ? + " COLLATE '{$options['collation']}'" : '' + ); + } + + $this->dsn = $dsn; + + try { + $this->pdo = new PDO( + $dsn, + $options['username'] ?? null, + $options['password'] ?? null, + $options['option'] ?? [] + ); + + if (isset($options['error'])) { + $this->pdo->setAttribute( + PDO::ATTR_ERRMODE, + in_array($options['error'], [ + PDO::ERRMODE_SILENT, + PDO::ERRMODE_WARNING, + PDO::ERRMODE_EXCEPTION + ]) ? + $options['error'] : + PDO::ERRMODE_SILENT + ); + } + + if (isset($options['command']) && is_array($options['command'])) { + $commands = array_merge($commands, $options['command']); + } + + foreach ($commands as $value) { + $this->pdo->exec($value); + } + } catch (PDOException $e) { + throw new PDOException($e->getMessage()); + } + } + + /** + * Setup the database type. + * + * @param string The database type string. + * @return void + */ + public function setupType(string $type) + { + $databaseType = strtolower($type); + + if ($databaseType === 'mariadb') { + $databaseType = 'mysql'; + } + + if ($databaseType === 'oracle') { + $this->tableAliasConnector = ' '; + } elseif ($databaseType === 'mysql') { + $this->quotePattern = '`$1`'; + } elseif ($databaseType === 'mssql') { + $this->quotePattern = '[$1]'; + } + + $this->type = $databaseType; + } + + /** + * Generate a new map key for the placeholder. + * + * @return string + */ + protected function mapKey(): string + { + return ':MeD' . $this->guid++ . '_mK'; + } + + /** + * Execute customized raw statement. + * + * @param string $statement The raw SQL statement. + * @param array $map The array of input parameters value for prepared statement. + * @return \PDOStatement|null + */ + public function query(string $statement, array $map = []): ?PDOStatement + { + $raw = $this->raw($statement, $map); + $statement = $this->buildRaw($raw, $map); + + return $this->exec($statement, $map); + } + + /** + * Execute the raw statement. + * + * @param string $statement The SQL statement. + * @param array $map The array of input parameters value for prepared statement. + * @codeCoverageIgnore + * @return \PDOStatement|null + */ + public function exec(string $statement, array $map = [], ?callable $callback = null): ?PDOStatement + { + $this->statement = null; + $this->errorInfo = null; + $this->error = null; + + if ($this->testMode) { + $this->queryString = $this->generate($statement, $map); + return null; + } + + if ($this->debugMode) { + if ($this->debugLogging) { + $this->debugLogs[] = $this->generate($statement, $map); + return null; + } + + echo $this->generate($statement, $map); + + $this->debugMode = false; + + return null; + } + + if ($this->logging) { + $this->logs[] = [$statement, $map]; + } else { + $this->logs = [[$statement, $map]]; + } + + $statement = $this->pdo->prepare($statement); + $errorInfo = $this->pdo->errorInfo(); + + if ($errorInfo[0] !== '00000') { + $this->errorInfo = $errorInfo; + $this->error = $errorInfo[2]; + + return null; + } + + foreach ($map as $key => $value) { + $statement->bindValue($key, $value[0], $value[1]); + } + + if (is_callable($callback)) { + $this->pdo->beginTransaction(); + $callback($statement); + $execute = $statement->execute(); + $this->pdo->commit(); + } else { + $execute = $statement->execute(); + } + + $errorInfo = $statement->errorInfo(); + + if ($errorInfo[0] !== '00000') { + $this->errorInfo = $errorInfo; + $this->error = $errorInfo[2]; + + return null; + } + + if ($execute) { + $this->statement = $statement; + } + + return $statement; + } + + /** + * Generate readable statement. + * + * @param string $statement + * @param array $map + * @codeCoverageIgnore + * @return string + */ + protected function generate(string $statement, array $map): string + { + $statement = preg_replace( + '/(?!\'[^\s]+\s?)"(' . $this::COLUMN_PATTERN . ')"(?!\s?[^\s]+\')/u', + $this->quotePattern, + $statement + ); + + foreach ($map as $key => $value) { + if ($value[1] === PDO::PARAM_STR) { + $replace = $this->quote("{$value[0]}"); + } elseif ($value[1] === PDO::PARAM_NULL) { + $replace = 'NULL'; + } elseif ($value[1] === PDO::PARAM_LOB) { + $replace = '{LOB_DATA}'; + } else { + $replace = $value[0] . ''; + } + + $statement = str_replace($key, $replace, $statement); + } + + return $statement; + } + + /** + * Build a raw object. + * + * @param string $string The raw string. + * @param array $map The array of mapping data for the raw string. + * @return Medoo::raw + */ + public static function raw(string $string, array $map = []): Raw + { + $raw = new Raw(); + + $raw->map = $map; + $raw->value = $string; + + return $raw; + } + + /** + * Finds whether the object is raw. + * + * @param object $object + * @return bool + */ + protected function isRaw($object): bool + { + return $object instanceof Raw; + } + + /** + * Generate the actual query from the raw object. + * + * @param mixed $raw + * @param array $map + * @return string|null + */ + protected function buildRaw($raw, array &$map): ?string + { + if (!$this->isRaw($raw)) { + return null; + } + + $query = preg_replace_callback( + '/(([`\'])[\<]*?)?((FROM|TABLE|TABLES LIKE|INTO|UPDATE|JOIN|TABLE IF EXISTS)\s*)?\<((' . $this::TABLE_PATTERN . ')(\.' . $this::COLUMN_PATTERN . ')?)\>([^,]*?\2)?/', + function ($matches) { + if (!empty($matches[2]) && isset($matches[8])) { + return $matches[0]; + } + + if (!empty($matches[4])) { + return $matches[1] . $matches[4] . ' ' . $this->tableQuote($matches[5]); + } + + return $matches[1] . $this->columnQuote($matches[5]); + }, + $raw->value + ); + + $rawMap = $raw->map; + + if (!empty($rawMap)) { + foreach ($rawMap as $key => $value) { + $map[$key] = $this->typeMap($value, gettype($value)); + } + } + + return $query; + } + + /** + * Escape and quote a string for use in an SQL query. + * + * @param string $string The string to be quoted. + * @return string + */ + public function quote(string $string): string + { + if ($this->type === 'mysql') { + return "'" . preg_replace(['/([\'"])/', '/(\\\\\\\")/'], ["\\\\\${1}", '\\\${1}'], $string) . "'"; + } + + return "'" . preg_replace('/\'/', '\'\'', $string) . "'"; + } + + /** + * Quote a table name for use in an SQL query. + * + * @param string $table The table name to be quoted. + * @return string + * @throws InvalidArgumentException If the table name is invalid. + */ + public function tableQuote(string $table): string + { + if (preg_match("/^" . $this::TABLE_PATTERN . "$/u", $table)) { + return '"' . $this->prefix . $table . '"'; + } + + throw new InvalidArgumentException("Incorrect table name: {$table}."); + } + + /** + * Quote a column name for use in an SQL query. + * + * @param string $column The column name to be quoted. + * @return string + * @throws InvalidArgumentException If the column name is invalid. + */ + public function columnQuote(string $column): string + { + if (preg_match("/^" . $this::TABLE_PATTERN . "(\.?" . $this::ALIAS_PATTERN . ")?$/u", $column)) { + return strpos($column, '.') !== false ? + '"' . $this->prefix . str_replace('.', '"."', $column) . '"' : + '"' . $column . '"'; + } + + throw new InvalidArgumentException("Incorrect column name: {$column}."); + } + + /** + * Mapping the type name as PDO data type. + * + * @param mixed $value + * @param string $type + * @return array + */ + protected function typeMap($value, string $type): array + { + $map = [ + 'NULL' => PDO::PARAM_NULL, + 'integer' => PDO::PARAM_INT, + 'double' => PDO::PARAM_STR, + 'boolean' => PDO::PARAM_BOOL, + 'string' => PDO::PARAM_STR, + 'object' => PDO::PARAM_STR, + 'resource' => PDO::PARAM_LOB + ]; + + if ($type === 'boolean') { + $value = ($value ? '1' : '0'); + } elseif ($type === 'NULL') { + $value = null; + } + + return [$value, $map[$type]]; + } + + /** + * Build the statement part for the column stack. + * + * @param array|string $columns + * @param array $map + * @param bool $root + * @param bool $isJoin + * @return string + */ + protected function columnPush(&$columns, array &$map, bool $root, bool $isJoin = false): string + { + if ($columns === '*') { + return $columns; + } + + $stack = []; + $hasDistinct = false; + + if (is_string($columns)) { + $columns = [$columns]; + } + + foreach ($columns as $key => $value) { + $isIntKey = is_int($key); + $isArrayValue = is_array($value); + + if (!$isIntKey && $isArrayValue && $root && count(array_keys($columns)) === 1) { + $stack[] = $this->columnQuote($key); + $stack[] = $this->columnPush($value, $map, false, $isJoin); + } elseif ($isArrayValue) { + $stack[] = $this->columnPush($value, $map, false, $isJoin); + } elseif (!$isIntKey && $raw = $this->buildRaw($value, $map)) { + preg_match("/(?" . $this::COLUMN_PATTERN . ")(\s*\[(?(String|Bool|Int|Number))\])?/u", $key, $match); + $stack[] = "{$raw} AS {$this->columnQuote($match['column'])}"; + } elseif ($isIntKey && is_string($value)) { + if ($isJoin && strpos($value, '*') !== false) { + throw new InvalidArgumentException('Cannot use table.* to select all columns while joining table.'); + } + + preg_match("/(?" . $this::COLUMN_PATTERN . ")(?:\s*\((?" . $this::ALIAS_PATTERN . ")\))?(?:\s*\[(?(?:String|Bool|Int|Number|Object|JSON))\])?/u", $value, $match); + + $columnString = ''; + + if (!empty($match['alias'])) { + $columnString = "{$this->columnQuote($match['column'])} AS {$this->columnQuote($match['alias'])}"; + $columns[$key] = $match['alias']; + + if (!empty($match['type'])) { + $columns[$key] .= ' [' . $match['type'] . ']'; + } + } else { + $columnString = $this->columnQuote($match['column']); + } + + if (!$hasDistinct && strpos($value, '@') === 0) { + $columnString = 'DISTINCT ' . $columnString; + $hasDistinct = true; + array_unshift($stack, $columnString); + + continue; + } + + $stack[] = $columnString; + } + } + + return implode(',', $stack); + } + + /** + * Implode the Where conditions. + * + * @param array $data + * @param array $map + * @param string $conjunctor + * @return string + */ + protected function dataImplode(array $data, array &$map, string $conjunctor): string + { + $stack = []; + + foreach ($data as $key => $value) { + $type = gettype($value); + + if ( + $type === 'array' && + preg_match("/^(AND|OR)(\s+#.*)?$/", $key, $relationMatch) + ) { + $stack[] = '(' . $this->dataImplode($value, $map, ' ' . $relationMatch[1]) . ')'; + continue; + } + + $mapKey = $this->mapKey(); + $isIndex = is_int($key); + + preg_match( + "/(?" . $this::COLUMN_PATTERN . ")(\[(?.*)\])?(?" . $this::COLUMN_PATTERN . ")?/u", + $isIndex ? $value : $key, + $match + ); + + $column = $this->columnQuote($match['column']); + $operator = $match['operator'] ?? null; + + if ($isIndex && isset($match['comparison']) && in_array($operator, ['>', '>=', '<', '<=', '=', '!='])) { + $stack[] = "{$column} {$operator} " . $this->columnQuote($match['comparison']); + continue; + } + + if ($operator && $operator !== '=') { + if (in_array($operator, ['>', '>=', '<', '<='])) { + $condition = "{$column} {$operator} "; + + if (is_numeric($value)) { + $condition .= $mapKey; + $map[$mapKey] = [$value, is_float($value) ? PDO::PARAM_STR : PDO::PARAM_INT]; + } elseif ($raw = $this->buildRaw($value, $map)) { + $condition .= $raw; + } else { + $condition .= $mapKey; + $map[$mapKey] = [$value, PDO::PARAM_STR]; + } + + $stack[] = $condition; + } elseif ($operator === '!') { + switch ($type) { + + case 'NULL': + $stack[] = $column . ' IS NOT NULL'; + break; + + case 'array': + $values = []; + + foreach ($value as $index => $item) { + if ($raw = $this->buildRaw($item, $map)) { + $values[] = $raw; + } else { + $stackKey = $mapKey . $index . '_i'; + + $values[] = $stackKey; + $map[$stackKey] = $this->typeMap($item, gettype($item)); + } + } + + $stack[] = $column . ' NOT IN (' . implode(', ', $values) . ')'; + break; + + case 'object': + if ($raw = $this->buildRaw($value, $map)) { + $stack[] = "{$column} != {$raw}"; + } + break; + + case 'integer': + case 'double': + case 'boolean': + case 'string': + $stack[] = "{$column} != {$mapKey}"; + $map[$mapKey] = $this->typeMap($value, $type); + break; + } + } elseif ($operator === '~' || $operator === '!~') { + if ($type !== 'array') { + $value = [$value]; + } + + $connector = ' OR '; + $data = array_values($value); + + if (is_array($data[0])) { + if (isset($value['AND']) || isset($value['OR'])) { + $connector = ' ' . array_keys($value)[0] . ' '; + $value = $data[0]; + } + } + + $likeClauses = []; + + foreach ($value as $index => $item) { + $likeKey = "{$mapKey}_{$index}_i"; + $item = strval($item); + + if (!preg_match('/((?' || $operator === '><') { + if ($type === 'array') { + if ($operator === '><') { + $column .= ' NOT'; + } + + if ($this->isRaw($value[0]) && $this->isRaw($value[1])) { + $stack[] = "({$column} BETWEEN {$this->buildRaw($value[0], $map)} AND {$this->buildRaw($value[1], $map)})"; + } else { + $stack[] = "({$column} BETWEEN {$mapKey}a AND {$mapKey}b)"; + $dataType = (is_numeric($value[0]) && is_numeric($value[1])) ? PDO::PARAM_INT : PDO::PARAM_STR; + + $map[$mapKey . 'a'] = [$value[0], $dataType]; + $map[$mapKey . 'b'] = [$value[1], $dataType]; + } + } + } elseif ($operator === 'REGEXP') { + $stack[] = "{$column} REGEXP {$mapKey}"; + $map[$mapKey] = [$value, PDO::PARAM_STR]; + } else { + throw new InvalidArgumentException("Invalid operator [{$operator}] for column {$column} supplied."); + } + + continue; + } + + switch ($type) { + + case 'NULL': + $stack[] = $column . ' IS NULL'; + break; + + case 'array': + $values = []; + + foreach ($value as $index => $item) { + if ($raw = $this->buildRaw($item, $map)) { + $values[] = $raw; + } else { + $stackKey = $mapKey . $index . '_i'; + + $values[] = $stackKey; + $map[$stackKey] = $this->typeMap($item, gettype($item)); + } + } + + $stack[] = $column . ' IN (' . implode(', ', $values) . ')'; + break; + + case 'object': + if ($raw = $this->buildRaw($value, $map)) { + $stack[] = "{$column} = {$raw}"; + } + break; + + case 'integer': + case 'double': + case 'boolean': + case 'string': + $stack[] = "{$column} = {$mapKey}"; + $map[$mapKey] = $this->typeMap($value, $type); + break; + } + } + + return implode($conjunctor . ' ', $stack); + } + + /** + * Build the where clause. + * + * @param array|null $where + * @param array $map + * @return string + */ + protected function whereClause($where, array &$map): string + { + $clause = ''; + + if (is_array($where)) { + $conditions = array_diff_key($where, array_flip( + ['GROUP', 'ORDER', 'HAVING', 'LIMIT', 'LIKE', 'MATCH'] + )); + + if (!empty($conditions)) { + $clause = ' WHERE ' . $this->dataImplode($conditions, $map, ' AND'); + } + + if (isset($where['MATCH']) && $this->type === 'mysql') { + $match = $where['MATCH']; + + if (is_array($match) && isset($match['columns'], $match['keyword'])) { + $mode = ''; + + $options = [ + 'natural' => 'IN NATURAL LANGUAGE MODE', + 'natural+query' => 'IN NATURAL LANGUAGE MODE WITH QUERY EXPANSION', + 'boolean' => 'IN BOOLEAN MODE', + 'query' => 'WITH QUERY EXPANSION' + ]; + + if (isset($match['mode'], $options[$match['mode']])) { + $mode = ' ' . $options[$match['mode']]; + } + + $columns = implode(', ', array_map([$this, 'columnQuote'], $match['columns'])); + $mapKey = $this->mapKey(); + $map[$mapKey] = [$match['keyword'], PDO::PARAM_STR]; + $clause .= ($clause !== '' ? ' AND ' : ' WHERE') . ' MATCH (' . $columns . ') AGAINST (' . $mapKey . $mode . ')'; + } + } + + if (isset($where['GROUP'])) { + $group = $where['GROUP']; + + if (is_array($group)) { + $stack = []; + + foreach ($group as $column => $value) { + $stack[] = $this->columnQuote($value); + } + + $clause .= ' GROUP BY ' . implode(',', $stack); + } elseif ($raw = $this->buildRaw($group, $map)) { + $clause .= ' GROUP BY ' . $raw; + } else { + $clause .= ' GROUP BY ' . $this->columnQuote($group); + } + } + + if (isset($where['HAVING'])) { + $having = $where['HAVING']; + + if ($raw = $this->buildRaw($having, $map)) { + $clause .= ' HAVING ' . $raw; + } else { + $clause .= ' HAVING ' . $this->dataImplode($having, $map, ' AND'); + } + } + + if (isset($where['ORDER'])) { + $order = $where['ORDER']; + + if (is_array($order)) { + $stack = []; + + foreach ($order as $column => $value) { + if (is_array($value)) { + $valueStack = []; + + foreach ($value as $item) { + $valueStack[] = is_int($item) ? $item : $this->quote($item); + } + + $valueString = implode(',', $valueStack); + $stack[] = "FIELD({$this->columnQuote($column)}, {$valueString})"; + } elseif ($value === 'ASC' || $value === 'DESC') { + $stack[] = $this->columnQuote($column) . ' ' . $value; + } elseif (is_int($column)) { + $stack[] = $this->columnQuote($value); + } + } + + $clause .= ' ORDER BY ' . implode(',', $stack); + } elseif ($raw = $this->buildRaw($order, $map)) { + $clause .= ' ORDER BY ' . $raw; + } else { + $clause .= ' ORDER BY ' . $this->columnQuote($order); + } + } + + if (isset($where['LIMIT'])) { + $limit = $where['LIMIT']; + + if (in_array($this->type, ['oracle', 'mssql'])) { + if ($this->type === 'mssql' && !isset($where['ORDER'])) { + $clause .= ' ORDER BY (SELECT 0)'; + } + + if (is_numeric($limit)) { + $limit = [0, $limit]; + } + + if ( + is_array($limit) && + is_numeric($limit[0]) && + is_numeric($limit[1]) + ) { + $clause .= " OFFSET {$limit[0]} ROWS FETCH NEXT {$limit[1]} ROWS ONLY"; + } + } else { + if (is_numeric($limit)) { + $clause .= ' LIMIT ' . $limit; + } elseif ( + is_array($limit) && + is_numeric($limit[0]) && + is_numeric($limit[1]) + ) { + $clause .= " LIMIT {$limit[1]} OFFSET {$limit[0]}"; + } + } + } + } elseif ($raw = $this->buildRaw($where, $map)) { + $clause .= ' ' . $raw; + } + + return $clause; + } + + /** + * Build statement for the select query. + * + * @param string $table + * @param array $map + * @param array|string $join + * @param array|string $columns + * @param array $where + * @param string $columnFn + * @return string + */ + protected function selectContext( + string $table, + array &$map, + $join, + &$columns = null, + $where = null, + $columnFn = null + ): string { + preg_match("/(?" . $this::TABLE_PATTERN . ")\s*\((?" . $this::ALIAS_PATTERN . ")\)/u", $table, $tableMatch); + + if (isset($tableMatch['table'], $tableMatch['alias'])) { + $table = $this->tableQuote($tableMatch['table']); + $tableAlias = $this->tableQuote($tableMatch['alias']); + $tableQuery = "{$table}{$this->tableAliasConnector}{$tableAlias}"; + } else { + $table = $this->tableQuote($table); + $tableQuery = $table; + } + + $isJoin = $this->isJoin($join); + + if ($isJoin) { + $tableQuery .= ' ' . $this->buildJoin($tableAlias ?? $table, $join, $map); + } else { + if (is_null($columns)) { + if ( + !is_null($where) || + (is_array($join) && isset($columnFn)) + ) { + $where = $join; + $columns = null; + } else { + $where = null; + $columns = $join; + } + } else { + $where = $columns; + $columns = $join; + } + } + + if (isset($columnFn)) { + if ($columnFn === 1) { + $column = '1'; + + if (is_null($where)) { + $where = $columns; + } + } elseif ($raw = $this->buildRaw($columnFn, $map)) { + $column = $raw; + } else { + if (empty($columns) || $this->isRaw($columns)) { + $columns = '*'; + $where = $join; + } + + $column = $columnFn . '(' . $this->columnPush($columns, $map, true) . ')'; + } + } else { + $column = $this->columnPush($columns, $map, true, $isJoin); + } + + return 'SELECT ' . $column . ' FROM ' . $tableQuery . $this->whereClause($where, $map); + } + + /** + * Determine the array with join syntax. + * + * @param mixed $join + * @return bool + */ + protected function isJoin($join): bool + { + if (!is_array($join)) { + return false; + } + + $keys = array_keys($join); + + if ( + isset($keys[0]) && + is_string($keys[0]) && + strpos($keys[0], '[') === 0 + ) { + return true; + } + + return false; + } + + /** + * Build the join statement. + * + * @param string $table + * @param array $join + * @param array $map + * @return string + */ + protected function buildJoin(string $table, array $join, array &$map): string + { + $tableJoin = []; + $type = [ + '>' => 'LEFT', + '<' => 'RIGHT', + '<>' => 'FULL', + '><' => 'INNER' + ]; + + foreach ($join as $subtable => $relation) { + preg_match("/(\[(?\<\>?|\>\" . $this::TABLE_PATTERN . ")\s?(\((?" . $this::ALIAS_PATTERN . ")\))?/u", $subtable, $match); + + if ($match['join'] === '' || $match['table'] === '') { + continue; + } + + if (is_string($relation)) { + $relation = 'USING ("' . $relation . '")'; + } elseif (is_array($relation)) { + // For ['column1', 'column2'] + if (isset($relation[0])) { + $relation = 'USING ("' . implode('", "', $relation) . '")'; + } else { + $joins = []; + + foreach ($relation as $key => $value) { + if ($key === 'AND' && is_array($value)) { + $joins[] = $this->dataImplode($value, $map, ' AND'); + continue; + } + + $joins[] = ( + strpos($key, '.') > 0 ? + // For ['tableB.column' => 'column'] + $this->columnQuote($key) : + + // For ['column1' => 'column2'] + $table . '.' . $this->columnQuote($key) + ) . + ' = ' . + $this->tableQuote($match['alias'] ?? $match['table']) . '.' . $this->columnQuote($value); + } + + $relation = 'ON ' . implode(' AND ', $joins); + } + } elseif ($raw = $this->buildRaw($relation, $map)) { + $relation = $raw; + } + + $tableName = $this->tableQuote($match['table']); + + if (isset($match['alias'])) { + $tableName .= $this->tableAliasConnector . $this->tableQuote($match['alias']); + } + + $tableJoin[] = $type[$match['join']] . " JOIN {$tableName} {$relation}"; + } + + return implode(' ', $tableJoin); + } + + /** + * Mapping columns for the stack. + * + * @param array|string $columns + * @param array $stack + * @param bool $root + * @return array + */ + protected function columnMap($columns, array &$stack, bool $root): array + { + if ($columns === '*') { + return $stack; + } + + foreach ($columns as $key => $value) { + if (is_int($key)) { + preg_match("/(" . $this::TABLE_PATTERN . "\.)?(?" . $this::COLUMN_PATTERN . ")(?:\s*\((?" . $this::ALIAS_PATTERN . ")\))?(?:\s*\[(?(?:String|Bool|Int|Number|Object|JSON))\])?/u", $value, $keyMatch); + + $columnKey = !empty($keyMatch['alias']) ? + $keyMatch['alias'] : + $keyMatch['column']; + + $stack[$value] = isset($keyMatch['type']) ? + [$columnKey, $keyMatch['type']] : + [$columnKey]; + } elseif ($this->isRaw($value)) { + preg_match("/(" . $this::TABLE_PATTERN . "\.)?(?" . $this::COLUMN_PATTERN . ")(\s*\[(?(String|Bool|Int|Number))\])?/u", $key, $keyMatch); + $columnKey = $keyMatch['column']; + + $stack[$key] = isset($keyMatch['type']) ? + [$columnKey, $keyMatch['type']] : + [$columnKey]; + } elseif (!is_int($key) && is_array($value)) { + if ($root && count(array_keys($columns)) === 1) { + $stack[$key] = [$key, 'String']; + } + + $this->columnMap($value, $stack, false); + } + } + + return $stack; + } + + /** + * Mapping the data from the table. + * + * @param array $data + * @param array $columns + * @param array $columnMap + * @param array $stack + * @param bool $root + * @param array $result + * @codeCoverageIgnore + * @return void + */ + protected function dataMap( + array $data, + array $columns, + array $columnMap, + array &$stack, + bool $root, + ?array &$result = null + ): void { + if ($root) { + $columnsKey = array_keys($columns); + + if (count($columnsKey) === 1 && is_array($columns[$columnsKey[0]])) { + $indexKey = array_keys($columns)[0]; + $dataKey = preg_replace("/^" . $this::COLUMN_PATTERN . "\./u", '', $indexKey); + $currentStack = []; + + foreach ($data as $item) { + $this->dataMap($data, $columns[$indexKey], $columnMap, $currentStack, false, $result); + $index = $data[$dataKey]; + + if (isset($result)) { + $result[$index] = $currentStack; + } else { + $stack[$index] = $currentStack; + } + } + } else { + $currentStack = []; + $this->dataMap($data, $columns, $columnMap, $currentStack, false, $result); + + if (isset($result)) { + $result[] = $currentStack; + } else { + $stack = $currentStack; + } + } + + return; + } + + foreach ($columns as $key => $value) { + $isRaw = $this->isRaw($value); + + if (is_int($key) || $isRaw) { + $map = $columnMap[$isRaw ? $key : $value]; + $columnKey = $map[0]; + $item = $data[$columnKey]; + + if (isset($map[1])) { + if ($isRaw && in_array($map[1], ['Object', 'JSON'])) { + continue; + } + + if (is_null($item)) { + $stack[$columnKey] = null; + continue; + } + + switch ($map[1]) { + + case 'Number': + $stack[$columnKey] = (float) $item; + break; + + case 'Int': + $stack[$columnKey] = (int) $item; + break; + + case 'Bool': + $stack[$columnKey] = (bool) $item; + break; + + case 'Object': + $stack[$columnKey] = unserialize($item); + break; + + case 'JSON': + $stack[$columnKey] = json_decode($item, true); + break; + + case 'String': + $stack[$columnKey] = (string) $item; + break; + } + } else { + $stack[$columnKey] = $item; + } + } else { + $currentStack = []; + $this->dataMap($data, $value, $columnMap, $currentStack, false, $result); + + $stack[$key] = $currentStack; + } + } + } + + /** + * Build and execute returning query. + * + * @param string $query + * @param array $map + * @param array $data + * @return \PDOStatement|null + */ + private function returningQuery($query, &$map, &$data): ?PDOStatement + { + $returnColumns = array_map( + function ($value) { + return $value[0]; + }, + $data + ); + + $query .= ' RETURNING ' . + implode(', ', array_map([$this, 'columnQuote'], $returnColumns)) . + ' INTO ' . + implode(', ', array_keys($data)); + + return $this->exec($query, $map, function ($statement) use (&$data) { + // @codeCoverageIgnoreStart + foreach ($data as $key => $return) { + if (isset($return[3])) { + $statement->bindParam($key, $data[$key][1], $return[2], $return[3]); + } else { + $statement->bindParam($key, $data[$key][1], $return[2]); + } + } + // @codeCoverageIgnoreEnd + }); + } + + /** + * Create a table. + * + * @param string $table + * @param array $columns Columns definition. + * @param array $options Additional table options for creating a table. + * @return \PDOStatement|null + */ + public function create(string $table, $columns, $options = null): ?PDOStatement + { + $stack = []; + $tableOption = ''; + $tableName = $this->tableQuote($table); + + foreach ($columns as $name => $definition) { + if (is_int($name)) { + $stack[] = preg_replace("/\<(" . $this::COLUMN_PATTERN . ")\>/u", '"$1"', $definition); + } elseif (is_array($definition)) { + $stack[] = $this->columnQuote($name) . ' ' . implode(' ', $definition); + } elseif (is_string($definition)) { + $stack[] = $this->columnQuote($name) . ' ' . $definition; + } + } + + if (is_array($options)) { + $optionStack = []; + + foreach ($options as $key => $value) { + if (is_string($value) || is_int($value)) { + $optionStack[] = "{$key} = {$value}"; + } + } + + $tableOption = ' ' . implode(', ', $optionStack); + } elseif (is_string($options)) { + $tableOption = ' ' . $options; + } + + $command = 'CREATE TABLE'; + + if (in_array($this->type, ['mysql', 'pgsql', 'sqlite'])) { + $command .= ' IF NOT EXISTS'; + } + + return $this->exec("{$command} {$tableName} (" . implode(', ', $stack) . "){$tableOption}"); + } + + /** + * Drop a table. + * + * @param string $table + * @return \PDOStatement|null + */ + public function drop(string $table): ?PDOStatement + { + return $this->exec('DROP TABLE IF EXISTS ' . $this->tableQuote($table)); + } + + /** + * Select data from the table. + * + * @param string $table + * @param array $join + * @param array|string $columns + * @param array $where + * @return array|null + */ + public function select(string $table, $join, $columns = null, $where = null): ?array + { + $map = []; + $result = []; + $columnMap = []; + + $args = func_get_args(); + $lastArgs = $args[array_key_last($args)]; + $callback = is_callable($lastArgs) ? $lastArgs : null; + + $where = is_callable($where) ? null : $where; + $columns = is_callable($columns) ? null : $columns; + + $column = $where === null ? $join : $columns; + $isSingle = (is_string($column) && $column !== '*'); + + $statement = $this->exec($this->selectContext($table, $map, $join, $columns, $where), $map); + + $this->columnMap($columns, $columnMap, true); + + if (!$this->statement) { + return $result; + } + + // @codeCoverageIgnoreStart + if ($columns === '*') { + if (isset($callback)) { + while ($data = $statement->fetch(PDO::FETCH_ASSOC)) { + $callback($data); + } + + return null; + } + + return $statement->fetchAll(PDO::FETCH_ASSOC); + } + + while ($data = $statement->fetch(PDO::FETCH_ASSOC)) { + $currentStack = []; + + if (isset($callback)) { + $this->dataMap($data, $columns ?? [], $columnMap, $currentStack, true); + + $callback( + $isSingle ? + $currentStack[$columnMap[$column][0]] : + $currentStack + ); + } else { + $this->dataMap($data, $columns ?? [], $columnMap, $currentStack, true, $result); + } + } + + if (isset($callback)) { + return null; + } + + if ($isSingle) { + $singleResult = []; + $resultKey = $columnMap[$column][0]; + + foreach ($result as $item) { + $singleResult[] = $item[$resultKey]; + } + + return $singleResult; + } + + return $result; + } + // @codeCoverageIgnoreEnd + + /** + * Insert one or more records into the table. + * + * @param string $table + * @param array $values + * @param string $primaryKey + * @return \PDOStatement|null + */ + public function insert(string $table, array $values, ?string $primaryKey = null): ?PDOStatement + { + $stack = []; + $columns = []; + $fields = []; + $map = []; + $returnings = []; + + if (!isset($values[0])) { + $values = [$values]; + } + + foreach ($values as $data) { + foreach ($data as $key => $value) { + $columns[] = $key; + } + } + + $columns = array_unique($columns); + + foreach ($values as $data) { + $values = []; + + foreach ($columns as $key) { + $value = $data[$key]; + $type = gettype($value); + + if ($this->type === 'oracle' && $type === 'resource') { + $values[] = 'EMPTY_BLOB()'; + $returnings[$this->mapKey()] = [$key, $value, PDO::PARAM_LOB]; + continue; + } + + if ($raw = $this->buildRaw($data[$key], $map)) { + $values[] = $raw; + continue; + } + + $mapKey = $this->mapKey(); + $values[] = $mapKey; + + switch ($type) { + + case 'array': + $map[$mapKey] = [ + strpos($key, '[JSON]') === strlen($key) - 6 ? + json_encode($value) : + serialize($value), + PDO::PARAM_STR + ]; + break; + + case 'object': + $value = serialize($value); + break; + + case 'NULL': + case 'resource': + case 'boolean': + case 'integer': + case 'double': + case 'string': + $map[$mapKey] = $this->typeMap($value, $type); + break; + } + } + + $stack[] = '(' . implode(', ', $values) . ')'; + } + + foreach ($columns as $key) { + $fields[] = $this->columnQuote(preg_replace("/(\s*\[JSON\]$)/i", '', $key)); + } + + $query = 'INSERT INTO ' . $this->tableQuote($table) . ' (' . implode(', ', $fields) . ') VALUES ' . implode(', ', $stack); + + if ( + $this->type === 'oracle' && (!empty($returnings) || isset($primaryKey)) + ) { + if ($primaryKey) { + $returnings[':RETURNID'] = [$primaryKey, '', PDO::PARAM_INT, 8]; + } + + $statement = $this->returningQuery($query, $map, $returnings); + + if ($primaryKey) { + $this->returnId = $returnings[':RETURNID'][1]; + } + + return $statement; + } + + return $this->exec($query, $map); + } + + /** + * Modify data from the table. + * + * @param string $table + * @param array $data + * @param array $where + * @return \PDOStatement|null + */ + public function update(string $table, $data, $where = null): ?PDOStatement + { + $fields = []; + $map = []; + $returnings = []; + + foreach ($data as $key => $value) { + $column = $this->columnQuote(preg_replace("/(\s*\[(JSON|\+|\-|\*|\/)\]$)/", '', $key)); + $type = gettype($value); + + if ($this->type === 'oracle' && $type === 'resource') { + $fields[] = "{$column} = EMPTY_BLOB()"; + $returnings[$this->mapKey()] = [$key, $value, PDO::PARAM_LOB]; + continue; + } + + if ($raw = $this->buildRaw($value, $map)) { + $fields[] = "{$column} = {$raw}"; + continue; + } + + preg_match("/" . $this::COLUMN_PATTERN . "(\[(?\+|\-|\*|\/)\])?/u", $key, $match); + + if (isset($match['operator'])) { + if (is_numeric($value)) { + $fields[] = "{$column} = {$column} {$match['operator']} {$value}"; + } + } else { + $mapKey = $this->mapKey(); + $fields[] = "{$column} = {$mapKey}"; + + switch ($type) { + + case 'array': + $map[$mapKey] = [ + strpos($key, '[JSON]') === strlen($key) - 6 ? + json_encode($value) : + serialize($value), + PDO::PARAM_STR + ]; + break; + + case 'object': + $value = serialize($value); + + break; + case 'NULL': + case 'resource': + case 'boolean': + case 'integer': + case 'double': + case 'string': + $map[$mapKey] = $this->typeMap($value, $type); + break; + } + } + } + + $query = 'UPDATE ' . $this->tableQuote($table) . ' SET ' . implode(', ', $fields) . $this->whereClause($where, $map); + + if ($this->type === 'oracle' && !empty($returnings)) { + return $this->returningQuery($query, $map, $returnings); + } + + return $this->exec($query, $map); + } + + /** + * Delete data from the table. + * + * @param string $table + * @param array|Raw $where + * @return \PDOStatement|null + */ + public function delete(string $table, $where): ?PDOStatement + { + $map = []; + + return $this->exec('DELETE FROM ' . $this->tableQuote($table) . $this->whereClause($where, $map), $map); + } + + /** + * Replace old data with a new one. + * + * @param string $table + * @param array $columns + * @param array $where + * @return \PDOStatement|null + */ + public function replace(string $table, array $columns, $where = null): ?PDOStatement + { + $map = []; + $stack = []; + + foreach ($columns as $column => $replacements) { + if (is_array($replacements)) { + foreach ($replacements as $old => $new) { + $mapKey = $this->mapKey(); + $columnName = $this->columnQuote($column); + $stack[] = "{$columnName} = REPLACE({$columnName}, {$mapKey}a, {$mapKey}b)"; + + $map[$mapKey . 'a'] = [$old, PDO::PARAM_STR]; + $map[$mapKey . 'b'] = [$new, PDO::PARAM_STR]; + } + } + } + + if (empty($stack)) { + throw new InvalidArgumentException('Invalid columns supplied.'); + } + + return $this->exec('UPDATE ' . $this->tableQuote($table) . ' SET ' . implode(', ', $stack) . $this->whereClause($where, $map), $map); + } + + /** + * Get only one record from the table. + * + * @param string $table + * @param array $join + * @param array|string $columns + * @param array $where + * @return mixed + */ + public function get(string $table, $join = null, $columns = null, $where = null) + { + $map = []; + $result = []; + $columnMap = []; + $currentStack = []; + + if ($where === null) { + if ($this->isJoin($join)) { + $where['LIMIT'] = 1; + } else { + $columns['LIMIT'] = 1; + } + + $column = $join; + } else { + $column = $columns; + $where['LIMIT'] = 1; + } + + $isSingle = (is_string($column) && $column !== '*'); + $query = $this->exec($this->selectContext($table, $map, $join, $columns, $where), $map); + + if (!$this->statement) { + return false; + } + + // @codeCoverageIgnoreStart + $data = $query->fetchAll(PDO::FETCH_ASSOC); + + if (isset($data[0])) { + if ($column === '*') { + return $data[0]; + } + + $this->columnMap($columns, $columnMap, true); + $this->dataMap($data[0], $columns, $columnMap, $currentStack, true, $result); + + if ($isSingle) { + return $result[0][$columnMap[$column][0]]; + } + + return $result[0]; + } + } + // @codeCoverageIgnoreEnd + + /** + * Determine whether the target data existed from the table. + * + * @param string $table + * @param array $join + * @param array $where + * @return bool + */ + public function has(string $table, $join, $where = null): bool + { + $map = []; + $column = null; + + $query = $this->exec( + $this->type === 'mssql' ? + $this->selectContext($table, $map, $join, $column, $where, Medoo::raw('TOP 1 1')) : + 'SELECT EXISTS(' . $this->selectContext($table, $map, $join, $column, $where, 1) . ')', + $map + ); + + if (!$this->statement) { + return false; + } + + // @codeCoverageIgnoreStart + $result = $query->fetchColumn(); + + return $result === '1' || $result === 1 || $result === true; + } + // @codeCoverageIgnoreEnd + + /** + * Randomly fetch data from the table. + * + * @param string $table + * @param array $join + * @param array|string $columns + * @param array $where + * @return array + */ + public function rand(string $table, $join = null, $columns = null, $where = null): array + { + $orderRaw = $this->raw( + $this->type === 'mysql' ? 'RAND()' + : ($this->type === 'mssql' ? 'NEWID()' + : 'RANDOM()') + ); + + if ($where === null) { + if ($this->isJoin($join)) { + $where['ORDER'] = $orderRaw; + } else { + $columns['ORDER'] = $orderRaw; + } + } else { + $where['ORDER'] = $orderRaw; + } + + return $this->select($table, $join, $columns, $where); + } + + /** + * Build for the aggregate function. + * + * @param string $type + * @param string $table + * @param array $join + * @param string $column + * @param array $where + * @return string|null + */ + private function aggregate(string $type, string $table, $join = null, $column = null, $where = null): ?string + { + $map = []; + + $query = $this->exec($this->selectContext($table, $map, $join, $column, $where, $type), $map); + + if (!$this->statement) { + return null; + } + + // @codeCoverageIgnoreStart + return (string) $query->fetchColumn(); + } + // @codeCoverageIgnoreEnd + + /** + * Count the number of rows from the table. + * + * @param string $table + * @param array $join + * @param string $column + * @param array $where + * @return int|null + */ + public function count(string $table, $join = null, $column = null, $where = null): ?int + { + return (int) $this->aggregate('COUNT', $table, $join, $column, $where); + } + + /** + * Calculate the average value of the column. + * + * @param string $table + * @param array $join + * @param string $column + * @param array $where + * @return string|null + */ + public function avg(string $table, $join, $column = null, $where = null): ?string + { + return $this->aggregate('AVG', $table, $join, $column, $where); + } + + /** + * Get the maximum value of the column. + * + * @param string $table + * @param array $join + * @param string $column + * @param array $where + * @return string|null + */ + public function max(string $table, $join, $column = null, $where = null): ?string + { + return $this->aggregate('MAX', $table, $join, $column, $where); + } + + /** + * Get the minimum value of the column. + * + * @param string $table + * @param array $join + * @param string $column + * @param array $where + * @return string|null + */ + public function min(string $table, $join, $column = null, $where = null): ?string + { + return $this->aggregate('MIN', $table, $join, $column, $where); + } + + /** + * Calculate the total value of the column. + * + * @param string $table + * @param array $join + * @param string $column + * @param array $where + * @return string|null + */ + public function sum(string $table, $join, $column = null, $where = null): ?string + { + return $this->aggregate('SUM', $table, $join, $column, $where); + } + + /** + * Start a transaction. + * + * @param callable $actions + * @codeCoverageIgnore + * @return void + */ + public function action(callable $actions): void + { + if (is_callable($actions)) { + $this->pdo->beginTransaction(); + + try { + $result = $actions($this); + + if ($result === false) { + $this->pdo->rollBack(); + } else { + $this->pdo->commit(); + } + } catch (Exception $e) { + $this->pdo->rollBack(); + throw $e; + } + } + } + + /** + * Return the ID for the last inserted row. + * + * @param string $name + * @codeCoverageIgnore + * @return string|null + */ + public function id(?string $name = null): ?string + { + $type = $this->type; + + if ($type === 'oracle') { + return $this->returnId; + } elseif ($type === 'pgsql') { + $id = $this->pdo->query('SELECT LASTVAL()')->fetchColumn(); + + return (string) $id ?: null; + } + + return $this->pdo->lastInsertId($name); + } + + /** + * Enable debug mode and output readable statement string. + * + * @codeCoverageIgnore + * @return Medoo + */ + public function debug(): self + { + $this->debugMode = true; + + return $this; + } + + /** + * Enable debug logging mode. + * + * @codeCoverageIgnore + * @return void + */ + public function beginDebug(): void + { + $this->debugMode = true; + $this->debugLogging = true; + } + + /** + * Disable debug logging and return all readable statements. + * + * @codeCoverageIgnore + * @return void + */ + public function debugLog(): array + { + $this->debugMode = false; + $this->debugLogging = false; + + return $this->debugLogs; + } + + /** + * Return the last performed statement. + * + * @codeCoverageIgnore + * @return string|null + */ + public function last(): ?string + { + if (empty($this->logs)) { + return null; + } + + $log = $this->logs[array_key_last($this->logs)]; + + return $this->generate($log[0], $log[1]); + } + + /** + * Return all executed statements. + * + * @codeCoverageIgnore + * @return string[] + */ + public function log(): array + { + return array_map( + function ($log) { + return $this->generate($log[0], $log[1]); + }, + $this->logs + ); + } + + /** + * Get information about the database connection. + * + * @codeCoverageIgnore + * @return array + */ + public function info(): array + { + $output = [ + 'server' => 'SERVER_INFO', + 'driver' => 'DRIVER_NAME', + 'client' => 'CLIENT_VERSION', + 'version' => 'SERVER_VERSION', + 'connection' => 'CONNECTION_STATUS' + ]; + + foreach ($output as $key => $value) { + try { + $output[$key] = $this->pdo->getAttribute(constant('PDO::ATTR_' . $value)); + } catch (PDOException $e) { + $output[$key] = $e->getMessage(); + } + } + + $output['dsn'] = $this->dsn; + + return $output; + } +} diff --git a/backend/app/config.php b/backend/app/config.php new file mode 100644 index 0000000..583f396 --- /dev/null +++ b/backend/app/config.php @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/backend/app/functions/function.php b/backend/app/functions/function.php new file mode 100644 index 0000000..6eff33c --- /dev/null +++ b/backend/app/functions/function.php @@ -0,0 +1,4 @@ + diff --git a/backend/app/functions/routing.php b/backend/app/functions/routing.php new file mode 100644 index 0000000..90c5116 --- /dev/null +++ b/backend/app/functions/routing.php @@ -0,0 +1,19 @@ + + + + + + TaskBoard + + + + + +
+ + + + + diff --git a/front_vue/package-lock.json b/front_vue/package-lock.json new file mode 100644 index 0000000..de8b1aa --- /dev/null +++ b/front_vue/package-lock.json @@ -0,0 +1,1297 @@ +{ + "name": "taskboard", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "taskboard", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "@vitejs/plugin-vue": "^6.0.3", + "vite": "^7.3.1", + "vue": "^3.5.26", + "vue-router": "^4.6.4" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", + "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.5" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz", + "integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.2.tgz", + "integrity": "sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.2.tgz", + "integrity": "sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.2.tgz", + "integrity": "sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.2.tgz", + "integrity": "sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.2.tgz", + "integrity": "sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.2.tgz", + "integrity": "sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.2.tgz", + "integrity": "sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.2.tgz", + "integrity": "sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.2.tgz", + "integrity": "sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.2.tgz", + "integrity": "sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.2.tgz", + "integrity": "sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.2.tgz", + "integrity": "sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.2.tgz", + "integrity": "sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw==", + "cpu": [ + "mips64el" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.2.tgz", + "integrity": "sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.2.tgz", + "integrity": "sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.2.tgz", + "integrity": "sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.2.tgz", + "integrity": "sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.2.tgz", + "integrity": "sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.2.tgz", + "integrity": "sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.2.tgz", + "integrity": "sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.2.tgz", + "integrity": "sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.2.tgz", + "integrity": "sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.2.tgz", + "integrity": "sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.2.tgz", + "integrity": "sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.2.tgz", + "integrity": "sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.2.tgz", + "integrity": "sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "license": "MIT" + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-beta.53", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.53.tgz", + "integrity": "sha512-vENRlFU4YbrwVqNDZ7fLvy+JR1CRkyr01jhSiDpE1u6py3OMzQfztQU2jxykW3ALNxO4kSlqIDeYyD0Y9RcQeQ==", + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.55.1.tgz", + "integrity": "sha512-9R0DM/ykwfGIlNu6+2U09ga0WXeZ9MRC2Ter8jnz8415VbuIykVuc6bhdrbORFZANDmTDvq26mJrEVTl8TdnDg==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.55.1.tgz", + "integrity": "sha512-eFZCb1YUqhTysgW3sj/55du5cG57S7UTNtdMjCW7LwVcj3dTTcowCsC8p7uBdzKsZYa8J7IDE8lhMI+HX1vQvg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.55.1.tgz", + "integrity": "sha512-p3grE2PHcQm2e8PSGZdzIhCKbMCw/xi9XvMPErPhwO17vxtvCN5FEA2mSLgmKlCjHGMQTP6phuQTYWUnKewwGg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.55.1.tgz", + "integrity": "sha512-rDUjG25C9qoTm+e02Esi+aqTKSBYwVTaoS1wxcN47/Luqef57Vgp96xNANwt5npq9GDxsH7kXxNkJVEsWEOEaQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.55.1.tgz", + "integrity": "sha512-+JiU7Jbp5cdxekIgdte0jfcu5oqw4GCKr6i3PJTlXTCU5H5Fvtkpbs4XJHRmWNXF+hKmn4v7ogI5OQPaupJgOg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.55.1.tgz", + "integrity": "sha512-V5xC1tOVWtLLmr3YUk2f6EJK4qksksOYiz/TCsFHu/R+woubcLWdC9nZQmwjOAbmExBIVKsm1/wKmEy4z4u4Bw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.55.1.tgz", + "integrity": "sha512-Rn3n+FUk2J5VWx+ywrG/HGPTD9jXNbicRtTM11e/uorplArnXZYsVifnPPqNNP5BsO3roI4n8332ukpY/zN7rQ==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.55.1.tgz", + "integrity": "sha512-grPNWydeKtc1aEdrJDWk4opD7nFtQbMmV7769hiAaYyUKCT1faPRm2av8CX1YJsZ4TLAZcg9gTR1KvEzoLjXkg==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.55.1.tgz", + "integrity": "sha512-a59mwd1k6x8tXKcUxSyISiquLwB5pX+fJW9TkWU46lCqD/GRDe9uDN31jrMmVP3feI3mhAdvcCClhV8V5MhJFQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.55.1.tgz", + "integrity": "sha512-puS1MEgWX5GsHSoiAsF0TYrpomdvkaXm0CofIMG5uVkP6IBV+ZO9xhC5YEN49nsgYo1DuuMquF9+7EDBVYu4uA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.55.1.tgz", + "integrity": "sha512-r3Wv40in+lTsULSb6nnoudVbARdOwb2u5fpeoOAZjFLznp6tDU8kd+GTHmJoqZ9lt6/Sys33KdIHUaQihFcu7g==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.55.1.tgz", + "integrity": "sha512-MR8c0+UxAlB22Fq4R+aQSPBayvYa3+9DrwG/i1TKQXFYEaoW3B5b/rkSRIypcZDdWjWnpcvxbNaAJDcSbJU3Lw==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.55.1.tgz", + "integrity": "sha512-3KhoECe1BRlSYpMTeVrD4sh2Pw2xgt4jzNSZIIPLFEsnQn9gAnZagW9+VqDqAHgm1Xc77LzJOo2LdigS5qZ+gw==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.55.1.tgz", + "integrity": "sha512-ziR1OuZx0vdYZZ30vueNZTg73alF59DicYrPViG0NEgDVN8/Jl87zkAPu4u6VjZST2llgEUjaiNl9JM6HH1Vdw==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.55.1.tgz", + "integrity": "sha512-uW0Y12ih2XJRERZ4jAfKamTyIHVMPQnTZcQjme2HMVDAHY4amf5u414OqNYC+x+LzRdRcnIG1YodLrrtA8xsxw==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.55.1.tgz", + "integrity": "sha512-u9yZ0jUkOED1BFrqu3BwMQoixvGHGZ+JhJNkNKY/hyoEgOwlqKb62qu+7UjbPSHYjiVy8kKJHvXKv5coH4wDeg==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.55.1.tgz", + "integrity": "sha512-/0PenBCmqM4ZUd0190j7J0UsQ/1nsi735iPRakO8iPciE7BQ495Y6msPzaOmvx0/pn+eJVVlZrNrSh4WSYLxNg==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.55.1.tgz", + "integrity": "sha512-a8G4wiQxQG2BAvo+gU6XrReRRqj+pLS2NGXKm8io19goR+K8lw269eTrPkSdDTALwMmJp4th2Uh0D8J9bEV1vg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.55.1.tgz", + "integrity": "sha512-bD+zjpFrMpP/hqkfEcnjXWHMw5BIghGisOKPj+2NaNDuVT+8Ds4mPf3XcPHuat1tz89WRL+1wbcxKY3WSbiT7w==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.55.1.tgz", + "integrity": "sha512-eLXw0dOiqE4QmvikfQ6yjgkg/xDM+MdU9YJuP4ySTibXU0oAvnEWXt7UDJmD4UkYialMfOGFPJnIHSe/kdzPxg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.55.1.tgz", + "integrity": "sha512-xzm44KgEP11te3S2HCSyYf5zIzWmx3n8HDCc7EE59+lTcswEWNpvMLfd9uJvVX8LCg9QWG67Xt75AuHn4vgsXw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.55.1.tgz", + "integrity": "sha512-yR6Bl3tMC/gBok5cz/Qi0xYnVbIxGx5Fcf/ca0eB6/6JwOY+SRUcJfI0OpeTpPls7f194as62thCt/2BjxYN8g==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.55.1.tgz", + "integrity": "sha512-3fZBidchE0eY0oFZBnekYCfg+5wAB0mbpCBuofh5mZuzIU/4jIVkbESmd2dOsFNS78b53CYv3OAtwqkZZmU5nA==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.55.1.tgz", + "integrity": "sha512-xGGY5pXj69IxKb4yv/POoocPy/qmEGhimy/FoTpTSVju3FYXUQQMFCaZZXJVidsmGxRioZAwpThl/4zX41gRKg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.55.1.tgz", + "integrity": "sha512-SPEpaL6DX4rmcXtnhdrQYgzQ5W2uW3SCJch88lB2zImhJRhIIK44fkUrgIV/Q8yUNfw5oyZ5vkeQsZLhCb06lw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "license": "MIT" + }, + "node_modules/@vitejs/plugin-vue": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-6.0.3.tgz", + "integrity": "sha512-TlGPkLFLVOY3T7fZrwdvKpjprR3s4fxRln0ORDo1VQ7HHyxJwTlrjKU3kpVWTlaAjIEuCTokmjkZnr8Tpc925w==", + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "1.0.0-beta.53" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0", + "vue": "^3.2.25" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.26", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.26.tgz", + "integrity": "sha512-vXyI5GMfuoBCnv5ucIT7jhHKl55Y477yxP6fc4eUswjP8FG3FFVFd41eNDArR+Uk3QKn2Z85NavjaxLxOC19/w==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.28.5", + "@vue/shared": "3.5.26", + "entities": "^7.0.0", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.26", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.26.tgz", + "integrity": "sha512-y1Tcd3eXs834QjswshSilCBnKGeQjQXB6PqFn/1nxcQw4pmG42G8lwz+FZPAZAby6gZeHSt/8LMPfZ4Rb+Bd/A==", + "license": "MIT", + "dependencies": { + "@vue/compiler-core": "3.5.26", + "@vue/shared": "3.5.26" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.26", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.26.tgz", + "integrity": "sha512-egp69qDTSEZcf4bGOSsprUr4xI73wfrY5oRs6GSgXFTiHrWj4Y3X5Ydtip9QMqiCMCPVwLglB9GBxXtTadJ3mA==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.28.5", + "@vue/compiler-core": "3.5.26", + "@vue/compiler-dom": "3.5.26", + "@vue/compiler-ssr": "3.5.26", + "@vue/shared": "3.5.26", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.21", + "postcss": "^8.5.6", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.26", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.26.tgz", + "integrity": "sha512-lZT9/Y0nSIRUPVvapFJEVDbEXruZh2IYHMk2zTtEgJSlP5gVOqeWXH54xDKAaFS4rTnDeDBQUYDtxKyoW9FwDw==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.26", + "@vue/shared": "3.5.26" + } + }, + "node_modules/@vue/devtools-api": { + "version": "6.6.4", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.6.4.tgz", + "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==", + "license": "MIT" + }, + "node_modules/@vue/reactivity": { + "version": "3.5.26", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.26.tgz", + "integrity": "sha512-9EnYB1/DIiUYYnzlnUBgwU32NNvLp/nhxLXeWRhHUEeWNTn1ECxX8aGO7RTXeX6PPcxe3LLuNBFoJbV4QZ+CFQ==", + "license": "MIT", + "dependencies": { + "@vue/shared": "3.5.26" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.5.26", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.5.26.tgz", + "integrity": "sha512-xJWM9KH1kd201w5DvMDOwDHYhrdPTrAatn56oB/LRG4plEQeZRQLw0Bpwih9KYoqmzaxF0OKSn6swzYi84e1/Q==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.26", + "@vue/shared": "3.5.26" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.5.26", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.5.26.tgz", + "integrity": "sha512-XLLd/+4sPC2ZkN/6+V4O4gjJu6kSDbHAChvsyWgm1oGbdSO3efvGYnm25yCjtFm/K7rrSDvSfPDgN1pHgS4VNQ==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.26", + "@vue/runtime-core": "3.5.26", + "@vue/shared": "3.5.26", + "csstype": "^3.2.3" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.5.26", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.5.26.tgz", + "integrity": "sha512-TYKLXmrwWKSodyVuO1WAubucd+1XlLg4set0YoV+Hu8Lo79mp/YMwWV5mC5FgtsDxX3qo1ONrxFaTP1OQgy1uA==", + "license": "MIT", + "dependencies": { + "@vue/compiler-ssr": "3.5.26", + "@vue/shared": "3.5.26" + }, + "peerDependencies": { + "vue": "3.5.26" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.26", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.26.tgz", + "integrity": "sha512-7Z6/y3uFI5PRoKeorTOSXKcDj0MSasfNNltcslbFrPpcw6aXRUALq4IfJlaTRspiWIUOEZbrpM+iQGmCOiWe4A==", + "license": "MIT" + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT" + }, + "node_modules/entities": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.0.tgz", + "integrity": "sha512-FDWG5cmEYf2Z00IkYRhbFrwIwvdFKH07uV8dvNy0omp/Qb1xcyCWp2UDtcwJF4QZZvk0sLudP6/hAu42TaqVhQ==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/esbuild": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.2.tgz", + "integrity": "sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.2", + "@esbuild/android-arm": "0.27.2", + "@esbuild/android-arm64": "0.27.2", + "@esbuild/android-x64": "0.27.2", + "@esbuild/darwin-arm64": "0.27.2", + "@esbuild/darwin-x64": "0.27.2", + "@esbuild/freebsd-arm64": "0.27.2", + "@esbuild/freebsd-x64": "0.27.2", + "@esbuild/linux-arm": "0.27.2", + "@esbuild/linux-arm64": "0.27.2", + "@esbuild/linux-ia32": "0.27.2", + "@esbuild/linux-loong64": "0.27.2", + "@esbuild/linux-mips64el": "0.27.2", + "@esbuild/linux-ppc64": "0.27.2", + "@esbuild/linux-riscv64": "0.27.2", + "@esbuild/linux-s390x": "0.27.2", + "@esbuild/linux-x64": "0.27.2", + "@esbuild/netbsd-arm64": "0.27.2", + "@esbuild/netbsd-x64": "0.27.2", + "@esbuild/openbsd-arm64": "0.27.2", + "@esbuild/openbsd-x64": "0.27.2", + "@esbuild/openharmony-arm64": "0.27.2", + "@esbuild/sunos-x64": "0.27.2", + "@esbuild/win32-arm64": "0.27.2", + "@esbuild/win32-ia32": "0.27.2", + "@esbuild/win32-x64": "0.27.2" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/rollup": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.55.1.tgz", + "integrity": "sha512-wDv/Ht1BNHB4upNbK74s9usvl7hObDnvVzknxqY/E/O3X6rW1U1rV1aENEfJ54eFZDTNo7zv1f5N4edCluH7+A==", + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.55.1", + "@rollup/rollup-android-arm64": "4.55.1", + "@rollup/rollup-darwin-arm64": "4.55.1", + "@rollup/rollup-darwin-x64": "4.55.1", + "@rollup/rollup-freebsd-arm64": "4.55.1", + "@rollup/rollup-freebsd-x64": "4.55.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.55.1", + "@rollup/rollup-linux-arm-musleabihf": "4.55.1", + "@rollup/rollup-linux-arm64-gnu": "4.55.1", + "@rollup/rollup-linux-arm64-musl": "4.55.1", + "@rollup/rollup-linux-loong64-gnu": "4.55.1", + "@rollup/rollup-linux-loong64-musl": "4.55.1", + "@rollup/rollup-linux-ppc64-gnu": "4.55.1", + "@rollup/rollup-linux-ppc64-musl": "4.55.1", + "@rollup/rollup-linux-riscv64-gnu": "4.55.1", + "@rollup/rollup-linux-riscv64-musl": "4.55.1", + "@rollup/rollup-linux-s390x-gnu": "4.55.1", + "@rollup/rollup-linux-x64-gnu": "4.55.1", + "@rollup/rollup-linux-x64-musl": "4.55.1", + "@rollup/rollup-openbsd-x64": "4.55.1", + "@rollup/rollup-openharmony-arm64": "4.55.1", + "@rollup/rollup-win32-arm64-msvc": "4.55.1", + "@rollup/rollup-win32-ia32-msvc": "4.55.1", + "@rollup/rollup-win32-x64-gnu": "4.55.1", + "@rollup/rollup-win32-x64-msvc": "4.55.1", + "fsevents": "~2.3.2" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/vite": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.1.tgz", + "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==", + "license": "MIT", + "peer": true, + "dependencies": { + "esbuild": "^0.27.0", + "fdir": "^6.5.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.6", + "rollup": "^4.43.0", + "tinyglobby": "^0.2.15" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "lightningcss": "^1.21.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vue": { + "version": "3.5.26", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.26.tgz", + "integrity": "sha512-SJ/NTccVyAoNUJmkM9KUqPcYlY+u8OVL1X5EW9RIs3ch5H2uERxyyIUI4MRxVCSOiEcupX9xNGde1tL9ZKpimA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@vue/compiler-dom": "3.5.26", + "@vue/compiler-sfc": "3.5.26", + "@vue/runtime-dom": "3.5.26", + "@vue/server-renderer": "3.5.26", + "@vue/shared": "3.5.26" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/vue-router": { + "version": "4.6.4", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.6.4.tgz", + "integrity": "sha512-Hz9q5sa33Yhduglwz6g9skT8OBPii+4bFn88w6J+J4MfEo4KRRpmiNG/hHHkdbRFlLBOqxN8y8gf2Fb0MTUgVg==", + "license": "MIT", + "dependencies": { + "@vue/devtools-api": "^6.6.4" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "vue": "^3.5.0" + } + } + } +} diff --git a/front_vue/package.json b/front_vue/package.json new file mode 100644 index 0000000..b51e5ca --- /dev/null +++ b/front_vue/package.json @@ -0,0 +1,18 @@ +{ + "name": "taskboard", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview --host" + }, + "type": "module", + "dependencies": { + "@vitejs/plugin-vue": "^6.0.3", + "vite": "^7.3.1", + "vue": "^3.5.26", + "vue-router": "^4.6.4" + } +} diff --git a/front_vue/public/config.js b/front_vue/public/config.js new file mode 100644 index 0000000..1435d59 --- /dev/null +++ b/front_vue/public/config.js @@ -0,0 +1,5 @@ +// Конфигурация приложения +window.APP_CONFIG = { + API_BASE: 'http://192.168.1.6' +} + diff --git a/front_vue/src/App.vue b/front_vue/src/App.vue new file mode 100644 index 0000000..1010a52 --- /dev/null +++ b/front_vue/src/App.vue @@ -0,0 +1,41 @@ + + + diff --git a/front_vue/src/api.js b/front_vue/src/api.js new file mode 100644 index 0000000..3b95358 --- /dev/null +++ b/front_vue/src/api.js @@ -0,0 +1,61 @@ +// Базовый URL API (берётся из внешнего config.js) +const API_BASE = window.APP_CONFIG?.API_BASE || 'http://localhost' + +// Базовая функция запроса +const request = async (endpoint, options = {}) => { + const res = await fetch(`${API_BASE}${endpoint}`, options) + return res.json() +} + +// ==================== AUTH ==================== +export const authApi = { + login: (data) => request('/auth', { + method: 'POST', + credentials: 'include', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(data) + }), + check: () => request('/check-auth', { credentials: 'include' }), + logout: () => request('/logout', { credentials: 'include' }) +} + +// ==================== DEPARTMENTS ==================== +export const departmentsApi = { + getAll: () => request('/departments', { credentials: 'include' }) +} + +// ==================== LABELS ==================== +export const labelsApi = { + getAll: () => request('/labels', { credentials: 'include' }) +} + +// ==================== COLUMNS ==================== +export const columnsApi = { + getAll: () => request('/columns', { credentials: 'include' }) +} + +// ==================== CARDS ==================== +export const cardsApi = { + getAll: () => request('/cards', { credentials: 'include' }), + create: (data) => request('/cards', { + method: 'POST', + credentials: 'include', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(data) + }), + update: (id, data) => request(`/cards/${id}`, { + method: 'PUT', + credentials: 'include', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(data) + }), + delete: (id) => request(`/cards/${id}`, { + method: 'DELETE', + credentials: 'include' + }) +} + +// ==================== USERS ==================== +export const usersApi = { + getAll: () => request('/users', { credentials: 'include' }) +} \ No newline at end of file diff --git a/front_vue/src/components/Board.vue b/front_vue/src/components/Board.vue new file mode 100644 index 0000000..14bff5c --- /dev/null +++ b/front_vue/src/components/Board.vue @@ -0,0 +1,217 @@ + + + + + diff --git a/front_vue/src/components/Card.vue b/front_vue/src/components/Card.vue new file mode 100644 index 0000000..d117de4 --- /dev/null +++ b/front_vue/src/components/Card.vue @@ -0,0 +1,281 @@ + + + + + diff --git a/front_vue/src/components/Column.vue b/front_vue/src/components/Column.vue new file mode 100644 index 0000000..eac88c7 --- /dev/null +++ b/front_vue/src/components/Column.vue @@ -0,0 +1,243 @@ + + + + + diff --git a/front_vue/src/components/ConfirmDialog.vue b/front_vue/src/components/ConfirmDialog.vue new file mode 100644 index 0000000..252cb7f --- /dev/null +++ b/front_vue/src/components/ConfirmDialog.vue @@ -0,0 +1,202 @@ + + + + + diff --git a/front_vue/src/components/DatePicker.vue b/front_vue/src/components/DatePicker.vue new file mode 100644 index 0000000..a735a21 --- /dev/null +++ b/front_vue/src/components/DatePicker.vue @@ -0,0 +1,423 @@ + + + + + diff --git a/front_vue/src/components/Header.vue b/front_vue/src/components/Header.vue new file mode 100644 index 0000000..2a466b6 --- /dev/null +++ b/front_vue/src/components/Header.vue @@ -0,0 +1,121 @@ + + + + + diff --git a/front_vue/src/components/Sidebar.vue b/front_vue/src/components/Sidebar.vue new file mode 100644 index 0000000..bb61553 --- /dev/null +++ b/front_vue/src/components/Sidebar.vue @@ -0,0 +1,98 @@ + + + + + diff --git a/front_vue/src/components/TaskPanel.vue b/front_vue/src/components/TaskPanel.vue new file mode 100644 index 0000000..68fccb6 --- /dev/null +++ b/front_vue/src/components/TaskPanel.vue @@ -0,0 +1,1551 @@ + + + + + diff --git a/front_vue/src/main.js b/front_vue/src/main.js new file mode 100644 index 0000000..3e79677 --- /dev/null +++ b/front_vue/src/main.js @@ -0,0 +1,5 @@ +import { createApp } from 'vue' +import App from './App.vue' +import router from './router' + +createApp(App).use(router).mount('#app') diff --git a/front_vue/src/router.js b/front_vue/src/router.js new file mode 100644 index 0000000..6ccd21b --- /dev/null +++ b/front_vue/src/router.js @@ -0,0 +1,57 @@ +import { createRouter, createWebHistory } from 'vue-router' +import MainApp from './views/MainApp.vue' +import LoginPage from './views/LoginPage.vue' +import TeamPage from './views/TeamPage.vue' +import { authApi } from './api' + +// Проверка авторизации +const checkAuth = async () => { + try { + const data = await authApi.check() + return data.status === 'ok' + } catch { + return false + } +} + +const routes = [ + { + path: '/', + name: 'main', + component: MainApp, + meta: { requiresAuth: true } + }, + { + path: '/team', + name: 'team', + component: TeamPage, + meta: { requiresAuth: true } + }, + { + path: '/login', + name: 'login', + component: LoginPage + } +] + +const router = createRouter({ + history: createWebHistory(), + routes +}) + +// Navigation guard — проверка авторизации +router.beforeEach(async (to, from, next) => { + const isAuth = await checkAuth() + + if (to.meta.requiresAuth && !isAuth) { + // Не авторизован — на логин + next('/login') + } else if (to.path === '/login' && isAuth) { + // Уже авторизован — на главную + next('/') + } else { + next() + } +}) + +export default router diff --git a/front_vue/src/views/LoginPage.vue b/front_vue/src/views/LoginPage.vue new file mode 100644 index 0000000..954fc49 --- /dev/null +++ b/front_vue/src/views/LoginPage.vue @@ -0,0 +1,187 @@ + + + + + diff --git a/front_vue/src/views/MainApp.vue b/front_vue/src/views/MainApp.vue new file mode 100644 index 0000000..b378f3a --- /dev/null +++ b/front_vue/src/views/MainApp.vue @@ -0,0 +1,284 @@ + + + + + diff --git a/front_vue/src/views/TeamPage.vue b/front_vue/src/views/TeamPage.vue new file mode 100644 index 0000000..acbfcca --- /dev/null +++ b/front_vue/src/views/TeamPage.vue @@ -0,0 +1,223 @@ + + + + + diff --git a/front_vue/vite.config.js b/front_vue/vite.config.js new file mode 100644 index 0000000..b1c5319 --- /dev/null +++ b/front_vue/vite.config.js @@ -0,0 +1,10 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +export default defineConfig({ + plugins: [vue()], + server: { + host: '0.0.0.0', + port: 5173 + } +})