### Install Syno CLI Source: https://github.com/kwent/syno/blob/master/README.md Install the Syno command-line interface globally using npm. ```bash npm install -g syno ``` -------------------------------- ### Install Syno Node.js Package Source: https://github.com/kwent/syno/blob/master/README.md Install the Syno Node.js wrapper package using npm. ```bash npm install syno ``` -------------------------------- ### Syno CLI API Examples Source: https://github.com/kwent/syno/blob/master/README.md Demonstrates how to use the Syno CLI to interact with various DSM APIs, including DSM, File Station, Download Station, Audio Station, Video Station, and Surveillance Station. ```bash # DSM API - Provide DSM information $ syno dsm getInfo --pretty ``` ```bash # File Station API - Enumerate files in a given folder $ syno fs listFiles --payload '{"folder_path":"/path/to/folder"}' --pretty ``` ```bash # Download Station API - Create a download task $ syno dl createTask --payload '{"uri":"https://link"}' ``` ```bash # Audio Station API - Search a song $ syno as searchSong --payload '{"title":"my_title_song"}' --pretty ``` ```bash # Video Station API - List movies $ syno vs listMovies --payload '{"limit":5}' --pretty ``` ```bash # Video Station DTV API - List channels $ syno dtv listChannels --payload '{"limit":5}' --pretty ``` ```bash # Surveillance Station API - Get camera information $ syno ss getInfoCamera --payload '{"cameraIds":4}' --pretty ``` -------------------------------- ### File Station API - Get Info Source: https://github.com/kwent/syno/blob/master/README.md Retrieve general information about the File Station. ```APIDOC ## File Station API - Get Info ### Description Provide File Station information. ### Method `fs.getInfo()` ### Example ```ts const fsInfo = await syno.fs.getInfo(); ``` ``` -------------------------------- ### Get DSM Information Source: https://github.com/kwent/syno/blob/master/README.md Retrieve general information about the Synology DSM using the DSM API. ```typescript // DSM API - Provide DSM information const dsmInfo = await syno.dsm.getInfo(); ``` -------------------------------- ### DSM API - Get Info Source: https://github.com/kwent/syno/blob/master/README.md Retrieve general information about the DSM. ```APIDOC ## DSM API - Get Info ### Description Provide DSM information. ### Method `dsm.getInfo()` ### Example ```ts const dsmInfo = await syno.dsm.getInfo(); ``` ``` -------------------------------- ### Surveillance Station API - Get Camera Info Source: https://github.com/kwent/syno/blob/master/README.md Retrieve information about specified cameras. ```APIDOC ## Surveillance Station API - Get Camera Info ### Description Get camera information. ### Method `ss.getInfoCamera(params)` ### Parameters #### Query Parameters - **cameraIds** (number) - Required - The ID of the camera. ### Example ```ts const camera = await syno.ss.getInfoCamera({ cameraIds: 4 }); ``` ``` -------------------------------- ### Get File Station Information Source: https://github.com/kwent/syno/blob/master/README.md Retrieve information about the File Station service using the File Station API. ```typescript // File Station API - Provide File Station information const fsInfo = await syno.fs.getInfo(); ``` -------------------------------- ### List Channels in Video Station DTV Source: https://github.com/kwent/syno/blob/master/README.md Get a list of available channels from the Video Station DTV API, with options for limiting results. ```typescript // Video Station DTV API - List channels const channels = await syno.dtv.listChannels({ limit: 5 }); ``` -------------------------------- ### Get Surveillance Station Camera Info Source: https://github.com/kwent/syno/blob/master/README.md Retrieve information about cameras managed by the Surveillance Station API, specifying camera IDs. ```typescript // Surveillance Station API - Get camera information const camera = await syno.ss.getInfoCamera({ cameraIds: 4 }); ``` -------------------------------- ### Syno CLI Help Output Source: https://github.com/kwent/syno/blob/master/README.md Displays the available options and commands for the Syno CLI. ```bash $ syno --help Usage: syno [options] [command] Synology Rest API Command Line Options: -V, --version output the version number -c, --config DSM Configuration file. Default to ~/.syno/config.yaml -u, --url DSM URL. Default to https://admin:password@localhost:5001 -d, --debug Enabling Debugging Output -a, --api DSM API Version. Default to 7.2 -i, --ignore-certificate-errors Ignore certificate errors -h, --help display help for command Commands: diskstationmanager|dsm [options] DSM API filestation|fs [options] DSM File Station API downloadstation|dl [options] DSM Download Station API audiostation|as [options] DSM Audio Station API videostation|vs [options] DSM Video Station API videostationdtv|dtv [options] DSM Video Station DTV API surveillancestation|ss [options] DSM Surveillance Station API synologyphotos|photo [options] DSM Synology Photos API ``` -------------------------------- ### Syno Initialization Source: https://github.com/kwent/syno/blob/master/README.md Initialize the Syno client with your DSM connection details. All methods return Promises. ```APIDOC ## Initialization ```ts import { Syno } from 'syno'; const syno = new Syno({ // Requests protocol: 'http' or 'https' (default: 'http') protocol: 'https', // DSM host: IP or domain name (default: 'localhost') host: 'localhost', // DSM port (default: 5000) port: 5001, // DSM User account (required) account: 'my_username', // DSM User password (required) passwd: 'my_password', // DSM API version (default: '7.2') apiVersion: '7.2', }); ``` All methods return Promises. ``` -------------------------------- ### Build and Development Commands for Syno Source: https://github.com/kwent/syno/blob/master/CLAUDE.md Standard npm scripts for building, testing, linting, and managing API definitions for the Syno project. ```bash # Build (tsdown: ESM + CJS + DTS) npm run build ``` ```bash # Run tests (vitest) npm test ``` ```bash # Run tests in watch mode npm run test:watch ``` ```bash # Lint TypeScript npm run lint ``` ```bash # Type check npm run typecheck ``` ```bash # Clean dist/ npm run clean ``` ```bash # Fetch/compile API definitions npm run fetch-defs # Full pipeline (download + extract + compile) npm run compile-defs # Just merge existing .api/.lib files ``` -------------------------------- ### Initialize Syno with Custom Configuration Source: https://github.com/kwent/syno/blob/master/README.md Initialize the Syno client with specific connection details like protocol, host, port, and user credentials. Ensure Node.js version is >= 24.0.0. ```typescript import { Syno } from 'syno'; const syno = new Syno({ // Requests protocol: 'http' or 'https' (default: 'http') protocol: 'https', // DSM host: IP or domain name (default: 'localhost') host: 'localhost', // DSM port (default: 5000) port: 5001, // DSM User account (required) account: 'my_username', // DSM User password (required) passwd: 'my_password', // DSM API version (default: '7.2') apiVersion: '7.2', }); ``` -------------------------------- ### Syno CLI Usage with Configuration File Source: https://github.com/kwent/syno/blob/master/README.md Executes a Syno CLI command after configuring authentication details in ~/.syno/config.yaml. ```bash $ syno fs getInfo --pretty ``` -------------------------------- ### Syno CLI Authentication via Configuration File Source: https://github.com/kwent/syno/blob/master/README.md Configures DSM connection details in a YAML file located at ~/.syno/config.yaml for Syno CLI authentication. ```yaml # ~/.syno/config.yaml url: protocol: https host: localhost port: 5001 account: admin passwd: password ``` -------------------------------- ### Syno Library Migration: Async/await vs Callbacks Source: https://github.com/kwent/syno/blob/master/README.md Illustrates the change from callback-based asynchronous operations in Syno 2.x to Promise-based async/await in Syno 3.x. ```ts // Before (2.x) syno.fs.getInfo(function(err, data) { ... }); // After (3.x) const data = await syno.fs.getInfo(); ``` -------------------------------- ### Syno CLI: Ignoring Certificate Errors Source: https://github.com/kwent/syno/blob/master/README.md Demonstrates how to bypass certificate verification errors when connecting to DSM via HTTPS using the Syno CLI. ```bash $ syno fs getInfo --ignore-certificate-errors ``` -------------------------------- ### Download Station API - Create Task Source: https://github.com/kwent/syno/blob/master/README.md Create a new download task by providing a URI. ```APIDOC ## Download Station API - Create Task ### Description Create a download task. ### Method `dl.createTask(params)` ### Parameters #### Request Body - **uri** (string) - Required - The URI of the download. ### Example ```ts await syno.dl.createTask({ uri: 'https://link' }); ``` ``` -------------------------------- ### Download Station API - Create Task Source: https://github.com/kwent/syno/blob/master/README.md Creates a new download task in the Download Station. ```APIDOC ## Download Station API - Create Task ### Description Creates a new download task in the Download Station. ### Method `syno dl createTask` ### Parameters #### Request Body - **uri** (string) - Required - The URL of the file to download. ### Request Example ```bash $ syno dl createTask --payload '{"uri":"https://link"}' ``` ### Response (Response structure not detailed in source) ``` -------------------------------- ### Syno Library: Ignoring Certificate Errors in Code Source: https://github.com/kwent/syno/blob/master/README.md Initializes the Syno library with certificate error ignoring enabled. ```ts const syno = new Syno({ ignoreCertificateErrors: true, // ... }); ``` -------------------------------- ### Download Station API - List Tasks Source: https://github.com/kwent/syno/blob/master/README.md List download tasks with pagination options. ```APIDOC ## Download Station API - List Tasks ### Description List download tasks. ### Method `dl.listTasks(params)` ### Parameters #### Query Parameters - **limit** (number) - Optional - The maximum number of tasks to return. - **offset** (number) - Optional - The number of tasks to skip. ### Example ```ts const tasks = await syno.dl.listTasks({ limit: 5, offset: 10 }); ``` ``` -------------------------------- ### Create Download Task Source: https://github.com/kwent/syno/blob/master/README.md Add a new download task to the Download Station by providing a URI. ```typescript // Download Station API - Create a download task await syno.dl.createTask({ uri: 'https://link' }); ``` -------------------------------- ### List Files in Folder Source: https://github.com/kwent/syno/blob/master/README.md Enumerate files and directories within a specified folder path using the File Station API. ```typescript // File Station API - Enumerate files in a given folder const files = await syno.fs.list({ folder_path: '/path/to/folder' }); ``` -------------------------------- ### Syno CLI Authentication via URL Source: https://github.com/kwent/syno/blob/master/README.md Specifies authentication credentials directly within the DSM URL for Syno CLI commands. ```bash $ syno fs getInfo --url https://user:password@localhost:5001 --pretty ``` -------------------------------- ### File Station API - List Files Source: https://github.com/kwent/syno/blob/master/README.md Enumerate files and folders within a specified directory. ```APIDOC ## File Station API - List Files ### Description Enumerate files in a given folder. ### Method `fs.list(params)` ### Parameters #### Query Parameters - **folder_path** (string) - Required - The path to the folder. ### Example ```ts const files = await syno.fs.list({ folder_path: '/path/to/folder' }); ``` ``` -------------------------------- ### List Download Tasks Source: https://github.com/kwent/syno/blob/master/README.md Retrieve a list of current download tasks from the Download Station API, with options for limiting and offsetting results. ```typescript // Download Station API - List download tasks const tasks = await syno.dl.listTasks({ limit: 5, offset: 10 }); ``` -------------------------------- ### Syno CLI Authentication via Environment Variables Source: https://github.com/kwent/syno/blob/master/README.md Sets environment variables for Syno CLI authentication. Ensure these variables are exported in your shell session before running Syno commands. ```bash export SYNO_ACCOUNT=user export SYNO_PASSWORD=password export SYNO_PROTOCOL=https export SYNO_HOST=localhost export SYNO_PORT=5001 ``` -------------------------------- ### Dynamic Method Call Source: https://github.com/kwent/syno/blob/master/README.md Call any API method dynamically by providing its name and parameters. ```APIDOC ## Dynamic Method Call ### Description Call a method dynamically. ### Method `syno..call(methodName, params)` ### Example ```ts const info = await syno.fs.call('getInfo', { folder_path: '/path' }); ``` ``` -------------------------------- ### List Albums in Synology Photos Source: https://github.com/kwent/syno/blob/master/README.md Fetch a list of albums from the Synology Photos API. This feature is available on DSM 7.x and later. ```typescript // Synology Photos API (DSM 7.x) - List albums const albums = await syno.photo.listAlbums(); ``` -------------------------------- ### Syno CLI: Ignoring Certificate Errors via Environment Variable Source: https://github.com/kwent/syno/blob/master/README.md Configures the Syno CLI to ignore certificate errors by setting the SYNO_IGNORE_CERTIFICATE_ERRORS environment variable. ```bash export SYNO_IGNORE_CERTIFICATE_ERRORS=1 ``` -------------------------------- ### Synology Photos API - List Albums Source: https://github.com/kwent/syno/blob/master/README.md List available albums in Synology Photos (DSM 7.x only). ```APIDOC ## Synology Photos API - List Albums ### Description List albums. ### Method `photo.listAlbums()` ### Example ```ts const albums = await syno.photo.listAlbums(); ``` ``` -------------------------------- ### Video Station API - List Movies Source: https://github.com/kwent/syno/blob/master/README.md List available movies with pagination options. ```APIDOC ## Video Station API - List Movies ### Description List movies. ### Method `vs.listMovies(params)` ### Parameters #### Query Parameters - **limit** (number) - Optional - The maximum number of movies to return. ### Example ```ts const movies = await syno.vs.listMovies({ limit: 5 }); ``` ``` -------------------------------- ### List Movies in Video Station Source: https://github.com/kwent/syno/blob/master/README.md Retrieve a list of movies from the Video Station API, with options for limiting the number of results. ```typescript // Video Station API - List movies const movies = await syno.vs.listMovies({ limit: 5 }); ``` -------------------------------- ### Video Station DTV API - List Channels Source: https://github.com/kwent/syno/blob/master/README.md List available DTV channels with pagination options. ```APIDOC ## Video Station DTV API - List Channels ### Description List channels. ### Method `dtv.listChannels(params)` ### Parameters #### Query Parameters - **limit** (number) - Optional - The maximum number of channels to return. ### Example ```ts const channels = await syno.dtv.listChannels({ limit: 5 }); ``` ``` -------------------------------- ### Video Station API - List Movies Source: https://github.com/kwent/syno/blob/master/README.md Lists movies available in the Video Station. ```APIDOC ## Video Station API - List Movies ### Description Lists movies available in the Video Station. ### Method `syno vs listMovies` ### Parameters #### Request Body - **limit** (integer) - Optional - The maximum number of movies to return. ### Request Example ```bash $ syno vs listMovies --payload '{"limit":5}' --pretty ``` ### Response (Response structure not detailed in source, but `--pretty` suggests JSON output) ``` -------------------------------- ### Video Station DTV API - List Channels Source: https://github.com/kwent/syno/blob/master/README.md Lists available channels in the Video Station DTV service. ```APIDOC ## Video Station DTV API - List Channels ### Description Lists available channels in the Video Station DTV service. ### Method `syno dtv listChannels` ### Parameters #### Request Body - **limit** (integer) - Optional - The maximum number of channels to return. ### Request Example ```bash $ syno dtv listChannels --payload '{"limit":5}' --pretty ``` ### Response (Response structure not detailed in source, but `--pretty` suggests JSON output) ``` -------------------------------- ### Search Songs in Audio Station Source: https://github.com/kwent/syno/blob/master/README.md Search for songs within the Audio Station API based on criteria like title. ```typescript // Audio Station API - Search a song const songs = await syno.as.searchSong({ title: 'my_title_song' }); ``` -------------------------------- ### Call Syno Method with Promise Source: https://github.com/kwent/syno/blob/master/README.md Execute a Syno API method and handle the result using Promises. ```typescript const info = await syno.fs.getInfo(); ``` -------------------------------- ### Audio Station API - Search Song Source: https://github.com/kwent/syno/blob/master/README.md Search for songs based on provided criteria. ```APIDOC ## Audio Station API - Search Song ### Description Search a song. ### Method `as.searchSong(params)` ### Parameters #### Query Parameters - **title** (string) - Required - The title of the song to search for. ### Example ```ts const songs = await syno.as.searchSong({ title: 'my_title_song' }); ``` ``` -------------------------------- ### Call Syno Method Dynamically Source: https://github.com/kwent/syno/blob/master/README.md Invoke a Syno API method dynamically by specifying the method name and parameters. ```typescript const info = await syno.fs.call('getInfo', { folder_path: '/path' }); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.