@meowpanel/api 0.1.0-alpha.10 → 1.0.0-beta.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.

Potentially problematic release.


This version of @meowpanel/api might be problematic. Click here for more details.

Files changed (297) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +40 -0
  3. package/esm/mod.d.ts +87 -1
  4. package/esm/mod.d.ts.map +1 -1
  5. package/esm/mod.js +85 -1
  6. package/esm/src/client.d.ts +233 -0
  7. package/esm/src/client.d.ts.map +1 -0
  8. package/esm/src/client.js +216 -0
  9. package/esm/src/emitter.d.ts +53 -0
  10. package/esm/src/emitter.d.ts.map +1 -0
  11. package/esm/src/emitter.js +55 -0
  12. package/esm/src/errors.d.ts +42 -0
  13. package/esm/src/errors.d.ts.map +1 -0
  14. package/esm/src/errors.js +45 -0
  15. package/esm/src/http.d.ts +144 -0
  16. package/esm/src/http.d.ts.map +1 -0
  17. package/esm/src/http.js +246 -0
  18. package/esm/src/namespace.d.ts +59 -0
  19. package/esm/src/namespace.d.ts.map +1 -0
  20. package/esm/src/namespace.js +79 -0
  21. package/esm/src/reactive.d.ts +29 -0
  22. package/esm/src/reactive.d.ts.map +1 -0
  23. package/esm/src/reactive.js +35 -0
  24. package/esm/src/resources/account.d.ts +125 -0
  25. package/esm/src/resources/account.d.ts.map +1 -0
  26. package/esm/src/resources/account.js +151 -0
  27. package/esm/src/resources/api-keys.d.ts +116 -0
  28. package/esm/src/resources/api-keys.d.ts.map +1 -0
  29. package/esm/src/resources/api-keys.js +105 -0
  30. package/esm/src/resources/auth.d.ts +39 -0
  31. package/esm/src/resources/auth.d.ts.map +1 -0
  32. package/esm/src/resources/auth.js +27 -0
  33. package/esm/src/resources/eggs.d.ts +238 -0
  34. package/esm/src/resources/eggs.d.ts.map +1 -0
  35. package/esm/src/resources/eggs.js +187 -0
  36. package/esm/src/resources/hosts.d.ts +62 -0
  37. package/esm/src/resources/hosts.d.ts.map +1 -0
  38. package/esm/src/resources/hosts.js +62 -0
  39. package/esm/src/resources/members.d.ts +138 -0
  40. package/esm/src/resources/members.d.ts.map +1 -0
  41. package/esm/src/resources/members.js +122 -0
  42. package/esm/src/resources/nodes.d.ts +397 -0
  43. package/esm/src/resources/nodes.d.ts.map +1 -0
  44. package/esm/src/resources/nodes.js +352 -0
  45. package/esm/src/resources/server-groups.d.ts +150 -0
  46. package/esm/src/resources/server-groups.d.ts.map +1 -0
  47. package/esm/src/resources/server-groups.js +111 -0
  48. package/esm/src/resources/servers/activity.d.ts +120 -0
  49. package/esm/src/resources/servers/activity.d.ts.map +1 -0
  50. package/esm/src/resources/servers/activity.js +163 -0
  51. package/esm/src/resources/servers/allocations.d.ts +125 -0
  52. package/esm/src/resources/servers/allocations.d.ts.map +1 -0
  53. package/esm/src/resources/servers/allocations.js +137 -0
  54. package/esm/src/resources/servers/connection.d.ts +108 -0
  55. package/esm/src/resources/servers/connection.d.ts.map +1 -0
  56. package/esm/src/resources/servers/connection.js +169 -0
  57. package/esm/src/resources/servers/files.d.ts +164 -0
  58. package/esm/src/resources/servers/files.d.ts.map +1 -0
  59. package/esm/src/resources/servers/files.js +281 -0
  60. package/esm/src/resources/servers/index.d.ts +126 -0
  61. package/esm/src/resources/servers/index.d.ts.map +1 -0
  62. package/esm/src/resources/servers/index.js +135 -0
  63. package/esm/src/resources/servers/profiles.d.ts +138 -0
  64. package/esm/src/resources/servers/profiles.d.ts.map +1 -0
  65. package/esm/src/resources/servers/profiles.js +177 -0
  66. package/esm/src/resources/servers/server.d.ts +136 -0
  67. package/esm/src/resources/servers/server.d.ts.map +1 -0
  68. package/esm/src/resources/servers/server.js +202 -0
  69. package/esm/src/resources/servers/sftp.d.ts +147 -0
  70. package/esm/src/resources/servers/sftp.d.ts.map +1 -0
  71. package/esm/src/resources/servers/sftp.js +153 -0
  72. package/esm/src/resources/servers/types.d.ts +199 -0
  73. package/esm/src/resources/servers/types.d.ts.map +1 -0
  74. package/esm/src/resources/servers/types.js +1 -0
  75. package/esm/src/sse.d.ts +51 -0
  76. package/esm/src/sse.d.ts.map +1 -0
  77. package/esm/src/sse.js +129 -0
  78. package/esm/src/types.d.ts +126 -0
  79. package/esm/src/types.d.ts.map +1 -0
  80. package/esm/src/types.js +21 -0
  81. package/package.json +4 -92
  82. package/script/mod.d.ts +87 -1
  83. package/script/mod.d.ts.map +1 -1
  84. package/script/mod.js +132 -3
  85. package/script/src/client.d.ts +233 -0
  86. package/script/src/client.d.ts.map +1 -0
  87. package/script/src/client.js +220 -0
  88. package/script/src/emitter.d.ts +53 -0
  89. package/script/src/emitter.d.ts.map +1 -0
  90. package/script/src/emitter.js +59 -0
  91. package/script/src/errors.d.ts +42 -0
  92. package/script/src/errors.d.ts.map +1 -0
  93. package/script/src/errors.js +49 -0
  94. package/script/src/http.d.ts +144 -0
  95. package/script/src/http.d.ts.map +1 -0
  96. package/script/src/http.js +250 -0
  97. package/script/src/namespace.d.ts +59 -0
  98. package/script/src/namespace.d.ts.map +1 -0
  99. package/script/src/namespace.js +83 -0
  100. package/script/src/reactive.d.ts +29 -0
  101. package/script/src/reactive.d.ts.map +1 -0
  102. package/script/src/reactive.js +39 -0
  103. package/script/src/resources/account.d.ts +125 -0
  104. package/script/src/resources/account.d.ts.map +1 -0
  105. package/script/src/resources/account.js +158 -0
  106. package/script/src/resources/api-keys.d.ts +116 -0
  107. package/script/src/resources/api-keys.d.ts.map +1 -0
  108. package/script/src/resources/api-keys.js +110 -0
  109. package/script/src/resources/auth.d.ts +39 -0
  110. package/script/src/resources/auth.d.ts.map +1 -0
  111. package/script/src/resources/auth.js +31 -0
  112. package/script/src/resources/eggs.d.ts +238 -0
  113. package/script/src/resources/eggs.d.ts.map +1 -0
  114. package/script/src/resources/eggs.js +193 -0
  115. package/script/src/resources/hosts.d.ts +62 -0
  116. package/script/src/resources/hosts.d.ts.map +1 -0
  117. package/script/src/resources/hosts.js +67 -0
  118. package/script/src/resources/members.d.ts +138 -0
  119. package/script/src/resources/members.d.ts.map +1 -0
  120. package/script/src/resources/members.js +127 -0
  121. package/script/src/resources/nodes.d.ts +397 -0
  122. package/script/src/resources/nodes.d.ts.map +1 -0
  123. package/script/src/resources/nodes.js +362 -0
  124. package/script/src/resources/server-groups.d.ts +150 -0
  125. package/script/src/resources/server-groups.d.ts.map +1 -0
  126. package/script/src/resources/server-groups.js +116 -0
  127. package/script/src/resources/servers/activity.d.ts +120 -0
  128. package/script/src/resources/servers/activity.d.ts.map +1 -0
  129. package/script/src/resources/servers/activity.js +170 -0
  130. package/script/src/resources/servers/allocations.d.ts +125 -0
  131. package/script/src/resources/servers/allocations.d.ts.map +1 -0
  132. package/script/src/resources/servers/allocations.js +142 -0
  133. package/script/src/resources/servers/connection.d.ts +108 -0
  134. package/script/src/resources/servers/connection.d.ts.map +1 -0
  135. package/script/src/resources/servers/connection.js +173 -0
  136. package/script/src/resources/servers/files.d.ts +164 -0
  137. package/script/src/resources/servers/files.d.ts.map +1 -0
  138. package/script/src/resources/servers/files.js +286 -0
  139. package/script/src/resources/servers/index.d.ts +126 -0
  140. package/script/src/resources/servers/index.d.ts.map +1 -0
  141. package/script/src/resources/servers/index.js +139 -0
  142. package/script/src/resources/servers/profiles.d.ts +138 -0
  143. package/script/src/resources/servers/profiles.d.ts.map +1 -0
  144. package/script/src/resources/servers/profiles.js +182 -0
  145. package/script/src/resources/servers/server.d.ts +136 -0
  146. package/script/src/resources/servers/server.d.ts.map +1 -0
  147. package/script/src/resources/servers/server.js +206 -0
  148. package/script/src/resources/servers/sftp.d.ts +147 -0
  149. package/script/src/resources/servers/sftp.d.ts.map +1 -0
  150. package/script/src/resources/servers/sftp.js +158 -0
  151. package/script/src/resources/servers/types.d.ts +199 -0
  152. package/script/src/resources/servers/types.d.ts.map +1 -0
  153. package/script/src/resources/servers/types.js +2 -0
  154. package/script/src/sse.d.ts +51 -0
  155. package/script/src/sse.d.ts.map +1 -0
  156. package/script/src/sse.js +133 -0
  157. package/script/src/types.d.ts +126 -0
  158. package/script/src/types.d.ts.map +1 -0
  159. package/script/src/types.js +25 -0
  160. package/esm/api.d.ts +0 -76
  161. package/esm/api.d.ts.map +0 -1
  162. package/esm/api.js +0 -187
  163. package/esm/components/auth.d.ts +0 -15
  164. package/esm/components/auth.d.ts.map +0 -1
  165. package/esm/components/auth.js +0 -13
  166. package/esm/components/connection/abstract.d.ts +0 -23
  167. package/esm/components/connection/abstract.d.ts.map +0 -1
  168. package/esm/components/connection/abstract.js +0 -43
  169. package/esm/components/connection/sse.d.ts +0 -20
  170. package/esm/components/connection/sse.d.ts.map +0 -1
  171. package/esm/components/connection/sse.js +0 -65
  172. package/esm/components/egg/egg.d.ts +0 -32
  173. package/esm/components/egg/egg.d.ts.map +0 -1
  174. package/esm/components/egg/egg.js +0 -70
  175. package/esm/components/group.d.ts +0 -14
  176. package/esm/components/group.d.ts.map +0 -1
  177. package/esm/components/group.js +0 -33
  178. package/esm/components/member_2.d.ts +0 -69
  179. package/esm/components/member_2.d.ts.map +0 -1
  180. package/esm/components/member_2.js +0 -140
  181. package/esm/components/node.d.ts +0 -78
  182. package/esm/components/node.d.ts.map +0 -1
  183. package/esm/components/node.js +0 -342
  184. package/esm/components/server/activity.d.ts +0 -45
  185. package/esm/components/server/activity.d.ts.map +0 -1
  186. package/esm/components/server/activity.js +0 -158
  187. package/esm/components/server/allocations.d.ts +0 -45
  188. package/esm/components/server/allocations.d.ts.map +0 -1
  189. package/esm/components/server/allocations.js +0 -146
  190. package/esm/components/server/files.d.ts +0 -50
  191. package/esm/components/server/files.d.ts.map +0 -1
  192. package/esm/components/server/files.js +0 -90
  193. package/esm/components/server/power.d.ts +0 -21
  194. package/esm/components/server/power.d.ts.map +0 -1
  195. package/esm/components/server/power.js +0 -43
  196. package/esm/components/server/profiles.d.ts +0 -63
  197. package/esm/components/server/profiles.d.ts.map +0 -1
  198. package/esm/components/server/profiles.js +0 -163
  199. package/esm/components/server/server.d.ts +0 -141
  200. package/esm/components/server/server.d.ts.map +0 -1
  201. package/esm/components/server/server.js +0 -358
  202. package/esm/components/server/sftp.d.ts +0 -31
  203. package/esm/components/server/sftp.d.ts.map +0 -1
  204. package/esm/components/server/sftp.js +0 -84
  205. package/esm/components/server/startup.d.ts +0 -17
  206. package/esm/components/server/startup.d.ts.map +0 -1
  207. package/esm/components/server/startup.js +0 -21
  208. package/esm/components/server/stats.d.ts +0 -19
  209. package/esm/components/server/stats.d.ts.map +0 -1
  210. package/esm/components/server/stats.js +0 -46
  211. package/esm/utils/cache.d.ts +0 -20
  212. package/esm/utils/cache.d.ts.map +0 -1
  213. package/esm/utils/cache.js +0 -66
  214. package/esm/utils/event.d.ts +0 -38
  215. package/esm/utils/event.d.ts.map +0 -1
  216. package/esm/utils/event.js +0 -71
  217. package/esm/utils/object.d.ts +0 -58
  218. package/esm/utils/object.d.ts.map +0 -1
  219. package/esm/utils/object.js +0 -86
  220. package/esm/utils/subscribe.d.ts +0 -37
  221. package/esm/utils/subscribe.d.ts.map +0 -1
  222. package/esm/utils/subscribe.js +0 -29
  223. package/esm/utils/timer.d.ts +0 -13
  224. package/esm/utils/timer.d.ts.map +0 -1
  225. package/esm/utils/timer.js +0 -32
  226. package/esm/utils/units.d.ts +0 -18
  227. package/esm/utils/units.d.ts.map +0 -1
  228. package/esm/utils/units.js +0 -82
  229. package/script/api.d.ts +0 -76
  230. package/script/api.d.ts.map +0 -1
  231. package/script/api.js +0 -192
  232. package/script/components/auth.d.ts +0 -15
  233. package/script/components/auth.d.ts.map +0 -1
  234. package/script/components/auth.js +0 -17
  235. package/script/components/connection/abstract.d.ts +0 -23
  236. package/script/components/connection/abstract.d.ts.map +0 -1
  237. package/script/components/connection/abstract.js +0 -47
  238. package/script/components/connection/sse.d.ts +0 -20
  239. package/script/components/connection/sse.d.ts.map +0 -1
  240. package/script/components/connection/sse.js +0 -69
  241. package/script/components/egg/egg.d.ts +0 -32
  242. package/script/components/egg/egg.d.ts.map +0 -1
  243. package/script/components/egg/egg.js +0 -74
  244. package/script/components/group.d.ts +0 -14
  245. package/script/components/group.d.ts.map +0 -1
  246. package/script/components/group.js +0 -37
  247. package/script/components/member_2.d.ts +0 -69
  248. package/script/components/member_2.d.ts.map +0 -1
  249. package/script/components/member_2.js +0 -146
  250. package/script/components/node.d.ts +0 -78
  251. package/script/components/node.d.ts.map +0 -1
  252. package/script/components/node.js +0 -349
  253. package/script/components/server/activity.d.ts +0 -45
  254. package/script/components/server/activity.d.ts.map +0 -1
  255. package/script/components/server/activity.js +0 -164
  256. package/script/components/server/allocations.d.ts +0 -45
  257. package/script/components/server/allocations.d.ts.map +0 -1
  258. package/script/components/server/allocations.js +0 -152
  259. package/script/components/server/files.d.ts +0 -50
  260. package/script/components/server/files.d.ts.map +0 -1
  261. package/script/components/server/files.js +0 -94
  262. package/script/components/server/power.d.ts +0 -21
  263. package/script/components/server/power.d.ts.map +0 -1
  264. package/script/components/server/power.js +0 -47
  265. package/script/components/server/profiles.d.ts +0 -63
  266. package/script/components/server/profiles.d.ts.map +0 -1
  267. package/script/components/server/profiles.js +0 -168
  268. package/script/components/server/server.d.ts +0 -141
  269. package/script/components/server/server.d.ts.map +0 -1
  270. package/script/components/server/server.js +0 -362
  271. package/script/components/server/sftp.d.ts +0 -31
  272. package/script/components/server/sftp.d.ts.map +0 -1
  273. package/script/components/server/sftp.js +0 -88
  274. package/script/components/server/startup.d.ts +0 -17
  275. package/script/components/server/startup.d.ts.map +0 -1
  276. package/script/components/server/startup.js +0 -25
  277. package/script/components/server/stats.d.ts +0 -19
  278. package/script/components/server/stats.d.ts.map +0 -1
  279. package/script/components/server/stats.js +0 -50
  280. package/script/utils/cache.d.ts +0 -20
  281. package/script/utils/cache.d.ts.map +0 -1
  282. package/script/utils/cache.js +0 -70
  283. package/script/utils/event.d.ts +0 -38
  284. package/script/utils/event.d.ts.map +0 -1
  285. package/script/utils/event.js +0 -75
  286. package/script/utils/object.d.ts +0 -58
  287. package/script/utils/object.d.ts.map +0 -1
  288. package/script/utils/object.js +0 -90
  289. package/script/utils/subscribe.d.ts +0 -37
  290. package/script/utils/subscribe.d.ts.map +0 -1
  291. package/script/utils/subscribe.js +0 -32
  292. package/script/utils/timer.d.ts +0 -13
  293. package/script/utils/timer.d.ts.map +0 -1
  294. package/script/utils/timer.js +0 -36
  295. package/script/utils/units.d.ts +0 -18
  296. package/script/utils/units.d.ts.map +0 -1
  297. package/script/utils/units.js +0 -86
