@kinotic-ai/system-api 5.0.0-beta.2 → 5.0.0-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,41 +1,8 @@
1
1
  // packages/system-api/src/index.ts
2
2
  import { SYSTEM_API_ZONE as SYSTEM_API_ZONE8 } from "@kinotic-ai/management-api";
3
3
 
4
- // packages/system-api/src/api/model/workload/LogPolicy.ts
5
- class LogPolicy {
6
- maxSizeMb = 10;
7
- maxFiles = 3;
8
- }
9
- // packages/system-api/src/api/model/workload/NetworkMode.ts
10
- var NetworkMode;
11
- ((NetworkMode2) => {
12
- NetworkMode2["ENABLED"] = "ENABLED";
13
- NetworkMode2["DISABLED"] = "DISABLED";
14
- })(NetworkMode ||= {});
15
- // packages/system-api/src/api/model/workload/NetworkPolicy.ts
16
- class NetworkPolicy {
17
- mode = "ENABLED" /* ENABLED */;
18
- allowedHosts = [];
19
- }
20
- // packages/system-api/src/api/model/workload/PortProtocol.ts
21
- var PortProtocol;
22
- ((PortProtocol2) => {
23
- PortProtocol2["TCP"] = "TCP";
24
- PortProtocol2["UDP"] = "UDP";
25
- })(PortProtocol ||= {});
26
- // packages/system-api/src/api/model/workload/VmNodeStatusType.ts
27
- var VmNodeStatusType;
28
- ((VmNodeStatusType2) => {
29
- VmNodeStatusType2["ONLINE"] = "ONLINE";
30
- VmNodeStatusType2["OFFLINE"] = "OFFLINE";
31
- VmNodeStatusType2["DRAINING"] = "DRAINING";
32
- })(VmNodeStatusType ||= {});
33
-
34
- // packages/system-api/src/api/model/workload/VmNodeStatus.ts
35
- class VmNodeStatus {
36
- type = "ONLINE" /* ONLINE */;
37
- healthMessage = null;
38
- }
4
+ // packages/system-api/src/api/model/workload/VmNode.ts
5
+ import { ReconcileState } from "@kinotic-ai/management-api";
39
6
 
40
7
  // packages/system-api/src/api/model/workload/VmProviderType.ts
41
8
  var VmProviderType;
