@kinotic-ai/os-api 2.0.0 → 3.1.0

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
@@ -43,6 +43,7 @@ __export(exports_src, {
43
43
  isSystemParticipant: () => isSystemParticipant,
44
44
  isOrganizationParticipant: () => isOrganizationParticipant,
45
45
  isApplicationParticipant: () => isApplicationParticipant,
46
+ appZone: () => appZone,
46
47
  WorkloadStatus: () => WorkloadStatus,
47
48
  WorkloadServiceProxy: () => WorkloadServiceProxy,
48
49
  Workload: () => Workload,
@@ -56,6 +57,7 @@ __export(exports_src, {
56
57
  TenantSelectionC3Type: () => TenantSelectionC3Type,
57
58
  TenantIdDecorator: () => TenantIdDecorator,
58
59
  SingleLoggerLevelsDescriptor: () => SingleLoggerLevelsDescriptor,
60
+ SYSTEM_ZONE: () => SYSTEM_ZONE,
59
61
  RepositoryConnectionStatus: () => RepositoryConnectionStatus,
60
62
  QueryOptionsC3Type: () => QueryOptionsC3Type,
61
63
  QueryDecorator: () => QueryDecorator,
@@ -71,6 +73,7 @@ __export(exports_src, {
71
73
  OsApiPlugin: () => OsApiPlugin,
72
74
  OrganizationService: () => OrganizationService,
73
75
  Organization: () => Organization,
76
+ OS_API_ZONE: () => OS_API_ZONE,
74
77
  NotIndexedDecorator: () => NotIndexedDecorator,
75
78
  NestedDecorator: () => NestedDecorator,
76
79
  NamedQueriesDefinitionService: () => NamedQueriesDefinitionService,
@@ -105,7 +108,9 @@ __export(exports_src, {
105
108
  AutoGeneratedIdDecorator: () => AutoGeneratedIdDecorator,
106
109
  AuthType: () => AuthType,
107
110
  ApplicationService: () => ApplicationService,
108
- Application: () => Application
111
+ Application: () => Application,
112
+ APP_ZONE_PREFIX: () => APP_ZONE_PREFIX,
113
+ APP_API_ZONE: () => import_persistence2.APP_API_ZONE
109
114
  });
110
115
  module.exports = __toCommonJS(exports_src);
111
116
 
@@ -288,11 +293,12 @@ class TenantSelectionC3Type extends import_idl17.ArrayC3Type {
288
293
  class Application {
289
294
  id;
290
295
  organizationId;
296
+ name;
291
297
  description;
292
298
  tenantPerUser = false;
293
299
  updated = null;
294
- constructor(id, description) {
295
- this.id = id;
300
+ constructor(name, description) {
301
+ this.name = name;
296
302
  this.description = description;
297
303
  }
298
304
  }
@@ -582,12 +588,24 @@ class KinoticOsCredentialsAuthProvider {
582
588
  return this.authHeaders;
583
589
  }
584
590
  }
585
- // packages/os-api/src/api/services/IApplicationService.ts
591
+ // packages/os-api/src/api/PlatformZones.ts
586
592
  var import_core = require("@kinotic-ai/core");
593
+ var import_persistence2 = require("@kinotic-ai/persistence");
594
+ var OS_API_ZONE = "os-api";
595
+ var SYSTEM_ZONE = "system";
596
+ var APP_ZONE_PREFIX = "app";
597
+ function appZone(organizationId, applicationId) {
598
+ import_core.validateLabel(organizationId);
599
+ import_core.validateLabel(applicationId);
600
+ return `${APP_ZONE_PREFIX}.${organizationId}.${applicationId}`;
601
+ }
602
+
603
+ // packages/os-api/src/api/services/IApplicationService.ts
604
+ var import_core2 = require("@kinotic-ai/core");
587
605
 
588
- class ApplicationService extends import_core.CrudServiceProxy {
606
+ class ApplicationService extends import_core2.CrudServiceProxy {
589
607
  constructor(kinotic) {
590
- super(kinotic.serviceProxy("org.kinotic.os.api.services.ApplicationService"));
608
+ super(kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.os.api.services.ApplicationService`));
591
609
  }
592
610
  createApplicationIfNotExist(id, description) {
593
611
  return this.serviceProxy.invoke("createApplicationIfNotExist", [id, description]);
@@ -597,11 +615,11 @@ class ApplicationService extends import_core.CrudServiceProxy {
597
615
  }
598
616
  }
599
617
  // packages/os-api/src/api/services/IOrganizationService.ts
600
- var import_core2 = require("@kinotic-ai/core");
618
+ var import_core3 = require("@kinotic-ai/core");
601
619
 
602
- class OrganizationService extends import_core2.CrudServiceProxy {
620
+ class OrganizationService extends import_core3.CrudServiceProxy {
603
621
  constructor(kinotic) {
604
- super(kinotic.serviceProxy("org.kinotic.os.api.services.OrganizationService"));
622
+ super(kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.os.api.services.OrganizationService`));
605
623
  }
606
624
  getOidcConfigurations(organizationId) {
607
625
  return this.serviceProxy.invoke("getOidcConfigurations", [organizationId]);
@@ -637,11 +655,11 @@ class LoggersDescriptor {
637
655
  groups = new Map;
638
656
  }
639
657
  // packages/os-api/src/api/services/IProjectService.ts
640
- var import_core3 = require("@kinotic-ai/core");
658
+ var import_core4 = require("@kinotic-ai/core");
641
659
 
642
- class ProjectService extends import_core3.CrudServiceProxy {
660
+ class ProjectService extends import_core4.CrudServiceProxy {
643
661
  constructor(kinotic) {
644
- super(kinotic.serviceProxy("org.kinotic.os.api.services.ProjectService"));
662
+ super(kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.os.api.services.ProjectService`));
645
663
  }
646
664
  countForApplication(applicationId) {
647
665
  return this.serviceProxy.invoke("countForApplication", [applicationId]);
@@ -651,7 +669,7 @@ class ProjectService extends import_core3.CrudServiceProxy {
651
669
  }
652
670
  async findAllForApplication(applicationId, pageable) {
653
671
  const page = await this.findAllForApplicationSinglePage(applicationId, pageable);
654
- return new import_core3.FunctionalIterablePage(pageable, page, (pageable2) => this.findAllForApplicationSinglePage(applicationId, pageable2));
672
+ return new import_core4.FunctionalIterablePage(pageable, page, (pageable2) => this.findAllForApplicationSinglePage(applicationId, pageable2));
655
673
  }
656
674
  findAllForApplicationSinglePage(applicationId, pageable) {
657
675
  return this.serviceProxy.invoke("findAllForApplication", [applicationId, pageable]);
@@ -667,7 +685,7 @@ class ProjectService extends import_core3.CrudServiceProxy {
667
685
  class LogManager {
668
686
  serviceProxy;
669
687
  constructor(kinotic) {
670
- this.serviceProxy = kinotic.serviceProxy("org.kinotic.os.api.services.LogManager");
688
+ this.serviceProxy = kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.os.api.services.LogManager`);
671
689
  }
672
690
  loggers(nodeId) {
673
691
  return this.serviceProxy.invoke("loggers", null, nodeId);
@@ -693,7 +711,7 @@ class LogManager {
693
711
  class LogService {
694
712
  serviceProxy;
695
713
  constructor(kinotic) {
696
- this.serviceProxy = kinotic.serviceProxy("org.kinotic.os.api.services.LogService");
714
+ this.serviceProxy = kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.os.api.services.LogService`);
697
715
  }
698
716
  tail(workloadId) {
699
717
  return this.serviceProxy.invokeStream("tail", [workloadId]);
@@ -703,11 +721,11 @@ class LogService {
703
721
  }
704
722
  }
705
723
  // packages/os-api/src/api/services/IEntityDefinitionService.ts
706
- var import_core4 = require("@kinotic-ai/core");
724
+ var import_core5 = require("@kinotic-ai/core");
707
725
 
708
- class EntityDefinitionService extends import_core4.CrudServiceProxy {
726
+ class EntityDefinitionService extends import_core5.CrudServiceProxy {
709
727
  constructor(kinotic) {
710
- super(kinotic.serviceProxy("org.kinotic.persistence.api.services.EntityDefinitionService"));
728
+ super(kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.persistence.api.services.EntityDefinitionService`));
711
729
  }
712
730
  countForApplication(applicationId) {
713
731
  return this.serviceProxy.invoke("countForApplication", [applicationId]);
@@ -720,14 +738,14 @@ class EntityDefinitionService extends import_core4.CrudServiceProxy {
720
738
  }
721
739
  async findAllForApplication(applicationId, pageable) {
722
740
  const page = await this.findAllForApplicationSinglePage(applicationId, pageable);
723
- return new import_core4.FunctionalIterablePage(pageable, page, (pageable2) => this.findAllForApplicationSinglePage(applicationId, pageable2));
741
+ return new import_core5.FunctionalIterablePage(pageable, page, (pageable2) => this.findAllForApplicationSinglePage(applicationId, pageable2));
724
742
  }
725
743
  findAllPublishedForApplication(applicationId, pageable) {
726
744
  return this.serviceProxy.invoke("findAllPublishedForApplication", [applicationId, pageable]);
727
745
  }
728
746
  async findAllForProject(projectId, pageable) {
729
747
  const page = await this.findAllForProjectSinglePage(projectId, pageable);
730
- return new import_core4.FunctionalIterablePage(pageable, page, (pageable2) => this.findAllForProjectSinglePage(projectId, pageable2));
748
+ return new import_core5.FunctionalIterablePage(pageable, page, (pageable2) => this.findAllForProjectSinglePage(projectId, pageable2));
731
749
  }
732
750
  findAllForProjectSinglePage(projectId, pageable) {
733
751
  return this.serviceProxy.invoke("findAllForProject", [projectId, pageable]);
@@ -743,11 +761,11 @@ class EntityDefinitionService extends import_core4.CrudServiceProxy {
743
761
  }
744
762
  }
745
763
  // packages/os-api/src/api/services/INamedQueriesDefinitionService.ts
746
- var import_core5 = require("@kinotic-ai/core");
764
+ var import_core6 = require("@kinotic-ai/core");
747
765
 
748
- class NamedQueriesDefinitionService extends import_core5.CrudServiceProxy {
766
+ class NamedQueriesDefinitionService extends import_core6.CrudServiceProxy {
749
767
  constructor(kinotic) {
750
- super(kinotic.serviceProxy("org.kinotic.persistence.api.services.NamedQueriesDefinitionService"));
768
+ super(kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.persistence.api.services.NamedQueriesDefinitionService`));
751
769
  }
752
770
  syncIndex() {
753
771
  return this.serviceProxy.invoke("syncIndex", []);
@@ -757,7 +775,7 @@ class NamedQueriesDefinitionService extends import_core5.CrudServiceProxy {
757
775
  class MigrationService {
758
776
  serviceProxy;
759
777
  constructor(kinotic) {
760
- this.serviceProxy = kinotic.serviceProxy("org.kinotic.persistence.api.services.MigrationService");
778
+ this.serviceProxy = kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.persistence.api.services.MigrationService`);
761
779
  }
762
780
  executeMigrations(migrationRequest) {
763
781
  return this.serviceProxy.invoke("executeMigrations", [migrationRequest]);
@@ -773,18 +791,18 @@ class MigrationService {
773
791
  class DataInsightsService {
774
792
  serviceProxy;
775
793
  constructor(kinotic) {
776
- this.serviceProxy = kinotic.serviceProxy("org.kinotic.persistence.api.services.insights.DataInsightsService");
794
+ this.serviceProxy = kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.persistence.api.services.insights.DataInsightsService`);
777
795
  }
778
796
  processRequest(request) {
779
797
  return this.serviceProxy.invokeStream("processRequest", [request]);
780
798
  }
781
799
  }
782
800
  // packages/os-api/src/api/services/IVmNodeService.ts
783
- var import_core6 = require("@kinotic-ai/core");
801
+ var import_core7 = require("@kinotic-ai/core");
784
802
 
785
- class VmNodeServiceProxy extends import_core6.CrudServiceProxy {
803
+ class VmNodeServiceProxy extends import_core7.CrudServiceProxy {
786
804
  constructor(kinotic) {
787
- super(kinotic.serviceProxy("org.kinotic.os.api.services.VmNodeService"));
805
+ super(kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.os.api.services.VmNodeService`));
788
806
  }
789
807
  findAvailableNode(requiredCpus, requiredMemoryMb, requiredDiskMb) {
790
808
  return this.serviceProxy.invoke("findAvailableNode", [requiredCpus, requiredMemoryMb, requiredDiskMb]);
@@ -794,15 +812,15 @@ class VmNodeServiceProxy extends import_core6.CrudServiceProxy {
794
812
  }
795
813
  }
796
814
  // packages/os-api/src/api/services/IWorkloadService.ts
797
- var import_core7 = require("@kinotic-ai/core");
815
+ var import_core8 = require("@kinotic-ai/core");
798
816
 
799
- class WorkloadServiceProxy extends import_core7.CrudServiceProxy {
817
+ class WorkloadServiceProxy extends import_core8.CrudServiceProxy {
800
818
  constructor(kinotic) {
801
- super(kinotic.serviceProxy("org.kinotic.os.api.services.WorkloadService"));
819
+ super(kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.os.api.services.WorkloadService`));
802
820
  }
803
821
  async findAllForNode(nodeId, pageable) {
804
822
  const page = await this.findAllForNodeSinglePage(nodeId, pageable);
805
- return new import_core7.FunctionalIterablePage(pageable, page, (pageable2) => this.findAllForNodeSinglePage(nodeId, pageable2));
823
+ return new import_core8.FunctionalIterablePage(pageable, page, (pageable2) => this.findAllForNodeSinglePage(nodeId, pageable2));
806
824
  }
807
825
  findAllForNodeSinglePage(nodeId, pageable) {
808
826
  return this.serviceProxy.invoke("findAllForNode", [nodeId, pageable]);
@@ -815,20 +833,20 @@ class WorkloadServiceProxy extends import_core7.CrudServiceProxy {
815
833
  }
816
834
  }
817
835
  // packages/os-api/src/api/services/IMemberService.ts
818
- var import_core8 = require("@kinotic-ai/core");
836
+ var import_core9 = require("@kinotic-ai/core");
819
837
 
820
838
  class MemberService {
821
839
  serviceProxy;
822
840
  constructor(kinotic) {
823
- this.serviceProxy = kinotic.serviceProxy("org.kinotic.os.api.services.iam.MemberService");
841
+ this.serviceProxy = kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.os.api.services.iam.MemberService`);
824
842
  }
825
843
  async findMembers(applicationId, pageable) {
826
844
  const page = await this.serviceProxy.invoke("findMembers", [applicationId, pageable]);
827
- return new import_core8.FunctionalIterablePage(pageable, page, (next) => this.serviceProxy.invoke("findMembers", [applicationId, next]));
845
+ return new import_core9.FunctionalIterablePage(pageable, page, (next) => this.serviceProxy.invoke("findMembers", [applicationId, next]));
828
846
  }
829
847
  async searchMembers(searchText, applicationId, pageable) {
830
848
  const page = await this.serviceProxy.invoke("searchMembers", [searchText, applicationId, pageable]);
831
- return new import_core8.FunctionalIterablePage(pageable, page, (next) => this.serviceProxy.invoke("searchMembers", [searchText, applicationId, next]));
849
+ return new import_core9.FunctionalIterablePage(pageable, page, (next) => this.serviceProxy.invoke("searchMembers", [searchText, applicationId, next]));
832
850
  }
833
851
  inviteMember(email, displayName, applicationId) {
834
852
  return this.serviceProxy.invoke("inviteMember", [email, displayName, applicationId]);
@@ -841,7 +859,7 @@ class MemberService {
841
859
  }
842
860
  async findPendingInvites(applicationId, pageable) {
843
861
  const page = await this.serviceProxy.invoke("findPendingInvites", [applicationId, pageable]);
844
- return new import_core8.FunctionalIterablePage(pageable, page, (next) => this.serviceProxy.invoke("findPendingInvites", [applicationId, next]));
862
+ return new import_core9.FunctionalIterablePage(pageable, page, (next) => this.serviceProxy.invoke("findPendingInvites", [applicationId, next]));
845
863
  }
846
864
  cancelInvite(inviteId) {
847
865
  return this.serviceProxy.invoke("cancelInvite", [inviteId]);
@@ -854,11 +872,11 @@ class MemberService {
854
872
  }
855
873
  }
856
874
  // packages/os-api/src/api/services/IInviteEmailTemplateService.ts
857
- var import_core9 = require("@kinotic-ai/core");
875
+ var import_core10 = require("@kinotic-ai/core");
858
876
 
859
- class InviteEmailTemplateService extends import_core9.CrudServiceProxy {
877
+ class InviteEmailTemplateService extends import_core10.CrudServiceProxy {
860
878
  constructor(kinotic) {
861
- super(kinotic.serviceProxy("org.kinotic.os.api.services.InviteEmailTemplateService"));
879
+ super(kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.os.api.services.InviteEmailTemplateService`));
862
880
  }
863
881
  findByApplication(applicationId) {
864
882
  return this.serviceProxy.invoke("findByApplication", [applicationId]);
@@ -868,18 +886,18 @@ class InviteEmailTemplateService extends import_core9.CrudServiceProxy {
868
886
  class DeviceApprovalService {
869
887
  serviceProxy;
870
888
  constructor(kinotic) {
871
- this.serviceProxy = kinotic.serviceProxy("org.kinotic.os.api.services.iam.DeviceApprovalService");
889
+ this.serviceProxy = kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.os.api.services.iam.DeviceApprovalService`);
872
890
  }
873
891
  approve(userCode) {
874
892
  return this.serviceProxy.invoke("approve", [userCode]);
875
893
  }
876
894
  }
877
895
  // packages/os-api/src/api/services/IGitHubAppInstallationService.ts
878
- var import_core10 = require("@kinotic-ai/core");
896
+ var import_core11 = require("@kinotic-ai/core");
879
897
 
880
- class GitHubAppInstallationService extends import_core10.CrudServiceProxy {
898
+ class GitHubAppInstallationService extends import_core11.CrudServiceProxy {
881
899
  constructor(kinotic) {
882
- super(kinotic.serviceProxy("org.kinotic.github.api.services.GitHubAppInstallationService"));
900
+ super(kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.github.api.services.GitHubAppInstallationService`));
883
901
  }
884
902
  startInstall(returnTo) {
885
903
  return this.serviceProxy.invoke("startInstall", [returnTo]);
package/dist/index.d.cts CHANGED
@@ -137,6 +137,9 @@ declare class TenantSelectionC3Type extends ArrayC3Type {
137
137
  }
138
138
  import { Identifiable } from "@kinotic-ai/core";
139
139
  declare class Application implements Identifiable<string> {
140
+ /**
141
+ * The slugified {@link name}, minted by the server at creation
142
+ */
140
143
  id: string;
141
144
  /**
142
145
  * The id of the organization that owns this application.
@@ -144,6 +147,7 @@ declare class Application implements Identifiable<string> {
144
147
  * with a missing or mismatched organizationId.
145
148
  */
146
149
  organizationId: string;
150
+ name: string;
147
151
  description: string;
148
152
  /**
149
153
  * When true, every APPLICATION-scope user created for this application receives an
@@ -152,7 +156,7 @@ declare class Application implements Identifiable<string> {
152
156
  */
153
157
  tenantPerUser: boolean;
154
158
  updated: number | null;
155
- constructor(id: string, description: string);
159
+ constructor(name: string, description: string);
156
160
  }
157
161
  import { Identifiable as Identifiable2 } from "@kinotic-ai/core";
158
162
  /**
@@ -934,13 +938,15 @@ import { IKinotic } from "@kinotic-ai/core";
934
938
  import { CrudServiceProxy, ICrudServiceProxy } from "@kinotic-ai/core";
935
939
  interface IApplicationService extends ICrudServiceProxy<Application> {
936
940
  /**
937
- * Creates a new application if it does not already exist. The organization id is derived
938
- * from the authenticated participant on the server.
939
- * @param id the id of the application to create
941
+ * Creates a new application if it does not already exist, deriving its id from the
942
+ * slugified name. The organization id is derived from the authenticated participant on
943
+ * the server.
944
+ * @param name the name of the application to create
940
945
  * @param description the description of the application to create
941
- * @return {@link Promise} emitting the created application
946
+ * @return {@link Promise} emitting the created application, or the existing application
947
+ * whose id matches the slugified name
942
948
  */
943
- createApplicationIfNotExist(id: string, description: string): Promise<Application>;
949
+ createApplicationIfNotExist(name: string, description: string): Promise<Application>;
944
950
  /**
945
951
  * This operation makes all the recent writes immediately available for search.
946
952
  * @return a Promise that resolves when the operation is complete
@@ -1420,7 +1426,28 @@ interface IOsApiExtension {
1420
1426
  githubAppInstallations: IGitHubAppInstallationService;
1421
1427
  }
1422
1428
  declare const OsApiPlugin: KinoticPlugin<IOsApiExtension>;
1429
+ import { APP_API_ZONE } from "@kinotic-ai/persistence";
1430
+ /**
1431
+ * The zone for platform services organizations use to manage the system, such as member,
1432
+ * application, and entity definition management
1433
+ */
1434
+ declare const OS_API_ZONE = "os-api";
1435
+ /**
1436
+ * The zone for services internal to the platform, only reachable by system participants
1437
+ */
1438
+ declare const SYSTEM_ZONE = "system";
1439
+ /**
1440
+ * The leading label of application zones, which follow the form app.<organizationId>.<applicationId>
1441
+ */
1442
+ declare const APP_ZONE_PREFIX = "app";
1443
+ /**
1444
+ * Builds the zone that all of an application's services live in
1445
+ * @param organizationId the id of the organization that owns the application
1446
+ * @param applicationId the id of the application
1447
+ * @return the application zone, app.<organizationId>.<applicationId>
1448
+ */
1449
+ declare function appZone(organizationId: string, applicationId: string): string;
1423
1450
  declare module "@kinotic-ai/core" {
1424
1451
  interface KinoticSingleton extends IOsApiExtension {}
1425
1452
  }
1426
- export { isSystemParticipant, isOrganizationParticipant, isApplicationParticipant, WorkloadStatus, WorkloadServiceProxy, Workload, VolumeMount, VmProviderType, VmNodeStatus, VmNodeServiceProxy, VmNode, VersionDecorator, TimeReferenceDecorator, TextDecorator, TenantSelectionC3Type, TenantIdDecorator, SingleLoggerLevelsDescriptor, SignUpRequest, SignUpCompleteRequest, RepositoryConnectionStatus, QueryOptionsC3Type, QueryDecorator, ProjectType, ProjectService, Project, ProgressType, PortProtocol, PortMapping, PendingInviteSummary, ParticipantType, PageableC3Type, PageC3Type, OsApiPlugin, OrganizationService, Organization, NotIndexedDecorator, NestedDecorator, NamedQueriesDefinitionService, NamedQueriesDefinition, MigrationService, MigrationResult, MigrationRequest, MigrationDefinition, MemberService, LoggersDescriptor, LoggerLevelsDescriptor, LogService, LogQuery, LogManager, LogLevel, KinoticProjectConfig, KinoticOsCredentialsAuthProvider, InviteEmailTemplateService, InviteEmailTemplate, InsightRequest, InsightProgress, IdDecorator, IamUser, IWorkloadService, IVmNodeService, ISystemParticipant, IProjectService, IOsApiExtension, IOrganizationService, IOrganizationParticipant, INamedQueriesDefinitionService, IMigrationService, IMemberService, ILogService, ILogManager, IInviteEmailTemplateService, IGitHubAppInstallationService, IEntityDefinitionService, IDeviceApprovalService, IDataInsightsService, IApplicationService, IApplicationParticipant, GroupLoggerLevelsDescriptor, GitHubToken, GitHubRepoToken, GitHubInstallCompletion, GitHubAppInstallationService, GitHubAppInstallation, FlattenedDecorator, EsIndexConfigurationDecorator, EntityDefinitionService, EntityDefinition, EntityDecorator, EntitiesPathConfig, DiscriminatorDecorator, DeviceApprovalService, DataInsightsService, DataInsightsComponent, CompleteOrgRequest, AutoGeneratedIdDecorator, AuthType, ApplicationService, Application };
1453
+ export { isSystemParticipant, isOrganizationParticipant, isApplicationParticipant, appZone, WorkloadStatus, WorkloadServiceProxy, Workload, VolumeMount, VmProviderType, VmNodeStatus, VmNodeServiceProxy, VmNode, VersionDecorator, TimeReferenceDecorator, TextDecorator, TenantSelectionC3Type, TenantIdDecorator, SingleLoggerLevelsDescriptor, SignUpRequest, SignUpCompleteRequest, SYSTEM_ZONE, RepositoryConnectionStatus, QueryOptionsC3Type, QueryDecorator, ProjectType, ProjectService, Project, ProgressType, PortProtocol, PortMapping, PendingInviteSummary, ParticipantType, PageableC3Type, PageC3Type, OsApiPlugin, OrganizationService, Organization, OS_API_ZONE, NotIndexedDecorator, NestedDecorator, NamedQueriesDefinitionService, NamedQueriesDefinition, MigrationService, MigrationResult, MigrationRequest, MigrationDefinition, MemberService, LoggersDescriptor, LoggerLevelsDescriptor, LogService, LogQuery, LogManager, LogLevel, KinoticProjectConfig, KinoticOsCredentialsAuthProvider, InviteEmailTemplateService, InviteEmailTemplate, InsightRequest, InsightProgress, IdDecorator, IamUser, IWorkloadService, IVmNodeService, ISystemParticipant, IProjectService, IOsApiExtension, IOrganizationService, IOrganizationParticipant, INamedQueriesDefinitionService, IMigrationService, IMemberService, ILogService, ILogManager, IInviteEmailTemplateService, IGitHubAppInstallationService, IEntityDefinitionService, IDeviceApprovalService, IDataInsightsService, IApplicationService, IApplicationParticipant, GroupLoggerLevelsDescriptor, GitHubToken, GitHubRepoToken, GitHubInstallCompletion, GitHubAppInstallationService, GitHubAppInstallation, FlattenedDecorator, EsIndexConfigurationDecorator, EntityDefinitionService, EntityDefinition, EntityDecorator, EntitiesPathConfig, DiscriminatorDecorator, DeviceApprovalService, DataInsightsService, DataInsightsComponent, CompleteOrgRequest, AutoGeneratedIdDecorator, AuthType, ApplicationService, Application, APP_ZONE_PREFIX, APP_API_ZONE };
package/dist/index.d.ts CHANGED
@@ -137,6 +137,9 @@ declare class TenantSelectionC3Type extends ArrayC3Type {
137
137
  }
138
138
  import { Identifiable } from "@kinotic-ai/core";
139
139
  declare class Application implements Identifiable<string> {
140
+ /**
141
+ * The slugified {@link name}, minted by the server at creation
142
+ */
140
143
  id: string;
141
144
  /**
142
145
  * The id of the organization that owns this application.
@@ -144,6 +147,7 @@ declare class Application implements Identifiable<string> {
144
147
  * with a missing or mismatched organizationId.
145
148
  */
146
149
  organizationId: string;
150
+ name: string;
147
151
  description: string;
148
152
  /**
149
153
  * When true, every APPLICATION-scope user created for this application receives an
@@ -152,7 +156,7 @@ declare class Application implements Identifiable<string> {
152
156
  */
153
157
  tenantPerUser: boolean;
154
158
  updated: number | null;
155
- constructor(id: string, description: string);
159
+ constructor(name: string, description: string);
156
160
  }
157
161
  import { Identifiable as Identifiable2 } from "@kinotic-ai/core";
158
162
  /**
@@ -934,13 +938,15 @@ import { IKinotic } from "@kinotic-ai/core";
934
938
  import { CrudServiceProxy, ICrudServiceProxy } from "@kinotic-ai/core";
935
939
  interface IApplicationService extends ICrudServiceProxy<Application> {
936
940
  /**
937
- * Creates a new application if it does not already exist. The organization id is derived
938
- * from the authenticated participant on the server.
939
- * @param id the id of the application to create
941
+ * Creates a new application if it does not already exist, deriving its id from the
942
+ * slugified name. The organization id is derived from the authenticated participant on
943
+ * the server.
944
+ * @param name the name of the application to create
940
945
  * @param description the description of the application to create
941
- * @return {@link Promise} emitting the created application
946
+ * @return {@link Promise} emitting the created application, or the existing application
947
+ * whose id matches the slugified name
942
948
  */
943
- createApplicationIfNotExist(id: string, description: string): Promise<Application>;
949
+ createApplicationIfNotExist(name: string, description: string): Promise<Application>;
944
950
  /**
945
951
  * This operation makes all the recent writes immediately available for search.
946
952
  * @return a Promise that resolves when the operation is complete
@@ -1420,7 +1426,28 @@ interface IOsApiExtension {
1420
1426
  githubAppInstallations: IGitHubAppInstallationService;
1421
1427
  }
1422
1428
  declare const OsApiPlugin: KinoticPlugin<IOsApiExtension>;
1429
+ import { APP_API_ZONE } from "@kinotic-ai/persistence";
1430
+ /**
1431
+ * The zone for platform services organizations use to manage the system, such as member,
1432
+ * application, and entity definition management
1433
+ */
1434
+ declare const OS_API_ZONE = "os-api";
1435
+ /**
1436
+ * The zone for services internal to the platform, only reachable by system participants
1437
+ */
1438
+ declare const SYSTEM_ZONE = "system";
1439
+ /**
1440
+ * The leading label of application zones, which follow the form app.<organizationId>.<applicationId>
1441
+ */
1442
+ declare const APP_ZONE_PREFIX = "app";
1443
+ /**
1444
+ * Builds the zone that all of an application's services live in
1445
+ * @param organizationId the id of the organization that owns the application
1446
+ * @param applicationId the id of the application
1447
+ * @return the application zone, app.<organizationId>.<applicationId>
1448
+ */
1449
+ declare function appZone(organizationId: string, applicationId: string): string;
1423
1450
  declare module "@kinotic-ai/core" {
1424
1451
  interface KinoticSingleton extends IOsApiExtension {}
1425
1452
  }
1426
- export { isSystemParticipant, isOrganizationParticipant, isApplicationParticipant, WorkloadStatus, WorkloadServiceProxy, Workload, VolumeMount, VmProviderType, VmNodeStatus, VmNodeServiceProxy, VmNode, VersionDecorator, TimeReferenceDecorator, TextDecorator, TenantSelectionC3Type, TenantIdDecorator, SingleLoggerLevelsDescriptor, SignUpRequest, SignUpCompleteRequest, RepositoryConnectionStatus, QueryOptionsC3Type, QueryDecorator, ProjectType, ProjectService, Project, ProgressType, PortProtocol, PortMapping, PendingInviteSummary, ParticipantType, PageableC3Type, PageC3Type, OsApiPlugin, OrganizationService, Organization, NotIndexedDecorator, NestedDecorator, NamedQueriesDefinitionService, NamedQueriesDefinition, MigrationService, MigrationResult, MigrationRequest, MigrationDefinition, MemberService, LoggersDescriptor, LoggerLevelsDescriptor, LogService, LogQuery, LogManager, LogLevel, KinoticProjectConfig, KinoticOsCredentialsAuthProvider, InviteEmailTemplateService, InviteEmailTemplate, InsightRequest, InsightProgress, IdDecorator, IamUser, IWorkloadService, IVmNodeService, ISystemParticipant, IProjectService, IOsApiExtension, IOrganizationService, IOrganizationParticipant, INamedQueriesDefinitionService, IMigrationService, IMemberService, ILogService, ILogManager, IInviteEmailTemplateService, IGitHubAppInstallationService, IEntityDefinitionService, IDeviceApprovalService, IDataInsightsService, IApplicationService, IApplicationParticipant, GroupLoggerLevelsDescriptor, GitHubToken, GitHubRepoToken, GitHubInstallCompletion, GitHubAppInstallationService, GitHubAppInstallation, FlattenedDecorator, EsIndexConfigurationDecorator, EntityDefinitionService, EntityDefinition, EntityDecorator, EntitiesPathConfig, DiscriminatorDecorator, DeviceApprovalService, DataInsightsService, DataInsightsComponent, CompleteOrgRequest, AutoGeneratedIdDecorator, AuthType, ApplicationService, Application };
1453
+ export { isSystemParticipant, isOrganizationParticipant, isApplicationParticipant, appZone, WorkloadStatus, WorkloadServiceProxy, Workload, VolumeMount, VmProviderType, VmNodeStatus, VmNodeServiceProxy, VmNode, VersionDecorator, TimeReferenceDecorator, TextDecorator, TenantSelectionC3Type, TenantIdDecorator, SingleLoggerLevelsDescriptor, SignUpRequest, SignUpCompleteRequest, SYSTEM_ZONE, RepositoryConnectionStatus, QueryOptionsC3Type, QueryDecorator, ProjectType, ProjectService, Project, ProgressType, PortProtocol, PortMapping, PendingInviteSummary, ParticipantType, PageableC3Type, PageC3Type, OsApiPlugin, OrganizationService, Organization, OS_API_ZONE, NotIndexedDecorator, NestedDecorator, NamedQueriesDefinitionService, NamedQueriesDefinition, MigrationService, MigrationResult, MigrationRequest, MigrationDefinition, MemberService, LoggersDescriptor, LoggerLevelsDescriptor, LogService, LogQuery, LogManager, LogLevel, KinoticProjectConfig, KinoticOsCredentialsAuthProvider, InviteEmailTemplateService, InviteEmailTemplate, InsightRequest, InsightProgress, IdDecorator, IamUser, IWorkloadService, IVmNodeService, ISystemParticipant, IProjectService, IOsApiExtension, IOrganizationService, IOrganizationParticipant, INamedQueriesDefinitionService, IMigrationService, IMemberService, ILogService, ILogManager, IInviteEmailTemplateService, IGitHubAppInstallationService, IEntityDefinitionService, IDeviceApprovalService, IDataInsightsService, IApplicationService, IApplicationParticipant, GroupLoggerLevelsDescriptor, GitHubToken, GitHubRepoToken, GitHubInstallCompletion, GitHubAppInstallationService, GitHubAppInstallation, FlattenedDecorator, EsIndexConfigurationDecorator, EntityDefinitionService, EntityDefinition, EntityDecorator, EntitiesPathConfig, DiscriminatorDecorator, DeviceApprovalService, DataInsightsService, DataInsightsComponent, CompleteOrgRequest, AutoGeneratedIdDecorator, AuthType, ApplicationService, Application, APP_ZONE_PREFIX, APP_API_ZONE };
package/dist/index.js CHANGED
@@ -177,11 +177,12 @@ class TenantSelectionC3Type extends ArrayC3Type {
177
177
  class Application {
178
178
  id;
179
179
  organizationId;
180
+ name;
180
181
  description;
181
182
  tenantPerUser = false;
182
183
  updated = null;
183
- constructor(id, description) {
184
- this.id = id;
184
+ constructor(name, description) {
185
+ this.name = name;
185
186
  this.description = description;
186
187
  }
187
188
  }
@@ -471,12 +472,24 @@ class KinoticOsCredentialsAuthProvider {
471
472
  return this.authHeaders;
472
473
  }
473
474
  }
475
+ // packages/os-api/src/api/PlatformZones.ts
476
+ import { validateLabel } from "@kinotic-ai/core";
477
+ import { APP_API_ZONE } from "@kinotic-ai/persistence";
478
+ var OS_API_ZONE = "os-api";
479
+ var SYSTEM_ZONE = "system";
480
+ var APP_ZONE_PREFIX = "app";
481
+ function appZone(organizationId, applicationId) {
482
+ validateLabel(organizationId);
483
+ validateLabel(applicationId);
484
+ return `${APP_ZONE_PREFIX}.${organizationId}.${applicationId}`;
485
+ }
486
+
474
487
  // packages/os-api/src/api/services/IApplicationService.ts
475
488
  import { CrudServiceProxy } from "@kinotic-ai/core";
476
489
 
477
490
  class ApplicationService extends CrudServiceProxy {
478
491
  constructor(kinotic) {
479
- super(kinotic.serviceProxy("org.kinotic.os.api.services.ApplicationService"));
492
+ super(kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.os.api.services.ApplicationService`));
480
493
  }
481
494
  createApplicationIfNotExist(id, description) {
482
495
  return this.serviceProxy.invoke("createApplicationIfNotExist", [id, description]);
@@ -490,7 +503,7 @@ import { CrudServiceProxy as CrudServiceProxy2 } from "@kinotic-ai/core";
490
503
 
491
504
  class OrganizationService extends CrudServiceProxy2 {
492
505
  constructor(kinotic) {
493
- super(kinotic.serviceProxy("org.kinotic.os.api.services.OrganizationService"));
506
+ super(kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.os.api.services.OrganizationService`));
494
507
  }
495
508
  getOidcConfigurations(organizationId) {
496
509
  return this.serviceProxy.invoke("getOidcConfigurations", [organizationId]);
@@ -530,7 +543,7 @@ import { CrudServiceProxy as CrudServiceProxy3, FunctionalIterablePage } from "@
530
543
 
531
544
  class ProjectService extends CrudServiceProxy3 {
532
545
  constructor(kinotic) {
533
- super(kinotic.serviceProxy("org.kinotic.os.api.services.ProjectService"));
546
+ super(kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.os.api.services.ProjectService`));
534
547
  }
535
548
  countForApplication(applicationId) {
536
549
  return this.serviceProxy.invoke("countForApplication", [applicationId]);
@@ -556,7 +569,7 @@ class ProjectService extends CrudServiceProxy3 {
556
569
  class LogManager {
557
570
  serviceProxy;
558
571
  constructor(kinotic) {
559
- this.serviceProxy = kinotic.serviceProxy("org.kinotic.os.api.services.LogManager");
572
+ this.serviceProxy = kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.os.api.services.LogManager`);
560
573
  }
561
574
  loggers(nodeId) {
562
575
  return this.serviceProxy.invoke("loggers", null, nodeId);
@@ -582,7 +595,7 @@ class LogManager {
582
595
  class LogService {
583
596
  serviceProxy;
584
597
  constructor(kinotic) {
585
- this.serviceProxy = kinotic.serviceProxy("org.kinotic.os.api.services.LogService");
598
+ this.serviceProxy = kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.os.api.services.LogService`);
586
599
  }
587
600
  tail(workloadId) {
588
601
  return this.serviceProxy.invokeStream("tail", [workloadId]);
@@ -596,7 +609,7 @@ import { CrudServiceProxy as CrudServiceProxy4, FunctionalIterablePage as Functi
596
609
 
597
610
  class EntityDefinitionService extends CrudServiceProxy4 {
598
611
  constructor(kinotic) {
599
- super(kinotic.serviceProxy("org.kinotic.persistence.api.services.EntityDefinitionService"));
612
+ super(kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.persistence.api.services.EntityDefinitionService`));
600
613
  }
601
614
  countForApplication(applicationId) {
602
615
  return this.serviceProxy.invoke("countForApplication", [applicationId]);
@@ -636,7 +649,7 @@ import { CrudServiceProxy as CrudServiceProxy5 } from "@kinotic-ai/core";
636
649
 
637
650
  class NamedQueriesDefinitionService extends CrudServiceProxy5 {
638
651
  constructor(kinotic) {
639
- super(kinotic.serviceProxy("org.kinotic.persistence.api.services.NamedQueriesDefinitionService"));
652
+ super(kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.persistence.api.services.NamedQueriesDefinitionService`));
640
653
  }
641
654
  syncIndex() {
642
655
  return this.serviceProxy.invoke("syncIndex", []);
@@ -646,7 +659,7 @@ class NamedQueriesDefinitionService extends CrudServiceProxy5 {
646
659
  class MigrationService {
647
660
  serviceProxy;
648
661
  constructor(kinotic) {
649
- this.serviceProxy = kinotic.serviceProxy("org.kinotic.persistence.api.services.MigrationService");
662
+ this.serviceProxy = kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.persistence.api.services.MigrationService`);
650
663
  }
651
664
  executeMigrations(migrationRequest) {
652
665
  return this.serviceProxy.invoke("executeMigrations", [migrationRequest]);
@@ -662,7 +675,7 @@ class MigrationService {
662
675
  class DataInsightsService {
663
676
  serviceProxy;
664
677
  constructor(kinotic) {
665
- this.serviceProxy = kinotic.serviceProxy("org.kinotic.persistence.api.services.insights.DataInsightsService");
678
+ this.serviceProxy = kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.persistence.api.services.insights.DataInsightsService`);
666
679
  }
667
680
  processRequest(request) {
668
681
  return this.serviceProxy.invokeStream("processRequest", [request]);
@@ -673,7 +686,7 @@ import { CrudServiceProxy as CrudServiceProxy6 } from "@kinotic-ai/core";
673
686
 
674
687
  class VmNodeServiceProxy extends CrudServiceProxy6 {
675
688
  constructor(kinotic) {
676
- super(kinotic.serviceProxy("org.kinotic.os.api.services.VmNodeService"));
689
+ super(kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.os.api.services.VmNodeService`));
677
690
  }
678
691
  findAvailableNode(requiredCpus, requiredMemoryMb, requiredDiskMb) {
679
692
  return this.serviceProxy.invoke("findAvailableNode", [requiredCpus, requiredMemoryMb, requiredDiskMb]);
@@ -687,7 +700,7 @@ import { CrudServiceProxy as CrudServiceProxy7, FunctionalIterablePage as Functi
687
700
 
688
701
  class WorkloadServiceProxy extends CrudServiceProxy7 {
689
702
  constructor(kinotic) {
690
- super(kinotic.serviceProxy("org.kinotic.os.api.services.WorkloadService"));
703
+ super(kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.os.api.services.WorkloadService`));
691
704
  }
692
705
  async findAllForNode(nodeId, pageable) {
693
706
  const page = await this.findAllForNodeSinglePage(nodeId, pageable);
@@ -711,7 +724,7 @@ import {
711
724
  class MemberService {
712
725
  serviceProxy;
713
726
  constructor(kinotic) {
714
- this.serviceProxy = kinotic.serviceProxy("org.kinotic.os.api.services.iam.MemberService");
727
+ this.serviceProxy = kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.os.api.services.iam.MemberService`);
715
728
  }
716
729
  async findMembers(applicationId, pageable) {
717
730
  const page = await this.serviceProxy.invoke("findMembers", [applicationId, pageable]);
@@ -749,7 +762,7 @@ import { CrudServiceProxy as CrudServiceProxy8 } from "@kinotic-ai/core";
749
762
 
750
763
  class InviteEmailTemplateService extends CrudServiceProxy8 {
751
764
  constructor(kinotic) {
752
- super(kinotic.serviceProxy("org.kinotic.os.api.services.InviteEmailTemplateService"));
765
+ super(kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.os.api.services.InviteEmailTemplateService`));
753
766
  }
754
767
  findByApplication(applicationId) {
755
768
  return this.serviceProxy.invoke("findByApplication", [applicationId]);
@@ -759,7 +772,7 @@ class InviteEmailTemplateService extends CrudServiceProxy8 {
759
772
  class DeviceApprovalService {
760
773
  serviceProxy;
761
774
  constructor(kinotic) {
762
- this.serviceProxy = kinotic.serviceProxy("org.kinotic.os.api.services.iam.DeviceApprovalService");
775
+ this.serviceProxy = kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.os.api.services.iam.DeviceApprovalService`);
763
776
  }
764
777
  approve(userCode) {
765
778
  return this.serviceProxy.invoke("approve", [userCode]);
@@ -770,7 +783,7 @@ import { CrudServiceProxy as CrudServiceProxy9 } from "@kinotic-ai/core";
770
783
 
771
784
  class GitHubAppInstallationService extends CrudServiceProxy9 {
772
785
  constructor(kinotic) {
773
- super(kinotic.serviceProxy("org.kinotic.github.api.services.GitHubAppInstallationService"));
786
+ super(kinotic.serviceProxy(`${OS_API_ZONE}.org.kinotic.github.api.services.GitHubAppInstallationService`));
774
787
  }
775
788
  startInstall(returnTo) {
776
789
  return this.serviceProxy.invoke("startInstall", [returnTo]);
@@ -807,6 +820,7 @@ export {
807
820
  isSystemParticipant,
808
821
  isOrganizationParticipant,
809
822
  isApplicationParticipant,
823
+ appZone,
810
824
  WorkloadStatus,
811
825
  WorkloadServiceProxy,
812
826
  Workload,
@@ -820,6 +834,7 @@ export {
820
834
  TenantSelectionC3Type,
821
835
  TenantIdDecorator,
822
836
  SingleLoggerLevelsDescriptor,
837
+ SYSTEM_ZONE,
823
838
  RepositoryConnectionStatus,
824
839
  QueryOptionsC3Type,
825
840
  QueryDecorator,
@@ -835,6 +850,7 @@ export {
835
850
  OsApiPlugin,
836
851
  OrganizationService,
837
852
  Organization,
853
+ OS_API_ZONE,
838
854
  NotIndexedDecorator,
839
855
  NestedDecorator,
840
856
  NamedQueriesDefinitionService,
@@ -869,5 +885,7 @@ export {
869
885
  AutoGeneratedIdDecorator,
870
886
  AuthType,
871
887
  ApplicationService,
872
- Application
888
+ Application,
889
+ APP_ZONE_PREFIX,
890
+ APP_API_ZONE
873
891
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kinotic-ai/os-api",
3
- "version": "2.0.0",
3
+ "version": "3.1.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -32,15 +32,15 @@
32
32
  "coverage": "bun test --coverage --pass-with-no-tests"
33
33
  },
34
34
  "peerDependencies": {
35
- "@kinotic-ai/core": ">=2.0.0"
35
+ "@kinotic-ai/core": ">=3.1.0"
36
36
  },
37
37
  "dependencies": {
38
38
  "@kinotic-ai/idl": "1.0.10",
39
- "@kinotic-ai/persistence": "2.0.0",
39
+ "@kinotic-ai/persistence": "3.1.0",
40
40
  "rxjs": "^7.8.2"
41
41
  },
42
42
  "devDependencies": {
43
- "@kinotic-ai/core": "2.0.0",
43
+ "@kinotic-ai/core": "3.1.0",
44
44
  "@types/node": "^25.3.2",
45
45
  "tslib": "^2.8.1",
46
46
  "typescript": "^5.9.3"