package/script/mod.d.ts CHANGED
@@ -1,2 +1,88 @@
1
- export { MeowPanelApi } from './api.js';
1
+ /**
2
+ * # @meowpanel/api
3
+ *
4
+ * TypeScript client library for the MeowPanel platform.
5
+ * Provides typed access to MeowPanel API endpoints.
6
+ *
7
+ * ## Quick start
8
+ *
9
+ * ```typescript
10
+ * import { MeowPanelApi } from "@meowpanel/api";
11
+ *
12
+ * const api = new MeowPanelApi({
13
+ * url: "https://panel.example.com",
14
+ * token: "your-api-key",
15
+ * });
16
+ *
17
+ * // List servers with type-safe includes
18
+ * const { data: servers } = await api.servers.list({ include: ["group", "status"] });
19
+ * for (const server of servers) {
20
+ * console.log(server.name, server.group.nodeId, server.status.state);
21
+ * }
22
+ *
23
+ * // Manage files on a server
24
+ * const server = await api.servers.get(servers[0].id);
25
+ * const entries = await server.files.list("/");
26
+ * await server.files.write("/motd.txt", "Hello World");
27
+ *
28
+ * // Real-time console via SSE
29
+ * const conn = await server.createConnection();
30
+ * conn.on("console_output", (line) => console.log(line));
31
+ * conn.on("stats", (stats) => console.log(`CPU: ${stats.cpuAbsolute}%`));
32
+ * await conn.open();
33
+ * ```
34
+ *
35
+ * ## Features
36
+ *
37
+ * - **Type-safe includes** - `list({ include: ["group"] })` narrows the return type so included fields are guaranteed non-undefined.
38
+ * - **Reactive stores** - All namespaces and resources implement a `subscribe()` contract for use in Svelte or other reactive frameworks.
39
+ * - **Typed events** - Listen for mutations with `api.servers.on("created", (server) => ...)`.
40
+ * - **File management** - Full CRUD, compression, chmod, and multipart upload via the node daemon.
41
+ * - **SSE connections** - Real-time console output, power state, and resource utilization streaming.
42
+ *
43
+ * @module
44
+ */
45
+ export { MeowPanelApi } from './src/client.js';
46
+ export type { MeowPanelApiOptions } from './src/client.js';
47
+ export { AuthResource } from './src/resources/auth.js';
48
+ export type { AuthMeta, AuthProvider } from './src/resources/auth.js';
49
+ export { ReactiveResource } from './src/reactive.js';
50
+ export { ApiError } from './src/errors.js';
51
+ export type { ApiErrorOptions } from './src/errors.js';
52
+ export { HttpClient } from './src/http.js';
53
+ export type { HttpClientOptions, HttpLogCode, HttpLogEvent, HttpLogger, HttpRequestErrorLogEvent, HttpRequestStartLogEvent, HttpRequestSuccessLogEvent, RequestOptions, } from './src/http.js';
54
+ export { TypedEmitter } from './src/emitter.js';
55
+ export type { EventHandler } from './src/emitter.js';
56
+ export { SseConnection } from './src/sse.js';
57
+ export type { SseState } from './src/sse.js';
58
+ export { joinIncludes, toNanoID } from './src/types.js';
59
+ export type { IncludeOptions, ISODate, ListOptions, NanoID, Paginated, PowerSignal, PowerState, ResourceWith, ServerRestrictedState, SftpPermission, UnionToIntersection, } from './src/types.js';
60
+ export { Account, AccountResource, ApiKeyAccount, UserAccount } from './src/resources/account.js';
61
+ export type { AccountInclude, UpdateAccountPayload } from './src/resources/account.js';
62
+ export { ApiKey, ApiKeysNamespace } from './src/resources/api-keys.js';
63
+ export type { ApiKeyEvents, CreateApiKeyPayload, CreateApiKeyResult } from './src/resources/api-keys.js';
64
+ export { Member, MembersNamespace } from './src/resources/members.js';
65
+ export type { MemberData, MemberDisplay, MemberEvents, MemberInclude, MemberWith, UpdateMemberPayload, } from './src/resources/members.js';
66
+ export { Node, NodeAllocationIp, NodeAllocationPort, NodeAllocationsManager, NodeLocation, NodesNamespace, NodeType, } from './src/resources/nodes.js';
67
+ export type { CreateNodeAllocationIpPayload, CreateNodeAllocationPortsPayload, CreateNodePayload, LogNodeActivityPayload, NodeAllocationIpData, NodeAllocationPortData, NodeConnection, NodeData, NodeEvents, NodeHostData, NodeInclude, NodeLimits, NodeLocationData, NodeTypeData, NodeWith, UpdateNodeAllocationIpPayload, UpdateNodeAllocationPortPayload, } from './src/resources/nodes.js';
68
+ export { Egg, EggNest, EggsNamespace } from './src/resources/eggs.js';
69
+ export type { EggData, EggEvents, EggImage, EggImageData, EggInclude, EggInstaller, EggInstallerData, EggNestData, EggProcess, EggWith, UpdateEggPayload, } from './src/resources/eggs.js';
70
+ export { Host, HostsNamespace } from './src/resources/hosts.js';
71
+ export type { HostData } from './src/resources/hosts.js';
72
+ export { ServerGroup, ServerGroupsNamespace } from './src/resources/server-groups.js';
73
+ export type { CreateServerGroupPayload, ServerGroupData, ServerGroupEvents, ServerGroupLimits, ServerGroupLimitsData, } from './src/resources/server-groups.js';
74
+ export { ServersNamespace } from './src/resources/servers/index.js';
75
+ export type { CreateServerPayload, ServerEvents, ServerInclude, ServerWith, UpdateServerPayload, } from './src/resources/servers/index.js';
76
+ export { Server } from './src/resources/servers/server.js';
77
+ export type { ServerBuild, ServerStartup, ServerStatus, StartupVariable } from './src/resources/servers/server.js';
78
+ export { ServerConnection } from './src/resources/servers/connection.js';
79
+ export type { ServerConnectionEvents, ServerUtilization } from './src/resources/servers/connection.js';
80
+ export { FileEntry, ServerFilesManager } from './src/resources/servers/files.js';
81
+ export { ServerSftpManager, SftpUser } from './src/resources/servers/sftp.js';
82
+ export type { AddAllocationEntry } from './src/resources/servers/allocations.js';
83
+ export type { SftpConnection, SftpDetails, SftpUserInclude, SftpUserWith } from './src/resources/servers/sftp.js';
84
+ export { ServerAllocationPort, ServerAllocationsManager } from './src/resources/servers/allocations.js';
85
+ export type { AllocationPortMeta } from './src/resources/servers/allocations.js';
86
+ export { ServerProfile, ServerProfilesManager } from './src/resources/servers/profiles.js';
87
+ export { ActivityJob, ActivityJobLog, ActivityLog, ServerActivityManager } from './src/resources/servers/activity.js';
2
88
  //# sourceMappingURL=mod.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,EA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,EACX,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,GACrB,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,YAAY,EACX,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,UAAU,EACV,mBAAmB,GACnB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAGnH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,YAAY,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAGvG,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAGjF,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC9E,YAAY,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AACjF,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAGlH,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AACxG,YAAY,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAGjF,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAG3F,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC"}