@@ -49,14 +16,15 @@ class VmNode {
49
16
  id;
50
17
  name;
51
18
  hostname;
52
- status = new VmNodeStatus;
19
+ state = new ReconcileState;
20
+ healthMessage = null;
53
21
  providerType = "BOXLITE" /* BOXLITE */;
54
22
  totalCpus = 0;
55
23
  totalMemoryMb = 0;
56
24
  totalDiskMb = 0;
57
- allocatedCpus = 0;
58
- allocatedMemoryMb = 0;
59
- allocatedDiskMb = 0;
25
+ freeCpus = 0;
26
+ freeMemoryMb = 0;
27
+ freeDiskMb = 0;
60
28
  lastSeen = null;
61
29
  workloadDataDir = null;
62
30
  constructor(id, name, hostname) {
@@ -65,49 +33,13 @@ class VmNode {
65
33
  this.hostname = hostname;
66
34
  }
67
35
  }
68
- // packages/system-api/src/api/model/workload/WorkloadStatus.ts
69
- var WorkloadStatus;
70
- ((WorkloadStatus2) => {
71
- WorkloadStatus2["PENDING"] = "PENDING";
72
- WorkloadStatus2["STARTING"] = "STARTING";
73
- WorkloadStatus2["RUNNING"] = "RUNNING";
74
- WorkloadStatus2["STOPPING"] = "STOPPING";
75
- WorkloadStatus2["STOPPED"] = "STOPPED";
76
- WorkloadStatus2["FAILED"] = "FAILED";
77
- })(WorkloadStatus ||= {});
78
-
79
- // packages/system-api/src/api/model/workload/Workload.ts
80
- class Workload {
81
- id = null;
82
- name;
83
- description;
84
- nodeId = null;
85
- organizationId = null;
86
- applicationId = null;
87
- image;
88
- vcpus = 1;
89
- memoryMb = 512;
90
- diskSizeMb = 1024;
91
- network = new NetworkPolicy;
92
- logPolicy = new LogPolicy;
93
- detached = true;
94
- autoRemove = false;
95
- status = "PENDING" /* PENDING */;
96
- exitCode = null;
97
- environment = {};
98
- secrets = {};
99
- portMappings = [];
100
- volumeMounts = [];
101
- entrypoint = [];
102
- cmd = [];
103
- created = null;
104
- updated = null;
105
- constructor(name, image) {
106
- this.name = name;
107
- this.image = image;
108
- }
109
- }
110
- // packages/system-api/src/api/model/VmNodeRegistration.ts
36
+ // packages/system-api/src/api/model/workload/VmNodeStatusType.ts
37
+ var VmNodeStatusType;
38
+ ((VmNodeStatusType2) => {
39
+ VmNodeStatusType2["ONLINE"] = "ONLINE";
40
+ VmNodeStatusType2["DRAINING"] = "DRAINING";
41
+ })(VmNodeStatusType ||= {});
42
+ // packages/system-api/src/api/model/workload/VmNodeRegistration.ts
111
43
  class VmNodeRegistration {
112
44
  id;
113
45
  name;
@@ -123,71 +55,82 @@ class VmNodeRegistration {
123
55
  this.hostname = hostname;
124
56
  }
125
57
  }
126
- // packages/system-api/src/api/services/IVmNodeService.ts
58
+ // packages/system-api/src/api/services/workload/IVmNodeService.ts
127
59
  import { SYSTEM_API_ZONE } from "@kinotic-ai/management-api";
128
- import { CrudServiceProxy } from "@kinotic-ai/core";
60
+ import { CrudServiceProxy, FunctionalIterablePage } from "@kinotic-ai/core";
129
61
 
130
62
  class VmNodeServiceProxy extends CrudServiceProxy {
131
63
  constructor(kinotic) {
132
- super(kinotic.serviceProxy(`${SYSTEM_API_ZONE}~org.kinotic.system.api.services.VmNodeService`));
64
+ super(kinotic.serviceProxy(`${SYSTEM_API_ZONE}~org.kinotic.system.api.services.workload.VmNodeService`));
65
+ }
66
+ async findHistory(nodeId, pageable) {
67
+ const page = await this.findHistorySinglePage(nodeId, pageable);
68
+ return new FunctionalIterablePage(pageable, page, (pageable2) => this.findHistorySinglePage(nodeId, pageable2));
133
69
  }
134
- findAvailableNode(requiredCpus, requiredMemoryMb, requiredDiskMb) {
135
- return this.serviceProxy.invoke("findAvailableNode", [requiredCpus, requiredMemoryMb, requiredDiskMb]);
70
+ findHistorySinglePage(nodeId, pageable) {
71
+ return this.serviceProxy.invoke("findHistory", [nodeId, pageable]);
136
72
  }
137
73
  syncIndex() {
138
74
  return this.serviceProxy.invoke("syncIndex", []);
139
75
  }
140
76
  }
141
- // packages/system-api/src/api/services/IWorkloadService.ts
77
+ // packages/system-api/src/api/services/workload/IWorkloadService.ts
142
78
  import { SYSTEM_API_ZONE as SYSTEM_API_ZONE2 } from "@kinotic-ai/management-api";
143
- import { CrudServiceProxy as CrudServiceProxy2, FunctionalIterablePage } from "@kinotic-ai/core";
79
+ import { CrudServiceProxy as CrudServiceProxy2, FunctionalIterablePage as FunctionalIterablePage2 } from "@kinotic-ai/core";
144
80
 
145
81
  class WorkloadServiceProxy extends CrudServiceProxy2 {
146
82
  constructor(kinotic) {
147
- super(kinotic.serviceProxy(`${SYSTEM_API_ZONE2}~org.kinotic.system.api.services.WorkloadService`));
83
+ super(kinotic.serviceProxy(`${SYSTEM_API_ZONE2}~org.kinotic.system.api.services.workload.WorkloadService`));
148
84
  }
149
85
  async findAllForNode(nodeId, pageable) {
150
86
  const page = await this.findAllForNodeSinglePage(nodeId, pageable);
151
- return new FunctionalIterablePage(pageable, page, (pageable2) => this.findAllForNodeSinglePage(nodeId, pageable2));
87
+ return new FunctionalIterablePage2(pageable, page, (pageable2) => this.findAllForNodeSinglePage(nodeId, pageable2));
152
88
  }
153
89
  findAllForNodeSinglePage(nodeId, pageable) {
154
90
  return this.serviceProxy.invoke("findAllForNode", [nodeId, pageable]);
155
91
  }
156
- countForNode(nodeId) {
157
- return this.serviceProxy.invoke("countForNode", [nodeId]);
92
+ async findHistory(workloadId, pageable) {
93
+ const page = await this.findHistorySinglePage(workloadId, pageable);
94
+ return new FunctionalIterablePage2(pageable, page, (pageable2) => this.findHistorySinglePage(workloadId, pageable2));
95
+ }
96
+ findHistorySinglePage(workloadId, pageable) {
97
+ return this.serviceProxy.invoke("findHistory", [workloadId, pageable]);
158
98
  }
159
99
  syncIndex() {
160
100
  return this.serviceProxy.invoke("syncIndex", []);
161
101
  }
162
102
  }
163
- // packages/system-api/src/api/services/IWorkloadOrchestrationService.ts
103
+ // packages/system-api/src/api/services/workload/IWorkloadOrchestrationService.ts
164
104
  import { SYSTEM_API_ZONE as SYSTEM_API_ZONE3 } from "@kinotic-ai/management-api";
165
105
 
166
106
  class WorkloadOrchestrationService {
167
107
  serviceProxy;
168
108
  constructor(kinotic) {
169
- this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE3}~org.kinotic.system.api.services.WorkloadOrchestrationService`);
109
+ this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE3}~org.kinotic.system.api.services.workload.WorkloadOrchestrationService`);
170
110
  }
171
111
  deployWorkload(workload) {
172
112
  return this.serviceProxy.invoke("deployWorkload", [workload]);
173
113
  }
174
- restartWorkload(workloadId) {
175
- return this.serviceProxy.invoke("restartWorkload", [workloadId]);
176
- }
177
114
  stopWorkload(workloadId) {
178
115
  return this.serviceProxy.invoke("stopWorkload", [workloadId]);
179
116
  }
180
117
  destroyWorkload(workloadId) {
181
118
  return this.serviceProxy.invoke("destroyWorkload", [workloadId]);
182
119
  }
120
+ deleteWorkload(workloadId) {
121
+ return this.serviceProxy.invoke("deleteWorkload", [workloadId]);
122
+ }
123
+ deleteWorkloads(workloadIds) {
124
+ return this.serviceProxy.invoke("deleteWorkloads", [workloadIds]);
125
+ }
183
126
  }
184
- // packages/system-api/src/api/services/VmNodeOrchestrationServiceProxy.ts
127
+ // packages/system-api/src/api/services/workload/VmNodeOrchestrationServiceProxy.ts
185
128
  import { SYSTEM_API_ZONE as SYSTEM_API_ZONE4 } from "@kinotic-ai/management-api";
186
129
 
187
130
  class VmNodeOrchestrationServiceProxy {
188
131
  serviceProxy;
189
132
  constructor(kinotic) {
190
- this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE4}~org.kinotic.system.api.services.VmNodeOrchestrationService`);
133
+ this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE4}~org.kinotic.system.api.services.workload.VmNodeOrchestrationService`);
191
134
  }
