@meowpanel/api 0.1.0-alpha.11 → 1.0.0-beta.2

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.
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 +248 -0
  7. package/esm/src/client.d.ts.map +1 -0
  8. package/esm/src/client.js +235 -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 +157 -0
  16. package/esm/src/http.d.ts.map +1 -0
  17. package/esm/src/http.js +317 -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 +57 -0
  31. package/esm/src/resources/auth.d.ts.map +1 -0
  32. package/esm/src/resources/auth.js +39 -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 +53 -0
  76. package/esm/src/sse.d.ts.map +1 -0
  77. package/esm/src/sse.js +133 -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 +248 -0
  86. package/script/src/client.d.ts.map +1 -0
  87. package/script/src/client.js +239 -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 +157 -0
  95. package/script/src/http.d.ts.map +1 -0
  96. package/script/src/http.js +321 -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 +57 -0
  110. package/script/src/resources/auth.d.ts.map +1 -0
  111. package/script/src/resources/auth.js +43 -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 +53 -0
  155. package/script/src/sse.d.ts.map +1 -0
  156. package/script/src/sse.js +137 -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
@@ -1,349 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NodeType = exports.NodeHost = exports.NodeLocation = exports.Node = void 0;
4
- const cache_js_1 = require("../utils/cache.js");
5
- const member_2_js_1 = require("./member_2.js");
6
- class Node {
7
- static async getPaged(api, page, include) {
8
- const response = await api.request('GET', `/v1/nodes`, {
9
- pagination: { page },
10
- params: {
11
- include: include?.join(','),
12
- },
13
- });
14
- return {
15
- servers: response.data.map((data) => new Node(api, data)),
16
- page: response.page,
17
- };
18
- }
19
- static async get(api, id, include) {
20
- const response = await api.request('GET', `/v1/nodes/${id}`, {
21
- params: {
22
- include: include?.join(','),
23
- },
24
- });
25
- return new Node(api, response.data);
26
- }
27
- constructor(api, data) {
28
- Object.defineProperty(this, "api", {
29
- enumerable: true,
30
- configurable: true,
31
- writable: true,
32
- value: api
33
- });
34
- Object.defineProperty(this, "id", {
35
- enumerable: true,
36
- configurable: true,
37
- writable: true,
38
- value: void 0
39
- });
40
- Object.defineProperty(this, "name", {
41
- enumerable: true,
42
- configurable: true,
43
- writable: true,
44
- value: void 0
45
- });
46
- Object.defineProperty(this, "description", {
47
- enumerable: true,
48
- configurable: true,
49
- writable: true,
50
- value: void 0
51
- });
52
- Object.defineProperty(this, "owner", {
53
- enumerable: true,
54
- configurable: true,
55
- writable: true,
56
- value: void 0
57
- });
58
- Object.defineProperty(this, "location", {
59
- enumerable: true,
60
- configurable: true,
61
- writable: true,
62
- value: void 0
63
- });
64
- Object.defineProperty(this, "host", {
65
- enumerable: true,
66
- configurable: true,
67
- writable: true,
68
- value: void 0
69
- });
70
- Object.defineProperty(this, "type", {
71
- enumerable: true,
72
- configurable: true,
73
- writable: true,
74
- value: void 0
75
- });
76
- Object.defineProperty(this, "num", {
77
- enumerable: true,
78
- configurable: true,
79
- writable: true,
80
- value: void 0
81
- });
82
- Object.defineProperty(this, "limits", {
83
- enumerable: true,
84
- configurable: true,
85
- writable: true,
86
- value: void 0
87
- });
88
- Object.defineProperty(this, "connection", {
89
- enumerable: true,
90
- configurable: true,
91
- writable: true,
92
- value: void 0
93
- });
94
- Object.defineProperty(this, "isUnderMaintance", {
95
- enumerable: true,
96
- configurable: true,
97
- writable: true,
98
- value: void 0
99
- });
100
- Object.defineProperty(this, "canAutoDeploy", {
101
- enumerable: true,
102
- configurable: true,
103
- writable: true,
104
- value: void 0
105
- });
106
- Object.defineProperty(this, "isBehindProxy", {
107
- enumerable: true,
108
- configurable: true,
109
- writable: true,
110
- value: void 0
111
- });
112
- Object.defineProperty(this, "createdAt", {
113
- enumerable: true,
114
- configurable: true,
115
- writable: true,
116
- value: void 0
117
- });
118
- Object.defineProperty(this, "updatedAt", {
119
- enumerable: true,
120
- configurable: true,
121
- writable: true,
122
- value: void 0
123
- });
124
- Object.defineProperty(this, "fqdn", {
125
- enumerable: true,
126
- configurable: true,
127
- writable: true,
128
- value: void 0
129
- });
130
- Object.defineProperty(this, "notes", {
131
- enumerable: true,
132
- configurable: true,
133
- writable: true,
134
- value: void 0
135
- });
136
- this.id = data.id;
137
- this.name = data.name;
138
- this.description = data.description;
139
- this.owner = new cache_js_1.CachedRelation(() => member_2_js_1.Member.get(api, data.owner_id));
140
- this.owner.setCache(data.owner);
141
- // TODO: Implement Node Location, Host, Type API endpoints
142
- this.location = new cache_js_1.CachedRelation(() => {
143
- throw new Error('Not implemented');
144
- });
145
- this.host = new cache_js_1.CachedRelation(() => {
146
- throw new Error('Not implemented');
147
- });
148
- this.type = new cache_js_1.CachedRelation(() => {
149
- throw new Error('Not implemented');
150
- });
151
- this.num = data.num;
152
- this.limits = data.limits;
153
- this.connection = data.connection ?? null;
154
- this.isUnderMaintance = data.is_under_maintance;
155
- this.canAutoDeploy = data.can_auto_deploy;
156
- this.isBehindProxy = data.is_behind_proxy;
157
- this.notes = data.notes;
158
- this.createdAt = data.created_at;
159
- this.updatedAt = data.updated_at;
160
- }
161
- }
162
- exports.Node = Node;
163
- class NodeLocation {
164
- constructor(api, data) {
165
- Object.defineProperty(this, "api", {
166
- enumerable: true,
167
- configurable: true,
168
- writable: true,
169
- value: api
170
- });
171
- Object.defineProperty(this, "id", {
172
- enumerable: true,
173
- configurable: true,
174
- writable: true,
175
- value: void 0
176
- });
177
- Object.defineProperty(this, "name", {
178
- enumerable: true,
179
- configurable: true,
180
- writable: true,
181
- value: void 0
182
- });
183
- Object.defineProperty(this, "short", {
184
- enumerable: true,
185
- configurable: true,
186
- writable: true,
187
- value: void 0
188
- });
189
- Object.defineProperty(this, "notes", {
190
- enumerable: true,
191
- configurable: true,
192
- writable: true,
193
- value: void 0
194
- });
195
- Object.defineProperty(this, "owner", {
196
- enumerable: true,
197
- configurable: true,
198
- writable: true,
199
- value: void 0
200
- });
201
- Object.defineProperty(this, "createdAt", {
202
- enumerable: true,
203
- configurable: true,
204
- writable: true,
205
- value: void 0
206
- });
207
- Object.defineProperty(this, "updatedAt", {
208
- enumerable: true,
209
- configurable: true,
210
- writable: true,
211
- value: void 0
212
- });
213
- this.id = data.id;
214
- this.name = data.name;
215
- this.short = data.short;
216
- this.notes = data.notes;
217
- this.owner = new cache_js_1.CachedRelation(() => member_2_js_1.Member.get(api, data.owner_id));
218
- this.createdAt = new Date(data.created_at);
219
- this.updatedAt = new Date(data.updated_at);
220
- }
221
- }
222
- exports.NodeLocation = NodeLocation;
223
- class NodeHost {
224
- constructor(api, data) {
225
- Object.defineProperty(this, "api", {
226
- enumerable: true,
227
- configurable: true,
228
- writable: true,
229
- value: api
230
- });
231
- Object.defineProperty(this, "id", {
232
- enumerable: true,
233
- configurable: true,
234
- writable: true,
235
- value: void 0
236
- });
237
- Object.defineProperty(this, "name", {
238
- enumerable: true,
239
- configurable: true,
240
- writable: true,
241
- value: void 0
242
- });
243
- Object.defineProperty(this, "hostname", {
244
- enumerable: true,
245
- configurable: true,
246
- writable: true,
247
- value: void 0
248
- });
249
- Object.defineProperty(this, "color", {
250
- enumerable: true,
251
- configurable: true,
252
- writable: true,
253
- value: void 0
254
- });
255
- Object.defineProperty(this, "notes", {
256
- enumerable: true,
257
- configurable: true,
258
- writable: true,
259
- value: void 0
260
- });
261
- Object.defineProperty(this, "owner", {
262
- enumerable: true,
263
- configurable: true,
264
- writable: true,
265
- value: void 0
266
- });
267
- Object.defineProperty(this, "createdAt", {
268
- enumerable: true,
269
- configurable: true,
270
- writable: true,
271
- value: void 0
272
- });
273
- Object.defineProperty(this, "updatedAt", {
274
- enumerable: true,
275
- configurable: true,
276
- writable: true,
277
- value: void 0
278
- });
279
- this.id = data.id;
280
- this.name = data.name;
281
- this.hostname = data.hostname;
282
- this.color = data.color;
283
- this.notes = data.notes;
284
- this.owner = new cache_js_1.CachedRelation(() => member_2_js_1.Member.get(api, data.owner_id));
285
- this.createdAt = new Date(data.created_at);
286
- this.updatedAt = new Date(data.updated_at);
287
- }
288
- }
289
- exports.NodeHost = NodeHost;
290
- class NodeType {
291
- constructor(api, data) {
292
- Object.defineProperty(this, "api", {
293
- enumerable: true,
294
- configurable: true,
295
- writable: true,
296
- value: api
297
- });
298
- Object.defineProperty(this, "id", {
299
- enumerable: true,
300
- configurable: true,
301
- writable: true,
302
- value: void 0
303
- });
304
- Object.defineProperty(this, "name", {
305
- enumerable: true,
306
- configurable: true,
307
- writable: true,
308
- value: void 0
309
- });
310
- Object.defineProperty(this, "short", {
311
- enumerable: true,
312
- configurable: true,
313
- writable: true,
314
- value: void 0
315
- });
316
- Object.defineProperty(this, "notes", {
317
- enumerable: true,
318
- configurable: true,
319
- writable: true,
320
- value: void 0
321
- });
322
- Object.defineProperty(this, "owner", {
323
- enumerable: true,
324
- configurable: true,
325
- writable: true,
326
- value: void 0
327
- });
328
- Object.defineProperty(this, "createdAt", {
329
- enumerable: true,
330
- configurable: true,
331
- writable: true,
332
- value: void 0
333
- });
334
- Object.defineProperty(this, "updatedAt", {
335
- enumerable: true,
336
- configurable: true,
337
- writable: true,
338
- value: void 0
339
- });
340
- this.id = data.id;
341
- this.name = data.name;
342
- this.short = data.short;
343
- this.notes = data.notes;
344
- this.owner = new cache_js_1.CachedRelation(() => member_2_js_1.Member.get(api, data.owner_id));
345
- this.createdAt = new Date(data.created_at);
346
- this.updatedAt = new Date(data.updated_at);
347
- }
348
- }
349
- exports.NodeType = NodeType;
@@ -1,45 +0,0 @@
1
- import type { MeowPanelApi } from '../../api.js';
2
- import { CachedRelation } from '../../utils/cache.js';
3
- import { Member } from '../member_2.js';
4
- import { Node } from '../node.js';
5
- import type { ActivityJobLogResponse } from './server_2';
6
- import type { ActivityJobResponse, ActivityLogResponse } from './server_2';
7
- import { Server } from './server.js';
8
- export declare class ServerActivityLog {
9
- protected readonly api: MeowPanelApi;
10
- protected readonly server: Server;
11
- protected readonly response: ActivityLogResponse;
12
- constructor(api: MeowPanelApi, server: Server, response: ActivityLogResponse);
13
- get id(): string;
14
- readonly issuer: CachedRelation<Member | null>;
15
- get ip(): string | undefined;
16
- get event(): string;
17
- get metadata(): Record<string, unknown>;
18
- readonly job: CachedRelation<ServerActivityJob | null>;
19
- get created_at(): Date;
20
- }
21
- export declare class ServerActivityJob {
22
- protected readonly api: MeowPanelApi;
23
- protected readonly server: Server;
24
- protected readonly response: ActivityJobResponse;
25
- constructor(api: MeowPanelApi, server: Server, response: ActivityJobResponse);
26
- get id(): string;
27
- readonly node: CachedRelation<Node | null>;
28
- get status(): 'in_progress' | 'completed' | 'failed';
29
- readonly logs: ServerActivityJobLog[];
30
- get completedAt(): Date | null;
31
- isCompleted(): boolean;
32
- get createdAt(): Date;
33
- get updatedAt(): Date;
34
- }
35
- export declare class ServerActivityJobLog {
36
- protected readonly api: MeowPanelApi;
37
- protected readonly response: ActivityJobLogResponse;
38
- constructor(api: MeowPanelApi, response: ActivityJobLogResponse);
39
- get type(): string;
40
- get metadata(): object;
41
- readonly node: CachedRelation<Node | null>;
42
- readonly server: CachedRelation<Server | null>;
43
- get created_at(): Date;
44
- }
45
- //# sourceMappingURL=activity.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../../src/components/server/activity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,qBAAa,iBAAiB;IAE5B,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,YAAY;IACpC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACjC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,mBAAmB;gBAF7B,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,mBAAmB;IAajD,IAAW,EAAE,IAAI,MAAM,CAEtB;IAGD,SAAgB,MAAM,EAAE,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,CAEnD;IAEF,IAAW,EAAE,IAAI,MAAM,GAAG,SAAS,CAElC;IAED,IAAW,KAAK,IAAI,MAAM,CAEzB;IAED,IAAW,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE7C;IAED,SAAgB,GAAG,EAAE,cAAc,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAE3D;IAEF,IAAW,UAAU,IAAI,IAAI,CAE5B;CACD;AAED,qBAAa,iBAAiB;IAE5B,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,YAAY;IACpC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACjC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,mBAAmB;gBAF7B,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,mBAAmB;IAMjD,IAAW,EAAE,IAAI,MAAM,CAEtB;IAED,SAAgB,IAAI,EAAE,cAAc,CAAC,IAAI,GAAG,IAAI,CAAC,CAE/C;IAEF,IAAW,MAAM,IAAI,aAAa,GAAG,WAAW,GAAG,QAAQ,CAE1D;IAED,SAAgB,IAAI,EAAE,oBAAoB,EAAE,CAAC;IAE7C,IAAW,WAAW,IAAI,IAAI,GAAG,IAAI,CAEpC;IAEM,WAAW,IAAI,OAAO;IAI7B,IAAW,SAAS,IAAI,IAAI,CAE3B;IAED,IAAW,SAAS,IAAI,IAAI,CAE3B;CACD;AAED,qBAAa,oBAAoB;IAE/B,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,YAAY;IACpC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,sBAAsB;gBADhC,GAAG,EAAE,YAAY,EACjB,QAAQ,EAAE,sBAAsB;IAQpD,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,SAAgB,IAAI,EAAE,cAAc,CAAC,IAAI,GAAG,IAAI,CAAC,CAE/C;IAEF,SAAgB,MAAM,EAAE,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,CAEnD;IAEF,IAAW,UAAU,IAAI,IAAI,CAE5B;CACD"}
@@ -1,164 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ServerActivityJobLog = exports.ServerActivityJob = exports.ServerActivityLog = void 0;
4
- const cache_js_1 = require("../../utils/cache.js");
5
- const member_2_js_1 = require("../member_2.js");
6
- const node_js_1 = require("../node.js");
7
- const server_js_1 = require("./server.js");
8
- class ServerActivityLog {
9
- constructor(api, server, response) {
10
- Object.defineProperty(this, "api", {
11
- enumerable: true,
12
- configurable: true,
13
- writable: true,
14
- value: api
15
- });
16
- Object.defineProperty(this, "server", {
17
- enumerable: true,
18
- configurable: true,
19
- writable: true,
20
- value: server
21
- });
22
- Object.defineProperty(this, "response", {
23
- enumerable: true,
24
- configurable: true,
25
- writable: true,
26
- value: response
27
- });
28
- // TODO: update so it uses as a common function to parse Issuer IDs
29
- Object.defineProperty(this, "issuer", {
30
- enumerable: true,
31
- configurable: true,
32
- writable: true,
33
- value: new cache_js_1.CachedRelation(() => this.response.issuer_id ? this.api.members.get(this.response.issuer_id) : null)
34
- });
35
- Object.defineProperty(this, "job", {
36
- enumerable: true,
37
- configurable: true,
38
- writable: true,
39
- value: new cache_js_1.CachedRelation(() => this.response.job_id ? this.server.getActivityJob(this.response.job_id) : null)
40
- });
41
- // this.issuer = response.issuer; TODO: Implement Activity Log Issuer (Frontend)
42
- if (response.job) {
43
- this.job.setCache(new ServerActivityJob(this.api, this.server, response.job));
44
- }
45
- if (response.issuer) {
46
- this.issuer.setCache(new member_2_js_1.Member(this.api, response.issuer));
47
- }
48
- }
49
- get id() {
50
- return this.response.id;
51
- }
52
- get ip() {
53
- return this.response.ip;
54
- }
55
- get event() {
56
- return this.response.event;
57
- }
58
- get metadata() {
59
- return this.response.metadata;
60
- }
61
- get created_at() {
62
- return new Date(this.response.created_at);
63
- }
64
- }
65
- exports.ServerActivityLog = ServerActivityLog;
66
- class ServerActivityJob {
67
- constructor(api, server, response) {
68
- Object.defineProperty(this, "api", {
69
- enumerable: true,
70
- configurable: true,
71
- writable: true,
72
- value: api
73
- });
74
- Object.defineProperty(this, "server", {
75
- enumerable: true,
76
- configurable: true,
77
- writable: true,
78
- value: server
79
- });
80
- Object.defineProperty(this, "response", {
81
- enumerable: true,
82
- configurable: true,
83
- writable: true,
84
- value: response
85
- });
86
- Object.defineProperty(this, "node", {
87
- enumerable: true,
88
- configurable: true,
89
- writable: true,
90
- value: new cache_js_1.CachedRelation(() => this.response.node_id ? this.api.getNode(this.response.node_id) : null)
91
- });
92
- Object.defineProperty(this, "logs", {
93
- enumerable: true,
94
- configurable: true,
95
- writable: true,
96
- value: void 0
97
- });
98
- if (response.node)
99
- this.node.setCache(new node_js_1.Node(this.api, response.node)); // TODO: Fix type check
100
- this.logs = response.logs.map((v) => new ServerActivityJobLog(this.api, v));
101
- }
102
- get id() {
103
- return this.response.id;
104
- }
105
- get status() {
106
- return this.response.status;
107
- }
108
- get completedAt() {
109
- return this.response.completed_at ? new Date(this.response.completed_at) : null;
110
- }
111
- isCompleted() {
112
- return this.completedAt !== null;
113
- }
114
- get createdAt() {
115
- return new Date(this.response.created_at);
116
- }
117
- get updatedAt() {
118
- return new Date(this.response.updated_at);
119
- }
120
- }
121
- exports.ServerActivityJob = ServerActivityJob;
122
- class ServerActivityJobLog {
123
- constructor(api, response) {
124
- Object.defineProperty(this, "api", {
125
- enumerable: true,
126
- configurable: true,
127
- writable: true,
128
- value: api
129
- });
130
- Object.defineProperty(this, "response", {
131
- enumerable: true,
132
- configurable: true,
133
- writable: true,
134
- value: response
135
- });
136
- Object.defineProperty(this, "node", {
137
- enumerable: true,
138
- configurable: true,
139
- writable: true,
140
- value: new cache_js_1.CachedRelation(() => this.response.node_id ? this.api.getNode(this.response.node_id) : null)
141
- });
142
- Object.defineProperty(this, "server", {
143
- enumerable: true,
144
- configurable: true,
145
- writable: true,
146
- value: new cache_js_1.CachedRelation(() => this.response.server_id ? this.api.getServer(this.response.server_id) : null)
147
- });
148
- if (response.node)
149
- this.node.setCache(new node_js_1.Node(this.api, response.node)); // TODO: Fix type check
150
- if (response.server) {
151
- this.server.setCache(new server_js_1.Server(this.api, response.server));
152
- }
153
- }
154
- get type() {
155
- return this.response.type;
156
- }
157
- get metadata() {
158
- return this.response.metadata;
159
- }
160
- get created_at() {
161
- return new Date(this.response.created_at);
162
- }
163
- }
164
- exports.ServerActivityJobLog = ServerActivityJobLog;
@@ -1,45 +0,0 @@
1
- import type { ApiResponse, MeowPanelApi, Page } from '../../api.js';
2
- import { CachedRelation } from '../../utils/cache.js';
3
- import type { AllocationPortResponse, AllocationsResponse, ServerAllocationPortResponse } from './server_2';
4
- import type { Server } from './server.js';
5
- export declare class ServerAllocations {
6
- protected readonly api: MeowPanelApi;
7
- protected readonly server: Server;
8
- protected readonly response: AllocationsResponse;
9
- static getPaged(api: MeowPanelApi, server: Server, page: number): Promise<{
10
- groups: ServerAllocations[];
11
- page: Page;
12
- }>;
13
- static get(api: MeowPanelApi, server: Server, id: string): Promise<ServerAllocations>;
14
- constructor(api: MeowPanelApi, server: Server, response: AllocationsResponse);
15
- get forceOutgoingIp(): boolean | undefined;
16
- readonly ports: ServerAllocationPort[];
17
- }
18
- export declare class ServerAllocationPort {
19
- protected readonly api: MeowPanelApi;
20
- protected readonly server: Server;
21
- protected readonly response: ServerAllocationPortResponse;
22
- constructor(api: MeowPanelApi, server: Server, response: ServerAllocationPortResponse);
23
- updateDescription(description: string): Promise<ApiResponse<unknown>>;
24
- get id(): string;
25
- get description(): string;
26
- readonly meta: CachedRelation<AllocationPort>;
27
- get isPrimary(): boolean;
28
- get createdAt(): string;
29
- get updatedAt(): string;
30
- }
31
- export declare class AllocationPort {
32
- protected readonly ctx: MeowPanelApi;
33
- protected readonly server: Server;
34
- protected readonly response: AllocationPortResponse;
35
- constructor(ctx: MeowPanelApi, server: Server, response: AllocationPortResponse);
36
- get id(): string;
37
- get ip(): string;
38
- get port(): number;
39
- get readyProtocols(): string[];
40
- get is_in_use(): boolean;
41
- get notes(): string | null | undefined;
42
- get createdAt(): string;
43
- get updatedAt(): string;
44
- }
45
- //# sourceMappingURL=allocations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"allocations.d.ts","sourceRoot":"","sources":["../../../src/components/server/allocations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAC5G,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,qBAAa,iBAAiB;IA8B5B,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,YAAY;IACpC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACjC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,mBAAmB;WA/B7B,QAAQ,CAC3B,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACV,OAAO,CAAC;QAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC;QAAC,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC;WAenC,GAAG,CAAC,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;gBAU9E,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,mBAAmB;IAKjD,IAAW,eAAe,IAAI,OAAO,GAAG,SAAS,CAEhD;IAED,SAAgB,KAAK,EAAE,oBAAoB,EAAE,CAAC;CAC9C;AAED,qBAAa,oBAAoB;IAE/B,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,YAAY;IACpC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACjC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,4BAA4B;gBAFtC,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,4BAA4B;IAkBnD,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAU5E,IAAW,EAAE,IAAI,MAAM,CAEtB;IAED,IAAW,WAAW,IAAI,MAAM,CAE/B;IAED,SAAgB,IAAI,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IAErD,IAAW,SAAS,IAAI,OAAO,CAE9B;IAED,IAAW,SAAS,IAAI,MAAM,CAE7B;IAED,IAAW,SAAS,IAAI,MAAM,CAE7B;CACD;AAED,qBAAa,cAAc;IAEzB,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,YAAY;IACpC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACjC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,sBAAsB;gBAFhC,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,sBAAsB;IAGpD,IAAW,EAAE,IAAI,MAAM,CAEtB;IACD,IAAW,EAAE,IAAI,MAAM,CAEtB;IACD,IAAW,IAAI,IAAI,MAAM,CAExB;IACD,IAAW,cAAc,IAAI,MAAM,EAAE,CAEpC;IACD,IAAW,SAAS,IAAI,OAAO,CAE9B;IACD,IAAW,KAAK,IAAI,MAAM,GAAG,IAAI,GAAG,SAAS,CAE5C;IACD,IAAW,SAAS,IAAI,MAAM,CAE7B;IACD,IAAW,SAAS,IAAI,MAAM,CAE7B;CACD"}