Skip to content

rclone-ui/rclone-openapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rclone OpenAPI

npm version npm downloads License: MIT

OpenAPI 3.1 specification for the Rclone RC API.

Installation

npm install rclone-openapi

Usage

Import the OpenAPI Schema

// ESM
import schema from 'rclone-openapi';

// CommonJS
const schema = require('rclone-openapi');

Or import directly:

import schema from 'rclone-openapi/openapi.json';

The YAML version is also available at openapi.yaml.

TypeScript Types

This package includes auto-generated TypeScript types for the Rclone RC API:

import type { paths, operations, components } from 'rclone-openapi';

// Example: Type for the /config/listremotes response
type ListRemotesResponse = paths['/config/listremotes']['post']['responses']['200']['content']['application/json'];

// Example: Type for operations
type CopyFileParams = operations['operationsCopyfile']['parameters']['query'];

Works great with API clients like openapi-fetch:

import createClient from 'openapi-fetch';
import type { paths } from 'rclone-openapi';

const client = createClient<paths>({ baseUrl: 'http://localhost:5572' });

const { data, error } = await client.POST('/config/listremotes');

Files

File Description
openapi.json OpenAPI 3.1 specification (JSON)
openapi.yaml OpenAPI 3.1 specification (YAML)
types.d.ts TypeScript type definitions

Development

Generate the JSON schema and TypeScript types from the YAML source:

npm run gen        # Generate both JSON and types
npm run gen:json   # Generate JSON only
npm run gen:types  # Generate TypeScript types only

Related

License

MIT



Made with ☁️ for the rclone community

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published