192
135
  registerNode(registration) {
193
136
  return this.serviceProxy.invoke("registerNode", [registration]);
@@ -202,9 +145,6 @@ class VmNodeOrchestrationServiceProxy {
202
145
  return this.serviceProxy.invoke("deregisterNode", [nodeId]);
203
146
  }
204
147
  }
205
- // packages/system-api/src/api/services/LogManager.ts
206
- import { SYSTEM_API_ZONE as SYSTEM_API_ZONE5 } from "@kinotic-ai/management-api";
207
-
208
148
  // packages/system-api/src/api/services/ILogManager.ts
209
149
  var LogLevel;
210
150
  ((LogLevel2) => {
@@ -235,11 +175,16 @@ class LoggersDescriptor {
235
175
  groups = new Map;
236
176
  }
237
177
 
178
+ class TraceLogProperties {
179
+ includes = [];
180
+ excludes = [];
181
+ }
182
+
238
183
  // packages/system-api/src/api/services/LogManager.ts
239
184
  class LogManager {
240
185
  serviceProxy;
241
186
  constructor(kinotic) {
242
- this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE5}~org.kinotic.system.api.services.LogManager`);
187
+ this.serviceProxy = kinotic.serviceProxy("org.kinotic.core.api.log.LogManager");
243
188
  }
244
189
  loggers(nodeId) {
245
190
  return this.serviceProxy.invoke("loggers", null, nodeId);
@@ -260,15 +205,24 @@ class LogManager {
260
205
  configureLogLevel(nodeId, name, level) {
261
206
  return this.serviceProxy.invoke("configureLogLevel", [name, level], nodeId);
262
207
  }
208
+ async traceLog(nodeId) {
209
+ const data = await this.serviceProxy.invoke("traceLog", null, nodeId);
210
+ const ret = new TraceLogProperties;
211
+ Object.assign(ret, data);
212
+ return ret;
213
+ }
214
+ configureTraceLog(nodeId, traceLog) {
215
+ return this.serviceProxy.invoke("configureTraceLog", [traceLog], nodeId);
216
+ }
263
217
  }
264
218
 
265
219
  // packages/system-api/src/api/services/IKinoticClusterInfoService.ts
266
- import { SYSTEM_API_ZONE as SYSTEM_API_ZONE6 } from "@kinotic-ai/management-api";
220
+ import { SYSTEM_API_ZONE as SYSTEM_API_ZONE5 } from "@kinotic-ai/management-api";
267
221
 
268
222
  class KinoticClusterInfoService {
269
223
  serviceProxy;
270
224
  constructor(kinotic) {
271
- this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE6}~org.kinotic.system.api.services.KinoticClusterInfoService`);
225
+ this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE5}~org.kinotic.system.api.services.KinoticClusterInfoService`);
272
226
  }
273
227
  getClusterInfo() {
274
228
  return this.serviceProxy.invoke("getClusterInfo");
@@ -277,13 +231,13 @@ class KinoticClusterInfoService {
277
231
 
278
232
  // packages/system-api/src/api/services/ISystemOrganizationService.ts
279
233
  import {
280
- SYSTEM_API_ZONE as SYSTEM_API_ZONE7
234
+ SYSTEM_API_ZONE as SYSTEM_API_ZONE6
281
235
  } from "@kinotic-ai/management-api";
282
236
 
283
237
  class SystemOrganizationService {
284
238
  serviceProxy;
285
239
  constructor(kinotic) {
286
- this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE7}~org.kinotic.system.api.services.SystemOrganizationService`);
240
+ this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE6}~org.kinotic.system.api.services.SystemOrganizationService`);
287
241
  }
288
242
  findOrganizations(pageable) {
289
243
  return this.serviceProxy.invoke("findOrganizations", [pageable]);
@@ -314,6 +268,39 @@ class SystemOrganizationService {
314
268
  }
315
269
  }
316
270
 
271
+ // packages/system-api/src/api/services/ISystemMemberService.ts
272
+ import {
273
+ SYSTEM_API_ZONE as SYSTEM_API_ZONE7
274
+ } from "@kinotic-ai/management-api";
275
+
276
+ class SystemMemberService {
277
+ serviceProxy;
278
+ constructor(kinotic) {
279
+ this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE7}~org.kinotic.system.api.services.SystemMemberService`);
280
+ }
281
+ findUsers(pageable) {
282
+ return this.serviceProxy.invoke("findUsers", [pageable]);
283
+ }
284
+ searchUsers(searchText, pageable) {
285
+ return this.serviceProxy.invoke("searchUsers", [searchText, pageable]);
286
+ }
287
+ findMachines(pageable) {
288
+ return this.serviceProxy.invoke("findMachines", [pageable]);
289
+ }
290
+ createMachine(displayName) {
291
+ return this.serviceProxy.invoke("createMachine", [displayName]);
292
+ }
293
+ rotateSecret(machineId) {
294
+ return this.serviceProxy.invoke("rotateSecret", [machineId]);
295
+ }
296
+ setMachineEnabled(machineId, enabled) {
297
+ return this.serviceProxy.invoke("setMachineEnabled", [machineId, enabled]);
298
+ }
299
+ removeMachine(machineId) {
300
+ return this.serviceProxy.invoke("removeMachine", [machineId]);
301
+ }
302
+ }
303
+
317
304
  // packages/system-api/src/api/SystemApiPlugin.ts
