@kinotic-ai/system-api 5.0.0-beta.22 → 5.0.0-beta.24

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.cjs CHANGED
@@ -53,8 +53,9 @@ __export(exports_src, {
53
53
  SystemOrganizationService: () => SystemOrganizationService,
54
54
  SystemMemberService: () => SystemMemberService,
55
55
  SystemApiPlugin: () => SystemApiPlugin,
56
+ SystemAccessService: () => SystemAccessService,
56
57
  SingleLoggerLevelsDescriptor: () => SingleLoggerLevelsDescriptor,
57
- SYSTEM_API_ZONE: () => import_management_api10.SYSTEM_API_ZONE,
58
+ SYSTEM_API_ZONE: () => import_management_api11.SYSTEM_API_ZONE,
58
59
  LoggersDescriptor: () => LoggersDescriptor,
59
60
  LoggerLevelsDescriptor: () => LoggerLevelsDescriptor,
60
61
  LogManager: () => LogManager,
@@ -65,7 +66,7 @@ __export(exports_src, {
65
66
  GroupLoggerLevelsDescriptor: () => GroupLoggerLevelsDescriptor
66
67
  });
67
68
  module.exports = __toCommonJS(exports_src);
68
- var import_management_api10 = require("@kinotic-ai/management-api");
69
+ var import_management_api11 = require("@kinotic-ai/management-api");
69
70
 
70
71
  // packages/system-api/src/api/model/workload/VmNode.ts
71
72
  var import_management_api = require("@kinotic-ai/management-api");
@@ -363,14 +364,39 @@ class SystemMemberService {
363
364
  }
364
365
  }
365
366
 
366
- // packages/system-api/src/api/services/IWatchEventService.ts
367
+ // packages/system-api/src/api/services/ISystemAccessService.ts
367
368
  var import_management_api9 = require("@kinotic-ai/management-api");
369
+
370
+ class SystemAccessService {
371
+ serviceProxy;
372
+ constructor(kinotic) {
373
+ this.serviceProxy = kinotic.serviceProxy(`${import_management_api9.SYSTEM_API_ZONE}~org.kinotic.system.api.services.SystemAccessService`);
374
+ }
375
+ findRoles() {
376
+ return this.serviceProxy.invoke("findRoles", []);
377
+ }
378
+ findGrants() {
379
+ return this.serviceProxy.invoke("findGrants", []);
380
+ }
381
+ grant(subject, roleId) {
382
+ return this.serviceProxy.invoke("grant", [subject, roleId]);
383
+ }
384
+ revoke(grantId) {
385
+ return this.serviceProxy.invoke("revoke", [grantId]);
386
+ }
387
+ explain(subject, permission) {
388
+ return this.serviceProxy.invoke("explain", [subject, permission]);
389
+ }
390
+ }
391
+
392
+ // packages/system-api/src/api/services/IWatchEventService.ts
393
+ var import_management_api10 = require("@kinotic-ai/management-api");
368
394
  var import_core3 = require("@kinotic-ai/core");
369
395
 
370
396
  class WatchEventService {
371
397
  serviceProxy;
372
398
  constructor(kinotic) {
373
- this.serviceProxy = kinotic.serviceProxy(`${import_management_api9.SYSTEM_API_ZONE}~org.kinotic.system.api.services.WatchEventService`);
399
+ this.serviceProxy = kinotic.serviceProxy(`${import_management_api10.SYSTEM_API_ZONE}~org.kinotic.system.api.services.WatchEventService`);
374
400
  }
375
401
  async findAll(pageable) {
376
402
  const page = await this.findAllSinglePage(pageable);
@@ -392,6 +418,7 @@ var SystemApiPlugin = {
392
418
  clusterInfo: new KinoticClusterInfoService(kinotic),
393
419
  systemOrganizations: new SystemOrganizationService(kinotic),
394
420
  systemMembers: new SystemMemberService(kinotic),
421
+ systemAccess: new SystemAccessService(kinotic),
395
422
  watchEvents: new WatchEventService(kinotic)
396
423
  };
397
424
  }
package/dist/index.d.cts CHANGED
@@ -88,7 +88,7 @@ declare class VmNode implements Reconcilable<VmNodeState> {
88
88
  /**
89
89
  * The date and time the node was last seen/heartbeat.
90
90
  */
91
- lastSeen: number | null;
91
+ lastSeen: string | null;
92
92
  /**
93
93
  * Base directory every workload volume mount on this node must live under. Reported by
94
94
  * the node at registration; deployment flows compose host paths under it.
@@ -505,8 +505,45 @@ declare class SystemMemberService implements ISystemMemberService {
505
505
  setMachineEnabled(machineId: string, enabled: boolean): Promise<void>;
506
506
  removeMachine(machineId: string): Promise<void>;
507
507
  }
508
- import { WatchEvent as WatchEvent3 } from "@kinotic-ai/management-api";
508
+ import { AccessExplanation, Grant, RoleDefinition, Subject } from "@kinotic-ai/management-api";
509
509
  import { IKinotic as IKinotic8 } from "@kinotic-ai/core";
510
+ /**
511
+ * Access control of the platform itself: the roles the platform's operators and machines can be
512
+ * granted, and the grants made on the platform, which reach every organization and node on it. A
513
+ * subject named must be one of the platform's own operators or machines.
514
+ */
515
+ interface ISystemAccessService {
516
+ /** The built-in roles the model defines, each with the permissions it bundles. */
517
+ findRoles(): Promise<RoleDefinition[]>;
518
+ /** The grants made on the platform. */
519
+ findGrants(): Promise<Grant[]>;
520
+ /**
521
+ * Grants a role to a platform operator or machine on the platform: the subject holds every
522
+ * permission the role bundles on the platform and on everything on it.
523
+ * @param subject a user naming an operator's or a machine's identity id
524
+ * @param roleId a built-in role's id
525
+ */
526
+ grant(subject: Subject, roleId: string): Promise<Grant>;
527
+ /** Revokes a grant made on the platform. */
528
+ revoke(grantId: string): Promise<void>;
529
+ /**
530
+ * Whether a platform operator or machine holds a permission of the platform, and the grants it
531
+ * holds the permission through.
532
+ * @param permission the permission's short name, such as can_manage_workloads
533
+ */
534
+ explain(subject: Subject, permission: string): Promise<AccessExplanation>;
535
+ }
536
+ declare class SystemAccessService implements ISystemAccessService {
537
+ private readonly serviceProxy;
538
+ constructor(kinotic: IKinotic8);
539
+ findRoles(): Promise<RoleDefinition[]>;
540
+ findGrants(): Promise<Grant[]>;
541
+ grant(subject: Subject, roleId: string): Promise<Grant>;
542
+ revoke(grantId: string): Promise<void>;
543
+ explain(subject: Subject, permission: string): Promise<AccessExplanation>;
544
+ }
545
+ import { WatchEvent as WatchEvent3 } from "@kinotic-ai/management-api";
546
+ import { IKinotic as IKinotic9 } from "@kinotic-ai/core";
510
547
  import { IterablePage as IterablePage3, Pageable as Pageable5 } from "@kinotic-ai/core";
511
548
  /**
512
549
  * The ledger of every watched record on the platform.
@@ -523,7 +560,7 @@ interface IWatchEventService {
523
560
  }
524
561
  declare class WatchEventService implements IWatchEventService {
525
562
  private readonly serviceProxy;
526
- constructor(kinotic: IKinotic8);
563
+ constructor(kinotic: IKinotic9);
527
564
  findAll(pageable: Pageable5): Promise<IterablePage3<WatchEvent3>>;
528
565
  private findAllSinglePage;
529
566
  }
@@ -535,13 +572,14 @@ interface ISystemApiExtension {
535
572
  clusterInfo: IKinoticClusterInfoService;
536
573
  systemOrganizations: ISystemOrganizationService;
537
574
  systemMembers: ISystemMemberService;
575
+ systemAccess: ISystemAccessService;
538
576
  watchEvents: IWatchEventService;
539
577
  }
540
578
  declare const SystemApiPlugin: KinoticPlugin<ISystemApiExtension>;
541
- import { IKinotic as IKinotic9 } from "@kinotic-ai/core";
579
+ import { IKinotic as IKinotic10 } from "@kinotic-ai/core";
542
580
  declare class LogManager implements ILogManager {
543
581
  private readonly serviceProxy;
544
- constructor(kinotic: IKinotic9);
582
+ constructor(kinotic: IKinotic10);
545
583
  loggers(nodeId: string): Promise<LoggersDescriptor>;
546
584
  loggerLevels(nodeId: string, name: string): Promise<LoggerLevelsDescriptor>;
547
585
  configureLogLevel(nodeId: string, name: string, level: LogLevel): Promise<void>;
@@ -551,4 +589,4 @@ declare class LogManager implements ILogManager {
551
589
  declare module "@kinotic-ai/core" {
552
590
  interface KinoticSingleton extends ISystemApiExtension {}
553
591
  }
554
- export { WorkloadStatusReport, WorkloadServiceProxy, WorkloadOrchestrationService, WatchEventService, VmProviderType, VmNodeStatusType, VmNodeState, VmNodeServiceProxy, VmNodeRegistration, VmNodeOrchestrationServiceProxy, VmNode, TraceLogProperties, SystemOrganizationService, SystemMemberService, SystemApiPlugin, SingleLoggerLevelsDescriptor, SYSTEM_API_ZONE, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticNodeInfo, KinoticClusterInfoService, KinoticClusterInfo, IWorkloadService, IWorkloadOrchestrationService, IWatchEventService, IVmNodeService, ISystemOrganizationService, ISystemMemberService, ISystemApiExtension, ILogManager, IKinoticClusterInfoService, GroupLoggerLevelsDescriptor };
592
+ export { WorkloadStatusReport, WorkloadServiceProxy, WorkloadOrchestrationService, WatchEventService, VmProviderType, VmNodeStatusType, VmNodeState, VmNodeServiceProxy, VmNodeRegistration, VmNodeOrchestrationServiceProxy, VmNode, TraceLogProperties, SystemOrganizationService, SystemMemberService, SystemApiPlugin, SystemAccessService, SingleLoggerLevelsDescriptor, SYSTEM_API_ZONE, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticNodeInfo, KinoticClusterInfoService, KinoticClusterInfo, IWorkloadService, IWorkloadOrchestrationService, IWatchEventService, IVmNodeService, ISystemOrganizationService, ISystemMemberService, ISystemApiExtension, ISystemAccessService, ILogManager, IKinoticClusterInfoService, GroupLoggerLevelsDescriptor };
package/dist/index.d.ts CHANGED
@@ -88,7 +88,7 @@ declare class VmNode implements Reconcilable<VmNodeState> {
88
88
  /**
89
89
  * The date and time the node was last seen/heartbeat.
90
90
  */
91
- lastSeen: number | null;
91
+ lastSeen: string | null;
92
92
  /**
93
93
  * Base directory every workload volume mount on this node must live under. Reported by
94
94
  * the node at registration; deployment flows compose host paths under it.
@@ -505,8 +505,45 @@ declare class SystemMemberService implements ISystemMemberService {
505
505
  setMachineEnabled(machineId: string, enabled: boolean): Promise<void>;
506
506
  removeMachine(machineId: string): Promise<void>;
507
507
  }
508
- import { WatchEvent as WatchEvent3 } from "@kinotic-ai/management-api";
508
+ import { AccessExplanation, Grant, RoleDefinition, Subject } from "@kinotic-ai/management-api";
509
509
  import { IKinotic as IKinotic8 } from "@kinotic-ai/core";
510
+ /**
511
+ * Access control of the platform itself: the roles the platform's operators and machines can be
512
+ * granted, and the grants made on the platform, which reach every organization and node on it. A
513
+ * subject named must be one of the platform's own operators or machines.
514
+ */
515
+ interface ISystemAccessService {
516
+ /** The built-in roles the model defines, each with the permissions it bundles. */
517
+ findRoles(): Promise<RoleDefinition[]>;
518
+ /** The grants made on the platform. */
519
+ findGrants(): Promise<Grant[]>;
520
+ /**
521
+ * Grants a role to a platform operator or machine on the platform: the subject holds every
522
+ * permission the role bundles on the platform and on everything on it.
523
+ * @param subject a user naming an operator's or a machine's identity id
524
+ * @param roleId a built-in role's id
525
+ */
526
+ grant(subject: Subject, roleId: string): Promise<Grant>;
527
+ /** Revokes a grant made on the platform. */
528
+ revoke(grantId: string): Promise<void>;
529
+ /**
530
+ * Whether a platform operator or machine holds a permission of the platform, and the grants it
531
+ * holds the permission through.
532
+ * @param permission the permission's short name, such as can_manage_workloads
533
+ */
534
+ explain(subject: Subject, permission: string): Promise<AccessExplanation>;
535
+ }
536
+ declare class SystemAccessService implements ISystemAccessService {
537
+ private readonly serviceProxy;
538
+ constructor(kinotic: IKinotic8);
539
+ findRoles(): Promise<RoleDefinition[]>;
540
+ findGrants(): Promise<Grant[]>;
541
+ grant(subject: Subject, roleId: string): Promise<Grant>;
542
+ revoke(grantId: string): Promise<void>;
543
+ explain(subject: Subject, permission: string): Promise<AccessExplanation>;
544
+ }
545
+ import { WatchEvent as WatchEvent3 } from "@kinotic-ai/management-api";
546
+ import { IKinotic as IKinotic9 } from "@kinotic-ai/core";
510
547
  import { IterablePage as IterablePage3, Pageable as Pageable5 } from "@kinotic-ai/core";
511
548
  /**
512
549
  * The ledger of every watched record on the platform.
@@ -523,7 +560,7 @@ interface IWatchEventService {
523
560
  }
524
561
  declare class WatchEventService implements IWatchEventService {
525
562
  private readonly serviceProxy;
526
- constructor(kinotic: IKinotic8);
563
+ constructor(kinotic: IKinotic9);
527
564
  findAll(pageable: Pageable5): Promise<IterablePage3<WatchEvent3>>;
528
565
  private findAllSinglePage;
529
566
  }
@@ -535,13 +572,14 @@ interface ISystemApiExtension {
535
572
  clusterInfo: IKinoticClusterInfoService;
536
573
  systemOrganizations: ISystemOrganizationService;
537
574
  systemMembers: ISystemMemberService;
575
+ systemAccess: ISystemAccessService;
538
576
  watchEvents: IWatchEventService;
539
577
  }
540
578
  declare const SystemApiPlugin: KinoticPlugin<ISystemApiExtension>;
541
- import { IKinotic as IKinotic9 } from "@kinotic-ai/core";
579
+ import { IKinotic as IKinotic10 } from "@kinotic-ai/core";
542
580
  declare class LogManager implements ILogManager {
543
581
  private readonly serviceProxy;
544
- constructor(kinotic: IKinotic9);
582
+ constructor(kinotic: IKinotic10);
545
583
  loggers(nodeId: string): Promise<LoggersDescriptor>;
546
584
  loggerLevels(nodeId: string, name: string): Promise<LoggerLevelsDescriptor>;
547
585
  configureLogLevel(nodeId: string, name: string, level: LogLevel): Promise<void>;
@@ -551,4 +589,4 @@ declare class LogManager implements ILogManager {
551
589
  declare module "@kinotic-ai/core" {
552
590
  interface KinoticSingleton extends ISystemApiExtension {}
553
591
  }
554
- export { WorkloadStatusReport, WorkloadServiceProxy, WorkloadOrchestrationService, WatchEventService, VmProviderType, VmNodeStatusType, VmNodeState, VmNodeServiceProxy, VmNodeRegistration, VmNodeOrchestrationServiceProxy, VmNode, TraceLogProperties, SystemOrganizationService, SystemMemberService, SystemApiPlugin, SingleLoggerLevelsDescriptor, SYSTEM_API_ZONE, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticNodeInfo, KinoticClusterInfoService, KinoticClusterInfo, IWorkloadService, IWorkloadOrchestrationService, IWatchEventService, IVmNodeService, ISystemOrganizationService, ISystemMemberService, ISystemApiExtension, ILogManager, IKinoticClusterInfoService, GroupLoggerLevelsDescriptor };
592
+ export { WorkloadStatusReport, WorkloadServiceProxy, WorkloadOrchestrationService, WatchEventService, VmProviderType, VmNodeStatusType, VmNodeState, VmNodeServiceProxy, VmNodeRegistration, VmNodeOrchestrationServiceProxy, VmNode, TraceLogProperties, SystemOrganizationService, SystemMemberService, SystemApiPlugin, SystemAccessService, SingleLoggerLevelsDescriptor, SYSTEM_API_ZONE, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticNodeInfo, KinoticClusterInfoService, KinoticClusterInfo, IWorkloadService, IWorkloadOrchestrationService, IWatchEventService, IVmNodeService, ISystemOrganizationService, ISystemMemberService, ISystemApiExtension, ISystemAccessService, ILogManager, IKinoticClusterInfoService, GroupLoggerLevelsDescriptor };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // packages/system-api/src/index.ts
2
- import { SYSTEM_API_ZONE as SYSTEM_API_ZONE9 } from "@kinotic-ai/management-api";
2
+ import { SYSTEM_API_ZONE as SYSTEM_API_ZONE10 } from "@kinotic-ai/management-api";
3
3
 
4
4
  // packages/system-api/src/api/model/workload/VmNode.ts
5
5
  import { ReconcileState } from "@kinotic-ai/management-api";
@@ -301,14 +301,41 @@ class SystemMemberService {
301
301
  }
302
302
  }
303
303
 
304
+ // packages/system-api/src/api/services/ISystemAccessService.ts
305
+ import {
306
+ SYSTEM_API_ZONE as SYSTEM_API_ZONE8
307
+ } from "@kinotic-ai/management-api";
308
+
309
+ class SystemAccessService {
310
+ serviceProxy;
311
+ constructor(kinotic) {
312
+ this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE8}~org.kinotic.system.api.services.SystemAccessService`);
313
+ }
314
+ findRoles() {
315
+ return this.serviceProxy.invoke("findRoles", []);
316
+ }
317
+ findGrants() {
318
+ return this.serviceProxy.invoke("findGrants", []);
319
+ }
320
+ grant(subject, roleId) {
321
+ return this.serviceProxy.invoke("grant", [subject, roleId]);
322
+ }
323
+ revoke(grantId) {
324
+ return this.serviceProxy.invoke("revoke", [grantId]);
325
+ }
326
+ explain(subject, permission) {
327
+ return this.serviceProxy.invoke("explain", [subject, permission]);
328
+ }
329
+ }
330
+
304
331
  // packages/system-api/src/api/services/IWatchEventService.ts
305
- import { SYSTEM_API_ZONE as SYSTEM_API_ZONE8 } from "@kinotic-ai/management-api";
332
+ import { SYSTEM_API_ZONE as SYSTEM_API_ZONE9 } from "@kinotic-ai/management-api";
306
333
  import { FunctionalIterablePage as FunctionalIterablePage3 } from "@kinotic-ai/core";
307
334
 
308
335
  class WatchEventService {
309
336
  serviceProxy;
310
337
  constructor(kinotic) {
311
- this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE8}~org.kinotic.system.api.services.WatchEventService`);
338
+ this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE9}~org.kinotic.system.api.services.WatchEventService`);
312
339
  }
313
340
  async findAll(pageable) {
314
341
  const page = await this.findAllSinglePage(pageable);
@@ -330,6 +357,7 @@ var SystemApiPlugin = {
330
357
  clusterInfo: new KinoticClusterInfoService(kinotic),
331
358
  systemOrganizations: new SystemOrganizationService(kinotic),
332
359
  systemMembers: new SystemMemberService(kinotic),
360
+ systemAccess: new SystemAccessService(kinotic),
333
361
  watchEvents: new WatchEventService(kinotic)
334
362
  };
335
363
  }
@@ -367,8 +395,9 @@ export {
367
395
  SystemOrganizationService,
368
396
  SystemMemberService,
369
397
  SystemApiPlugin,
398
+ SystemAccessService,
370
399
  SingleLoggerLevelsDescriptor,
371
- SYSTEM_API_ZONE9 as SYSTEM_API_ZONE,
400
+ SYSTEM_API_ZONE10 as SYSTEM_API_ZONE,
372
401
  LoggersDescriptor,
373
402
  LoggerLevelsDescriptor,
374
403
  LogManager,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kinotic-ai/system-api",
3
- "version": "5.0.0-beta.22",
3
+ "version": "5.0.0-beta.24",
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": [
@@ -39,11 +39,11 @@
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@kinotic-ai/core": "^5.0.0-beta.17",
42
- "@kinotic-ai/management-api": "^5.0.0-beta.44"
42
+ "@kinotic-ai/management-api": "^5.0.0-beta.46"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@kinotic-ai/core": "5.0.0-beta.17",
46
- "@kinotic-ai/management-api": "5.0.0-beta.44",
46
+ "@kinotic-ai/management-api": "5.0.0-beta.46",
47
47
  "@types/bun": "^1.3.9",
48
48
  "typescript": "^5.9.3"
49
49
  }