-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpluginAPI-V0.yml
More file actions
172 lines (162 loc) · 3.94 KB
/
pluginAPI-V0.yml
File metadata and controls
172 lines (162 loc) · 3.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
swagger: "2.0"
info:
title: DeWeb Plugin API
description: API for the DeWeb Plugin in MassaStation
version: 0.0.1
schemes:
- http
paths:
/web/{resource}:
get:
description: Plugin Frontend router.
operationId: PluginWebApp
produces:
- application/json
- text/javascript
- text/html
- text/css
- text/webp
- image/png
parameters:
- in: path
name: resource
required: true
type: string
description: Website resource.
responses:
"200":
description: Page found
"404":
description: Resource not found.
schema:
$ref: "#/definitions/Error"
/:
get:
description: Handle the default page of the plugin
operationId: DefaultPage
responses:
"302":
description: Redirect to /web
/api/server/status:
get:
description: Get the current server status
operationId: GetServerStatus
produces:
- application/json
responses:
"200":
description: Current server status
schema:
$ref: "#/definitions/ServerStatus"
/api/settings:
get:
description: Get the current plugin settings
operationId: GetSettings
produces:
- application/json
responses:
"200":
description: Current settings
schema:
$ref: "#/definitions/Settings"
put:
description: Update plugin settings
operationId: UpdateSettings
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: settings
description: New settings
required: true
schema:
$ref: "#/definitions/Settings"
responses:
"200":
description: Settings updated successfully
"400":
description: Error updating settings
schema:
$ref: "#/definitions/Error"
definitions:
Error:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
required:
- code
- message
NetworkInfoItem:
type: object
description: Detailed network information
properties:
name:
type: string
url:
type: string
chainId:
type: integer
version:
type: string
status:
type: string
enum: [up, down]
ServerStatus:
type: object
properties:
status:
type: string
enum: [running, stopped, starting, stopping, error]
serverPort:
type: integer
format: int32
description: The port the server is running on
errorMessage:
type: string
description: Error message if server failed to start or is in error state
network:
type: object
$ref: "#/definitions/NetworkInfoItem"
Settings:
type: object
properties:
networkUrl:
type: string
description: The network node URL to connect to
serverPort:
type: integer
format: int32
description: The port the server is running on
cache:
$ref: "#/definitions/CacheSettings"
required:
- networkUrl
CacheSettings:
type: object
properties:
enabled:
type: boolean
description: Whether caching is enabled
siteRamCacheMaxItems:
type: integer
format: int32
description: Maximum number of files stored in RAM cache
siteDiskCacheMaxItems:
type: integer
format: int32
description: Maximum number of files stored in disk cache
diskCacheDir:
type: string
description: Directory to store the disk cache
fileListCacheDurationSeconds:
type: integer
format: int32
description: Duration in seconds for file list cache
required:
- enabled