package/script/mod.js CHANGED
@@ -1,5 +1,134 @@
1
1
  "use strict";
2
+ /**
3
+ * # @meowpanel/api
4
+ *
5
+ * TypeScript client library for the MeowPanel platform.
6
+ * Provides typed access to MeowPanel API endpoints.
7
+ *
8
+ * ## Quick start
9
+ *
10
+ * ```typescript
11
+ * import { MeowPanelApi } from "@meowpanel/api";
12
+ *
13
+ * const api = new MeowPanelApi({
14
+ * url: "https://panel.example.com",
15
+ * token: "your-api-key",
16
+ * });
17
+ *
18
+ * // List servers with type-safe includes
19
+ * const { data: servers } = await api.servers.list({ include: ["group", "status"] });
20
+ * for (const server of servers) {
21
+ * console.log(server.name, server.group.nodeId, server.status.state);
22
+ * }
23
+ *
24
+ * // Manage files on a server
25
+ * const server = await api.servers.get(servers[0].id);
26
+ * const entries = await server.files.list("/");
27
+ * await server.files.write("/motd.txt", "Hello World");
28
+ *
29
+ * // Real-time console via SSE
30
+ * const conn = await server.createConnection();
31
+ * conn.on("console_output", (line) => console.log(line));
32
+ * conn.on("stats", (stats) => console.log(`CPU: ${stats.cpuAbsolute}%`));
33
+ * await conn.open();
34
+ * ```
35
+ *
36
+ * ## Features
37
+ *
38
+ * - **Type-safe includes** - `list({ include: ["group"] })` narrows the return type so included fields are guaranteed non-undefined.
39
+ * - **Reactive stores** - All namespaces and resources implement a `subscribe()` contract for use in Svelte or other reactive frameworks.
40
+ * - **Typed events** - Listen for mutations with `api.servers.on("created", (server) => ...)`.
41
+ * - **File management** - Full CRUD, compression, chmod, and multipart upload via the node daemon.
42
+ * - **SSE connections** - Real-time console output, power state, and resource utilization streaming.
43
+ *
44
+ * @module
45
+ */
2
46
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MeowPanelApi = void 0;
4
- var api_js_1 = require("./api.js");
5
- Object.defineProperty(exports, "MeowPanelApi", { enumerable: true, get: function () { return api_js_1.MeowPanelApi; } });
47
+ exports.ServerActivityManager = exports.ActivityLog = exports.ActivityJobLog = exports.ActivityJob = exports.ServerProfilesManager = exports.ServerProfile = exports.ServerAllocationsManager = exports.ServerAllocationPort = exports.SftpUser = exports.ServerSftpManager = exports.ServerFilesManager = exports.FileEntry = exports.ServerConnection = exports.Server = exports.ServersNamespace = exports.ServerGroupsNamespace = exports.ServerGroup = exports.HostsNamespace = exports.Host = exports.EggsNamespace = exports.EggNest = exports.Egg = exports.NodeType = exports.NodesNamespace = exports.NodeLocation = exports.NodeAllocationsManager = exports.NodeAllocationPort = exports.NodeAllocationIp = exports.Node = exports.MembersNamespace = exports.Member = exports.ApiKeysNamespace = exports.ApiKey = exports.UserAccount = exports.ApiKeyAccount = exports.AccountResource = exports.Account = exports.toNanoID = exports.joinIncludes = exports.SseConnection = exports.TypedEmitter = exports.HttpClient = exports.ApiError = exports.ReactiveResource = exports.AuthResource = exports.MeowPanelApi = void 0;
48
+ // Main client
49
+ var client_js_1 = require("./src/client.js");
50
+ Object.defineProperty(exports, "MeowPanelApi", { enumerable: true, get: function () { return client_js_1.MeowPanelApi; } });
51
+ // Auth
52
+ var auth_js_1 = require("./src/resources/auth.js");
53
+ Object.defineProperty(exports, "AuthResource", { enumerable: true, get: function () { return auth_js_1.AuthResource; } });
54
+ var reactive_js_1 = require("./src/reactive.js");
55
+ Object.defineProperty(exports, "ReactiveResource", { enumerable: true, get: function () { return reactive_js_1.ReactiveResource; } });
56
+ // Core primitives
57
+ var errors_js_1 = require("./src/errors.js");
58
+ Object.defineProperty(exports, "ApiError", { enumerable: true, get: function () { return errors_js_1.ApiError; } });
59
+ var http_js_1 = require("./src/http.js");
60
+ Object.defineProperty(exports, "HttpClient", { enumerable: true, get: function () { return http_js_1.HttpClient; } });
61
+ var emitter_js_1 = require("./src/emitter.js");
62
+ Object.defineProperty(exports, "TypedEmitter", { enumerable: true, get: function () { return emitter_js_1.TypedEmitter; } });
63
+ var sse_js_1 = require("./src/sse.js");
64
+ Object.defineProperty(exports, "SseConnection", { enumerable: true, get: function () { return sse_js_1.SseConnection; } });
65
+ // Common types
66
+ var types_js_1 = require("./src/types.js");
67
+ Object.defineProperty(exports, "joinIncludes", { enumerable: true, get: function () { return types_js_1.joinIncludes; } });
68
+ Object.defineProperty(exports, "toNanoID", { enumerable: true, get: function () { return types_js_1.toNanoID; } });
69
+ // Account
70
+ var account_js_1 = require("./src/resources/account.js");
71
+ Object.defineProperty(exports, "Account", { enumerable: true, get: function () { return account_js_1.Account; } });
72
+ Object.defineProperty(exports, "AccountResource", { enumerable: true, get: function () { return account_js_1.AccountResource; } });
73
+ Object.defineProperty(exports, "ApiKeyAccount", { enumerable: true, get: function () { return account_js_1.ApiKeyAccount; } });
74
+ Object.defineProperty(exports, "UserAccount", { enumerable: true, get: function () { return account_js_1.UserAccount; } });
75
+ // API Keys
76
+ var api_keys_js_1 = require("./src/resources/api-keys.js");
77
+ Object.defineProperty(exports, "ApiKey", { enumerable: true, get: function () { return api_keys_js_1.ApiKey; } });
78
+ Object.defineProperty(exports, "ApiKeysNamespace", { enumerable: true, get: function () { return api_keys_js_1.ApiKeysNamespace; } });
79
+ // Members
80
+ var members_js_1 = require("./src/resources/members.js");
81
+ Object.defineProperty(exports, "Member", { enumerable: true, get: function () { return members_js_1.Member; } });
82
+ Object.defineProperty(exports, "MembersNamespace", { enumerable: true, get: function () { return members_js_1.MembersNamespace; } });
83
+ // Nodes
84
+ var nodes_js_1 = require("./src/resources/nodes.js");
85
+ Object.defineProperty(exports, "Node", { enumerable: true, get: function () { return nodes_js_1.Node; } });
86
+ Object.defineProperty(exports, "NodeAllocationIp", { enumerable: true, get: function () { return nodes_js_1.NodeAllocationIp; } });
87
+ Object.defineProperty(exports, "NodeAllocationPort", { enumerable: true, get: function () { return nodes_js_1.NodeAllocationPort; } });
88
+ Object.defineProperty(exports, "NodeAllocationsManager", { enumerable: true, get: function () { return nodes_js_1.NodeAllocationsManager; } });
89
+ Object.defineProperty(exports, "NodeLocation", { enumerable: true, get: function () { return nodes_js_1.NodeLocation; } });
90
+ Object.defineProperty(exports, "NodesNamespace", { enumerable: true, get: function () { return nodes_js_1.NodesNamespace; } });
91
+ Object.defineProperty(exports, "NodeType", { enumerable: true, get: function () { return nodes_js_1.NodeType; } });
92
+ // Eggs
93
+ var eggs_js_1 = require("./src/resources/eggs.js");
94
+ Object.defineProperty(exports, "Egg", { enumerable: true, get: function () { return eggs_js_1.Egg; } });
95
+ Object.defineProperty(exports, "EggNest", { enumerable: true, get: function () { return eggs_js_1.EggNest; } });
96
+ Object.defineProperty(exports, "EggsNamespace", { enumerable: true, get: function () { return eggs_js_1.EggsNamespace; } });
97
+ // Hosts
98
+ var hosts_js_1 = require("./src/resources/hosts.js");
99
+ Object.defineProperty(exports, "Host", { enumerable: true, get: function () { return hosts_js_1.Host; } });
100
+ Object.defineProperty(exports, "HostsNamespace", { enumerable: true, get: function () { return hosts_js_1.HostsNamespace; } });
101
+ // Server Groups
102
+ var server_groups_js_1 = require("./src/resources/server-groups.js");
103
+ Object.defineProperty(exports, "ServerGroup", { enumerable: true, get: function () { return server_groups_js_1.ServerGroup; } });
104
+ Object.defineProperty(exports, "ServerGroupsNamespace", { enumerable: true, get: function () { return server_groups_js_1.ServerGroupsNamespace; } });
105
+ // Servers
106
+ var index_js_1 = require("./src/resources/servers/index.js");
107
+ Object.defineProperty(exports, "ServersNamespace", { enumerable: true, get: function () { return index_js_1.ServersNamespace; } });
108
+ var server_js_1 = require("./src/resources/servers/server.js");
109
+ Object.defineProperty(exports, "Server", { enumerable: true, get: function () { return server_js_1.Server; } });
110
+ // Server connection (SSE)
111
+ var connection_js_1 = require("./src/resources/servers/connection.js");
112
+ Object.defineProperty(exports, "ServerConnection", { enumerable: true, get: function () { return connection_js_1.ServerConnection; } });
113
+ // Server files
114
+ var files_js_1 = require("./src/resources/servers/files.js");
115
+ Object.defineProperty(exports, "FileEntry", { enumerable: true, get: function () { return files_js_1.FileEntry; } });
116
+ Object.defineProperty(exports, "ServerFilesManager", { enumerable: true, get: function () { return files_js_1.ServerFilesManager; } });
117
+ // Server SFTP
118
+ var sftp_js_1 = require("./src/resources/servers/sftp.js");
119
+ Object.defineProperty(exports, "ServerSftpManager", { enumerable: true, get: function () { return sftp_js_1.ServerSftpManager; } });
120
+ Object.defineProperty(exports, "SftpUser", { enumerable: true, get: function () { return sftp_js_1.SftpUser; } });
121
+ // Server allocations
122
+ var allocations_js_1 = require("./src/resources/servers/allocations.js");
123
+ Object.defineProperty(exports, "ServerAllocationPort", { enumerable: true, get: function () { return allocations_js_1.ServerAllocationPort; } });
124
+ Object.defineProperty(exports, "ServerAllocationsManager", { enumerable: true, get: function () { return allocations_js_1.ServerAllocationsManager; } });
125
+ // Server profiles
126
+ var profiles_js_1 = require("./src/resources/servers/profiles.js");
127
+ Object.defineProperty(exports, "ServerProfile", { enumerable: true, get: function () { return profiles_js_1.ServerProfile; } });
128
+ Object.defineProperty(exports, "ServerProfilesManager", { enumerable: true, get: function () { return profiles_js_1.ServerProfilesManager; } });
129
+ // Server activity
130
+ var activity_js_1 = require("./src/resources/servers/activity.js");
131
+ Object.defineProperty(exports, "ActivityJob", { enumerable: true, get: function () { return activity_js_1.ActivityJob; } });
132
+ Object.defineProperty(exports, "ActivityJobLog", { enumerable: true, get: function () { return activity_js_1.ActivityJobLog; } });
133
+ Object.defineProperty(exports, "ActivityLog", { enumerable: true, get: function () { return activity_js_1.ActivityLog; } });
134
+ Object.defineProperty(exports, "ServerActivityManager", { enumerable: true, get: function () { return activity_js_1.ServerActivityManager; } });
@@ -0,0 +1,233 @@
1
+ import type { HttpLogger } from './http.js';
2
+ import { SseConnection } from './sse.js';
3
+ import { AccountResource } from './resources/account.js';
4
+ import { AuthResource } from './resources/auth.js';
5
+ import { ApiKeysNamespace } from './resources/api-keys.js';
6
+ import { EggsNamespace } from './resources/eggs.js';
7
+ import { HostsNamespace } from './resources/hosts.js';
8
+ import { MembersNamespace } from './resources/members.js';
9
+ import { NodesNamespace } from './resources/nodes.js';
10
+ import { ServerGroupsNamespace } from './resources/server-groups.js';
11
+ import { ServersNamespace } from './resources/servers/index.js';
12
+ /**
13
+ * Configuration options for {@link MeowPanelApi}.
14
+ */
15
+ export interface MeowPanelApiOptions {
16
+ /**
17
+ * Base URL of the MeowPanel Nexus API.
18
+ *
19
+ * Should not include `/v1` - that is appended automatically.
20
+ *
21
+ * @example `"https://panel.example.com"`
22
+ */
23
+ url: string | URL;
24
+ /**
25
+ * Bearer token for authentication.
26
+ *
27
+ * Can be a user session token or an API key token.
28
+ */
29
+ token?: string;
30
+ /**
31
+ * Custom fetch implementation to use for all HTTP requests.
32
+ *
33
+ * Defaults to `globalThis.fetch`.
34
+ */
35
+ fetch?: typeof globalThis.fetch;
36
+ /**
37
+ * Optional callback invoked for every outgoing request.
38
+ *
39
+ * Useful for integrating API request visibility into your app's debug/info logger.
40
+ */
41
+ logger?: HttpLogger;
42
+ /**
43
+ * The `credentials` mode for all fetch requests.
44
+ *
45
+ * Set to `'include'` for browser apps that rely on cookie-based authentication.
46
+ * Defaults to `undefined` (browser default is `'same-origin'`).
47
+ */
48
+ credentials?: RequestCredentials;
49
+ }
50
+ /**
51
+ * The root MeowPanel API client.
52
+ *
53
+ * Instantiate once and reuse across your application. All namespaces implement the
54
+ * readable store contract so they can be used directly in reactive templates.
55
+ *
56
+ * @example
57
+ * ```ts ignore
58
+ * import { MeowPanelApi } from '@meowpanel/api';
59
+ *
60
+ * const api = new MeowPanelApi({
61
+ * url: 'https://panel.example.com',
62
+ * token: 'your-bearer-token',
63
+ * });
64
+ *
65
+ * // Fetch resources
66
+ * const me = await api.account.get();
67
+ * const servers = await api.servers.list({ include: ['status'] });
68
+ * const members = await api.members.list();
69
+ *
70
+ * // Reactive store: {#each $api.servers as server} ... {/each}
71
+ *
72
+ * // Listen for mutations
73
+ * api.servers.on('created', (server) => console.log('New server:', server.name));
74
+ * api.members.on('updated', (member) => console.log('Member updated:', member.nickname));
75
+ *
76
+ * // Panel-level SSE
77
+ * const sse = api.connectSse();
78
+ * sse.connect((event, data) => console.log('Panel event:', event, data));
79
+ * ```
80
+ */
81
+ export declare class MeowPanelApi {
82
+ private readonly http;
83
+ /**
84
+ * Fetch authentication configuration (available login providers).
85
+ *
86
+ * @example
87
+ * ```ts ignore
88
+ * const { providers } = await api.auth.getMeta();
89
+ * if (providers.whmcs) console.log(providers.whmcs.fields.display_name);
90
+ * ```
91
+ */
92
+ readonly auth: AuthResource;
93
+ /**
94
+ * Access and update the currently authenticated account (me).
95
+ *
96
+ * @example
97
+ * ```ts ignore
98
+ * const me = await api.account.get();
99
+ * await api.account.update({ display: { theme: 'dark' } });
100
+ * await api.account.uploadAvatar(imageBlob, 'image/png');
101
+ * ```
102
+ */
103
+ readonly account: AccountResource;
104
+ /**
105
+ * Manage API keys for the current account.
106
+ *
107
+ * @example
108
+ * ```ts ignore
109
+ * const key = await api.apiKeys.create('CI/CD Pipeline');
110
+ * console.log(key.token); // Save this!
111
+ * ```
112
+ */
113
+ readonly apiKeys: ApiKeysNamespace;
114
+ /**
115
+ * Manage member (user) accounts.
116
+ *
117
+ * Supports reactive subscriptions via `$api.members`.
118
+ *
119
+ * @example
120
+ * ```ts ignore
121
+ * const members = await api.members.list();
122
+ * const member = await api.members.get(id);
123
+ * await api.members.update(id, { nickname: 'newname' });
124
+ * ```
125
+ */
126
+ readonly members: MembersNamespace;
127
+ /**
128
+ * Manage nodes (daemon servers).
129
+ *
130
+ * Supports reactive subscriptions via `$api.nodes`.
131
+ *
132
+ * @example
133
+ * ```ts ignore
134
+ * const nodes = await api.nodes.list();
135
+ * const node = await api.nodes.get(id, { includeConnection: true });
136
+ * ```
137
+ */
138
+ readonly nodes: NodesNamespace;
139
+ /**
140
+ * Manage eggs (game/application configuration templates).
141
+ *
142
+ * Supports reactive subscriptions via `$api.eggs`.
143
+ *
144
+ * @example
145
+ * ```ts ignore
146
+ * const eggs = await api.eggs.list();
147
+ * await api.eggs.update(id, { name: 'Paper Minecraft' });
148
+ * await api.eggs.delete(id);
149
+ * ```
150
+ */
151
+ readonly eggs: EggsNamespace;
152
+ /**
153
+ * View physical host machines.
154
+ *
155
+ * Supports reactive subscriptions via `$api.hosts`.
156
+ *
157
+ * @example
158
+ * ```ts ignore
159
+ * const hosts = await api.hosts.list();
160
+ * ```
161
+ */
162
+ readonly hosts: HostsNamespace;
163
+ /**
164
+ * Manage server groups (node + resource limits containers).
165
+ *
166
+ * Supports reactive subscriptions via `$api.serverGroups`.
167
+ *
168
+ * @example
169
+ * ```ts ignore
170
+ * const groups = await api.serverGroups.list();
171
+ * const group = await api.serverGroups.create({ nodeId, limits: { ramMb: 1024 } });
172
+ * ```
173
+ */
174
+ readonly serverGroups: ServerGroupsNamespace;
175
+ /**
176
+ * Manage game servers.
177
+ *
178
+ * Supports reactive subscriptions via `$api.servers`.
179
+ *
180
+ * @example
181
+ * ```ts ignore
182
+ * const servers = await api.servers.list({ include: ['status'] });
183
+ * const server = await api.servers.get(id);
184
+ * await server.sendPower('start');
185
+ * await server.sendCommand('say Hello!');
186
+ *
187
+ * // File management
188
+ * const entries = await server.files.list('/');
189
+ * await server.files.write('/motd.txt', 'Hello World');
190
+ *
191
+ * // Real-time events
192
+ * const conn = await server.createConnection();
193
+ * conn.on('console_output', (line) => console.log(line));
194
+ * conn.on('stats', (stats) => console.log(`CPU: ${stats.cpuAbsolute}%`));
195
+ * await conn.open();
196
+ * ```
197
+ */
198
+ readonly servers: ServersNamespace;
199
+ constructor(options: MeowPanelApiOptions);
200
+ /**
201
+ * Update the bearer token used for all subsequent API requests.
202
+ *
203
+ * Useful when a session token is refreshed.
204
+ *
205
+ * @param token The new bearer token.
206
+ */
207
+ setToken(token: string): void;
208
+ /**
209
+ * Create a panel-level Server-Sent Events connection to Nexus.
210
+ *
211
+ * The panel SSE stream (`GET /v1/sse`) broadcasts events for mutations
212
+ * across the panel (e.g. server updates, member changes).
213
+ *
214
+ * The connection is not opened until you call `.connect()` on the returned object.
215
+ *
216
+ * @example
217
+ * ```ts ignore
218
+ * const sse = api.connectSse();
219
+ * sse.connect(
220
+ * (event, data) => {
221
+ * const payload = JSON.parse(data);
222
+ * console.log('Panel event:', event, payload);
223
+ * },
224
+ * (err) => console.error('SSE error:', err),
225
+ * );
226
+ *
227
+ * // Later...
228
+ * sse.disconnect();
229
+ * ```
230
+ */
231
+ connectSse(): SseConnection;
232
+ }
233
+ //# sourceMappingURL=client.d.ts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