318
305
  var SystemApiPlugin = {
319
306
  install(kinotic) {
@@ -323,11 +310,12 @@ var SystemApiPlugin = {
323
310
  workloadOrchestration: new WorkloadOrchestrationService(kinotic),
324
311
  logManager: new LogManager(kinotic),
325
312
  clusterInfo: new KinoticClusterInfoService(kinotic),
326
- systemOrganizations: new SystemOrganizationService(kinotic)
313
+ systemOrganizations: new SystemOrganizationService(kinotic),
314
+ systemMembers: new SystemMemberService(kinotic)
327
315
  };
328
316
  }
329
317
  };
330
- // packages/system-api/src/api/model/KinoticClusterInfo.ts
318
+ // packages/system-api/src/api/model/cluster/KinoticClusterInfo.ts
331
319
  class KinoticClusterInfo {
332
320
  localNodeId = "";
333
321
  serverNodeCount = 0;
@@ -336,35 +324,32 @@ class KinoticClusterInfo {
336
324
  nodes = [];
337
325
  active = false;
338
326
  }
339
- // packages/system-api/src/api/model/KinoticNodeInfo.ts
327
+ // packages/system-api/src/api/model/cluster/KinoticNodeInfo.ts
340
328
  class KinoticNodeInfo {
341
329
  nodeId = "";
342
330
  order = 0;
343
331
  local = false;
332
+ addresses = [];
333
+ hostNames = [];
344
334
  version = "";
345
335
  }
346
336
  export {
347
- WorkloadStatus,
348
337
  WorkloadServiceProxy,
349
338
  WorkloadOrchestrationService,
350
- Workload,
351
339
  VmProviderType,
352
340
  VmNodeStatusType,
353
- VmNodeStatus,
354
341
  VmNodeServiceProxy,
355
342
  VmNodeRegistration,
356
343
  VmNodeOrchestrationServiceProxy,
357
344
  VmNode,
345
+ TraceLogProperties,
358
346
  SystemOrganizationService,
347
+ SystemMemberService,
359
348
  SystemApiPlugin,
360
349
  SingleLoggerLevelsDescriptor,
361
350
  SYSTEM_API_ZONE8 as SYSTEM_API_ZONE,
362
- PortProtocol,
363
- NetworkPolicy,
364
- NetworkMode,
365
351
  LoggersDescriptor,
366
352
  LoggerLevelsDescriptor,
367
- LogPolicy,
368
353
  LogManager,
369
354
  LogLevel,
370
355
  KinoticNodeInfo,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kinotic-ai/system-api",
3
- "version": "5.0.0-beta.2",
3
+ "version": "5.0.0-beta.20",
4
4
  "type": "module",
5
5
  "description": "Client API for the Kinotic platform's system plane: the workload and node orchestration services platform machines and operators use.",
6
6
  "files": [
@@ -37,14 +37,13 @@
37
37
  "test": "bun test --pass-with-no-tests",
38
38
  "coverage": "bun test --coverage --pass-with-no-tests"
39
39
  },
40
- "dependencies": {
41
- "@kinotic-ai/management-api": "5.0.0-beta.20"
42
- },
43
40
  "peerDependencies": {
44
- "@kinotic-ai/core": ">=5.0.0-beta.6"
41
+ "@kinotic-ai/core": "^5.0.0-beta.17",
42
+ "@kinotic-ai/management-api": "^5.0.0-beta.42"
45
43
  },
46
44
  "devDependencies": {
47
- "@kinotic-ai/core": "5.0.0-beta.6",
45
+ "@kinotic-ai/core": "5.0.0-beta.17",
46
+ "@kinotic-ai/management-api": "5.0.0-beta.42",
48
47
  "@types/bun": "^1.3.9",
49
48
  "typescript": "^5.9.3"
50
49
  }