@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
@@ -1,140 +0,0 @@
1
- import { CachedRelation } from '../utils/cache.js';
2
- import { EventManager } from '../utils/event.js';
3
- import { UpdatableObject } from '../utils/object.js';
4
- export class Member extends UpdatableObject {
5
- static async list(api, pagination) {
6
- const response = await api.request('GET', '/v1/members', {
7
- pagination,
8
- });
9
- return {
10
- data: response.data.map((v) => new Member(api, v)),
11
- page: response.page,
12
- };
13
- }
14
- static async get(api, id) {
15
- const response = await api.request('GET', `/v1/members/${id}`);
16
- return new Member(api, response.data);
17
- }
18
- constructor(api, data) {
19
- super(api, data, `/v1/members/${data.id}`);
20
- Object.defineProperty(this, "eventManager", {
21
- enumerable: true,
22
- configurable: true,
23
- writable: true,
24
- value: new EventManager()
25
- });
26
- }
27
- applyResponse(oldData, newData) {
28
- const response = {
29
- // TODO: CachedRelation should fetch data on access if undefined
30
- display: oldData?.display ??
31
- new CachedRelation(() => new Display(this.api, this, newData.display)),
32
- permissions: oldData?.permissions ??
33
- new CachedRelation(() => new PermissionsList(newData.permissions)),
34
- };
35
- if (newData.display) {
36
- response.display.setCache(new Display(this.api, this, newData.display));
37
- }
38
- if (newData.permissions) {
39
- response.permissions.setCache(new PermissionsList(newData.permissions));
40
- }
41
- return response;
42
- }
43
- on(event, func) {
44
- return this.eventManager.on(event, func);
45
- }
46
- off(event, func) {
47
- return this.eventManager.off(event, func);
48
- }
49
- get name() {
50
- return this.nickname || `${this.firstName} ${this.lastName}`;
51
- }
52
- async update(data) {
53
- const response = await this.api.request('PATCH', `/v1/members/${this.id}`, {
54
- body: {
55
- email: data.email,
56
- first_name: data.firstName,
57
- last_name: data.lastName,
58
- nickname: data.nickname,
59
- display: data.display,
60
- },
61
- });
62
- this.updateSelf(response.data);
63
- this.eventManager.dispatch('update', this);
64
- }
65
- //> Accessors
66
- get id() {
67
- return this.response.id;
68
- }
69
- get email() {
70
- return this.response.email;
71
- }
72
- get firstName() {
73
- return this.response.first_name;
74
- }
75
- get lastName() {
76
- return this.response.last_name;
77
- }
78
- get nickname() {
79
- return this.response.nickname;
80
- }
81
- get avatarUri() {
82
- return this.response.avatar_uri;
83
- }
84
- get createdAt() {
85
- return new Date(this.response.created_at);
86
- }
87
- get updatedAt() {
88
- return new Date(this.response.created_at);
89
- }
90
- get display() {
91
- return this.response.display;
92
- }
93
- get permissions() {
94
- return this.response.permissions;
95
- }
96
- }
97
- export class Display {
98
- get language() {
99
- return this.response.language;
100
- }
101
- get theme() {
102
- return this.response.theme;
103
- }
104
- constructor(api, member, response) {
105
- Object.defineProperty(this, "api", {
106
- enumerable: true,
107
- configurable: true,
108
- writable: true,
109
- value: api
110
- });
111
- Object.defineProperty(this, "member", {
112
- enumerable: true,
113
- configurable: true,
114
- writable: true,
115
- value: member
116
- });
117
- Object.defineProperty(this, "response", {
118
- enumerable: true,
119
- configurable: true,
120
- writable: true,
121
- value: response
122
- });
123
- }
124
- async update(data) {
125
- await this.member.update({ display: data });
126
- }
127
- }
128
- export class PermissionsList {
129
- constructor(permissions) {
130
- Object.defineProperty(this, "permissions", {
131
- enumerable: true,
132
- configurable: true,
133
- writable: true,
134
- value: permissions
135
- });
136
- }
137
- has(permission) {
138
- return this.permissions.includes(permission);
139
- }
140
- }
@@ -1,78 +0,0 @@
1
- import type { MeowPanelApi, Page } from '../api.js';
2
- import { CachedRelation } from '../utils/cache.js';
3
- import { Member } from './member_2.js';
4
- export type NodeInclude = 'location' | 'type' | 'connection';
5
- export declare class Node {
6
- protected readonly api: MeowPanelApi;
7
- static getPaged(api: MeowPanelApi, page: number, include?: NodeInclude[]): Promise<{
8
- servers: Node[];
9
- page: Page;
10
- }>;
11
- static get(api: MeowPanelApi, id: string, include?: NodeInclude[]): Promise<Node>;
12
- constructor(api: MeowPanelApi, data: Record<string, never>);
13
- readonly id: string;
14
- readonly name: string;
15
- readonly description: string;
16
- readonly owner: CachedRelation<Member>;
17
- readonly location: CachedRelation<NodeLocation>;
18
- readonly host: CachedRelation<NodeHost>;
19
- readonly type: CachedRelation<NodeType>;
20
- readonly num: number;
21
- readonly limits: Limits;
22
- readonly connection: {
23
- url: string;
24
- scheme: string;
25
- fqdn: string;
26
- port: string;
27
- };
28
- readonly isUnderMaintance: boolean;
29
- readonly canAutoDeploy: boolean;
30
- readonly isBehindProxy: boolean;
31
- readonly createdAt: Date;
32
- readonly updatedAt: Date;
33
- readonly fqdn: string | undefined;
34
- readonly notes: string | undefined;
35
- }
36
- interface Limits {
37
- memory_mb: number;
38
- memory_overallocate_mb: number;
39
- disk_mb: number;
40
- disk_overallocate_mb: number;
41
- upload_size_mb: number;
42
- }
43
- export declare class NodeLocation {
44
- protected readonly api: MeowPanelApi;
45
- constructor(api: MeowPanelApi, data: Record<string, never>);
46
- readonly id: string;
47
- readonly name: string;
48
- readonly short: string;
49
- readonly notes: string | null | undefined;
50
- readonly owner: CachedRelation<Member>;
51
- readonly createdAt: Date;
52
- readonly updatedAt: Date;
53
- }
54
- export declare class NodeHost {
55
- protected readonly api: MeowPanelApi;
56
- constructor(api: MeowPanelApi, data: Record<string, never>);
57
- readonly id: string;
58
- readonly name: string;
59
- readonly hostname: string;
60
- readonly color: string;
61
- readonly notes: string | null | undefined;
62
- readonly owner: CachedRelation<Member>;
63
- readonly createdAt: Date;
64
- readonly updatedAt: Date;
65
- }
66
- export declare class NodeType {
67
- protected readonly api: MeowPanelApi;
68
- constructor(api: MeowPanelApi, data: Record<string, never>);
69
- readonly id: string;
70
- readonly name: string;
71
- readonly short: string;
72
- readonly notes: string | null | undefined;
73
- readonly owner: CachedRelation<Member>;
74
- readonly createdAt: Date;
75
- readonly updatedAt: Date;
76
- }
77
- export {};
78
- //# sourceMappingUR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AK,CAAC;IAY5B,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,SAAgB,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACjD,SAAgB,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAC9C,SAAgB,SAAS,EAAE,IAAI,CAAC;IAChC,SAAgB,SAAS,EAAE,IAAI,CAAC;CAChC;AAED,qBAAa,QAAQ;IAEnB,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,YAAY;gBAAjB,GAAG,EAAE,YAAY,EACpC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;IAW5B,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,SAAgB,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACjD,SAAgB,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAC9C,SAAgB,SAAS,EAAE,IAAI,CAAC;IAChC,SAAgB,SAAS,EAAE,IAAI,CAAC;CAChC"}
@@ -1,342 +0,0 @@
1
- import { CachedRelation } from '../utils/cache.js';
2
- import { Member } from './member_2.js';
3
- export class Node {
4
- static async getPaged(api, page, include) {
5
- const response = await api.request('GET', `/v1/nodes`, {
6
- pagination: { page },
7
- params: {
8
- include: include?.join(','),
9
- },
10
- });
11
- return {
12
- servers: response.data.map((data) => new Node(api, data)),
13
- page: response.page,
14
- };
15
- }
16
- static async get(api, id, include) {
17
- const response = await api.request('GET', `/v1/nodes/${id}`, {
18
- params: {
19
- include: include?.join(','),
20
- },
21
- });
22
- return new Node(api, response.data);
23
- }
24
- constructor(api, data) {
25
- Object.defineProperty(this, "api", {
26
- enumerable: true,
27
- configurable: true,
28
- writable: true,
29
- value: api
30
- });
31
- Object.defineProperty(this, "id", {
32
- enumerable: true,
33
- configurable: true,
34
- writable: true,
35
- value: void 0
36
- });
37
- Object.defineProperty(this, "name", {
38
- enumerable: true,
39
- configurable: true,
40
- writable: true,
41
- value: void 0
42
- });
43
- Object.defineProperty(this, "description", {
44
- enumerable: true,
45
- configurable: true,
46
- writable: true,
47
- value: void 0
48
- });
49
- Object.defineProperty(this, "owner", {
50
- enumerable: true,
51
- configurable: true,
52
- writable: true,
53
- value: void 0
54
- });
55
- Object.defineProperty(this, "location", {
56
- enumerable: true,
57
- configurable: true,
58
- writable: true,
59
- value: void 0
60
- });
61
- Object.defineProperty(this, "host", {
62
- enumerable: true,
63
- configurable: true,
64
- writable: true,
65
- value: void 0
66
- });
67
- Object.defineProperty(this, "type", {
68
- enumerable: true,
69
- configurable: true,
70
- writable: true,
71
- value: void 0
72
- });
73
- Object.defineProperty(this, "num", {
74
- enumerable: true,
75
- configurable: true,
76
- writable: true,
77
- value: void 0
78
- });
79
- Object.defineProperty(this, "limits", {
80
- enumerable: true,
81
- configurable: true,
82
- writable: true,
83
- value: void 0
84
- });
85
- Object.defineProperty(this, "connection", {
86
- enumerable: true,
87
- configurable: true,
88
- writable: true,
89
- value: void 0
90
- });
91
- Object.defineProperty(this, "isUnderMaintance", {
92
- enumerable: true,
93
- configurable: true,
94
- writable: true,
95
- value: void 0
96
- });
97
- Object.defineProperty(this, "canAutoDeploy", {
98
- enumerable: true,
99
- configurable: true,
100
- writable: true,
101
- value: void 0
102
- });
103
- Object.defineProperty(this, "isBehindProxy", {
104
- enumerable: true,
105
- configurable: true,
106
- writable: true,
107
- value: void 0
108
- });
109
- Object.defineProperty(this, "createdAt", {
110
- enumerable: true,
111
- configurable: true,
112
- writable: true,
113
- value: void 0
114
- });
115
- Object.defineProperty(this, "updatedAt", {
116
- enumerable: true,
117
- configurable: true,
118
- writable: true,
119
- value: void 0
120
- });
121
- Object.defineProperty(this, "fqdn", {
122
- enumerable: true,
123
- configurable: true,
124
- writable: true,
125
- value: void 0
126
- });
127
- Object.defineProperty(this, "notes", {
128
- enumerable: true,
129
- configurable: true,
130
- writable: true,
131
- value: void 0
132
- });
133
- this.id = data.id;
134
- this.name = data.name;
135
- this.description = data.description;
136
- this.owner = new CachedRelation(() => Member.get(api, data.owner_id));
137
- this.owner.setCache(data.owner);
138
- // TODO: Implement Node Location, Host, Type API endpoints
139
- this.location = new CachedRelation(() => {
140
- throw new Error('Not implemented');
141
- });
142
- this.host = new CachedRelation(() => {
143
- throw new Error('Not implemented');
144
- });
145
- this.type = new CachedRelation(() => {
146
- throw new Error('Not implemented');
147
- });
148
- this.num = data.num;
149
- this.limits = data.limits;
150
- this.connection = data.connection ?? null;
151
- this.isUnderMaintance = data.is_under_maintance;
152
- this.canAutoDeploy = data.can_auto_deploy;
153
- this.isBehindProxy = data.is_behind_proxy;
154
- this.notes = data.notes;
155
- this.createdAt = data.created_at;
156
- this.updatedAt = data.updated_at;
157
- }
158
- }
159
- export class NodeLocation {
160
- constructor(api, data) {
161
- Object.defineProperty(this, "api", {
162
- enumerable: true,
163
- configurable: true,
164
- writable: true,
165
- value: api
166
- });
167
- Object.defineProperty(this, "id", {
168
- enumerable: true,
169
- configurable: true,
170
- writable: true,
171
- value: void 0
172
- });
173
- Object.defineProperty(this, "name", {
174
- enumerable: true,
175
- configurable: true,
176
- writable: true,
177
- value: void 0
178
- });
179
- Object.defineProperty(this, "short", {
180
- enumerable: true,
181
- configurable: true,
182
- writable: true,
183
- value: void 0
184
- });
185
- Object.defineProperty(this, "notes", {
186
- enumerable: true,
187
- configurable: true,
188
- writable: true,
189
- value: void 0
190
- });
191
- Object.defineProperty(this, "owner", {
192
- enumerable: true,
193
- configurable: true,
194
- writable: true,
195
- value: void 0
196
- });
197
- Object.defineProperty(this, "createdAt", {
198
- enumerable: true,
199
- configurable: true,
200
- writable: true,
201
- value: void 0
202
- });
203
- Object.defineProperty(this, "updatedAt", {
204
- enumerable: true,
205
- configurable: true,
206
- writable: true,
207
- value: void 0
208
- });
209
- this.id = data.id;
210
- this.name = data.name;
211
- this.short = data.short;
212
- this.notes = data.notes;
213
- this.owner = new CachedRelation(() => Member.get(api, data.owner_id));
214
- this.createdAt = new Date(data.created_at);
215
- this.updatedAt = new Date(data.updated_at);
216
- }
217
- }
218
- export class NodeHost {
219
- constructor(api, data) {
220
- Object.defineProperty(this, "api", {
221
- enumerable: true,
222
- configurable: true,
223
- writable: true,
224
- value: api
225
- });
226
- Object.defineProperty(this, "id", {
227
- enumerable: true,
228
- configurable: true,
229
- writable: true,
230
- value: void 0
231
- });
232
- Object.defineProperty(this, "name", {
233
- enumerable: true,
234
- configurable: true,
235
- writable: true,
236
- value: void 0
237
- });
238
- Object.defineProperty(this, "hostname", {
239
- enumerable: true,
240
- configurable: true,
241
- writable: true,
242
- value: void 0
243
- });
244
- Object.defineProperty(this, "color", {
245
- enumerable: true,
246
- configurable: true,
247
- writable: true,
248
- value: void 0
249
- });
250
- Object.defineProperty(this, "notes", {
251
- enumerable: true,
252
- configurable: true,
253
- writable: true,
254
- value: void 0
255
- });
256
- Object.defineProperty(this, "owner", {
257
- enumerable: true,
258
- configurable: true,
259
- writable: true,
260
- value: void 0
261
- });
262
- Object.defineProperty(this, "createdAt", {
263
- enumerable: true,
264
- configurable: true,
265
- writable: true,
266
- value: void 0
267
- });
268
- Object.defineProperty(this, "updatedAt", {
269
- enumerable: true,
270
- configurable: true,
271
- writable: true,
272
- value: void 0
273
- });
274
- this.id = data.id;
275
- this.name = data.name;
276
- this.hostname = data.hostname;
277
- this.color = data.color;
278
- this.notes = data.notes;
279
- this.owner = new CachedRelation(() => Member.get(api, data.owner_id));
280
- this.createdAt = new Date(data.created_at);
281
- this.updatedAt = new Date(data.updated_at);
282
- }
283
- }
284
- export class NodeType {
285
- constructor(api, data) {
286
- Object.defineProperty(this, "api", {
287
- enumerable: true,
288
- configurable: true,
289
- writable: true,
290
- value: api
291
- });
292
- Object.defineProperty(this, "id", {
293
- enumerable: true,
294
- configurable: true,
295
- writable: true,
296
- value: void 0
297
- });
298
- Object.defineProperty(this, "name", {
299
- enumerable: true,
300
- configurable: true,
301
- writable: true,
302
- value: void 0
303
- });
304
- Object.defineProperty(this, "short", {
305
- enumerable: true,
306
- configurable: true,
307
- writable: true,
308
- value: void 0
309
- });
310
- Object.defineProperty(this, "notes", {
311
- enumerable: true,
312
- configurable: true,
313
- writable: true,
314
- value: void 0
315
- });
316
- Object.defineProperty(this, "owner", {
317
- enumerable: true,
318
- configurable: true,
319
- writable: true,
320
- value: void 0
321
- });
322
- Object.defineProperty(this, "createdAt", {
323
- enumerable: true,
324
- configurable: true,
325
- writable: true,
326
- value: void 0
327
- });
328
- Object.defineProperty(this, "updatedAt", {
329
- enumerable: true,
330
- configurable: true,
331
- writable: true,
332
- value: void 0
333
- });
334
- this.id = data.id;
335
- this.name = data.name;
336
- this.short = data.short;
337
- this.notes = data.notes;
338
- this.owner = new CachedRelation(() => Member.get(api, data.owner_id));
339
- this.createdAt = new Date(data.created_at);
340
- this.updatedAt = new Date(data.updated_at);
341
- }
342
- }
@@ -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;I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