rclone-openapi 1.72.0 → 1.72.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -0
- package/openapi.json +1 -1
- package/openapi.yaml +1 -1
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Rclone OpenAPI
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/rclone-openapi)
|
|
4
|
+
[](https://www.npmjs.com/package/rclone-openapi)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
OpenAPI 3.1 specification for the [**Rclone RC API**](https://rclone.org/rc/).
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install rclone-openapi
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
### Import the OpenAPI Schema
|
|
18
|
+
|
|
19
|
+
```javascript
|
|
20
|
+
// ESM
|
|
21
|
+
import schema from 'rclone-openapi';
|
|
22
|
+
|
|
23
|
+
// CommonJS
|
|
24
|
+
const schema = require('rclone-openapi');
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or import directly:
|
|
28
|
+
|
|
29
|
+
```javascript
|
|
30
|
+
import schema from 'rclone-openapi/openapi.json';
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The YAML version is also available at **`openapi.yaml`**.
|
|
34
|
+
|
|
35
|
+
### TypeScript Types
|
|
36
|
+
|
|
37
|
+
This package includes auto-generated TypeScript types for the Rclone RC API:
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import type { paths, operations, components } from 'rclone-openapi';
|
|
41
|
+
|
|
42
|
+
// Example: Type for the /config/listremotes response
|
|
43
|
+
type ListRemotesResponse = paths['/config/listremotes']['post']['responses']['200']['content']['application/json'];
|
|
44
|
+
|
|
45
|
+
// Example: Type for operations
|
|
46
|
+
type CopyFileParams = operations['operationsCopyfile']['parameters']['query'];
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Works great with API clients like [**openapi-fetch**](https://openapi-ts.dev/openapi-fetch/):
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import createClient from 'openapi-fetch';
|
|
53
|
+
import type { paths } from 'rclone-openapi';
|
|
54
|
+
|
|
55
|
+
const client = createClient<paths>({ baseUrl: 'http://localhost:5572' });
|
|
56
|
+
|
|
57
|
+
const { data, error } = await client.POST('/config/listremotes');
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Files
|
|
61
|
+
|
|
62
|
+
| File | Description |
|
|
63
|
+
|------|-------------|
|
|
64
|
+
| **`openapi.json`** | OpenAPI 3.1 specification (JSON) |
|
|
65
|
+
| **`openapi.yaml`** | OpenAPI 3.1 specification (YAML) |
|
|
66
|
+
| **`types.d.ts`** | TypeScript type definitions |
|
|
67
|
+
|
|
68
|
+
## Development
|
|
69
|
+
|
|
70
|
+
Generate the JSON schema and TypeScript types from the YAML source:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npm run gen # Generate both JSON and types
|
|
74
|
+
npm run gen:json # Generate JSON only
|
|
75
|
+
npm run gen:types # Generate TypeScript types only
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Related
|
|
79
|
+
|
|
80
|
+
- [**Rclone SDK**](https://github.com/rclone-ui/rclone-sdk) — Ready-to-use client built on this spec (supports Rust and Javascript/Typescript)
|
|
81
|
+
- [**Rclone** RC API Documentation](https://rclone.org/rc/)
|
|
82
|
+
- [**Rclone**](https://rclone.org/) — Cloud storage sync tool
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
MIT
|
|
87
|
+
|
|
88
|
+
<br />
|
|
89
|
+
<br />
|
|
90
|
+
|
|
91
|
+
<div align="center">
|
|
92
|
+
<sub>Made with ☁️ for the rclone community</sub>
|
|
93
|
+
</div>
|
package/openapi.json
CHANGED
package/openapi.yaml
CHANGED