@kinotic-ai/os-api 1.7.0 → 1.8.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 +25 -0
- package/dist/index.d.cts +68 -1
- package/dist/index.d.ts +68 -1
- package/dist/index.js +25 -0
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -40,6 +40,9 @@ var __export = (target, all) => {
|
|
|
40
40
|
// packages/os-api/src/index.ts
|
|
41
41
|
var exports_src = {};
|
|
42
42
|
__export(exports_src, {
|
|
43
|
+
isSystemParticipant: () => isSystemParticipant,
|
|
44
|
+
isOrganizationParticipant: () => isOrganizationParticipant,
|
|
45
|
+
isApplicationParticipant: () => isApplicationParticipant,
|
|
43
46
|
WorkloadStatus: () => WorkloadStatus,
|
|
44
47
|
WorkloadServiceProxy: () => WorkloadServiceProxy,
|
|
45
48
|
Workload: () => Workload,
|
|
@@ -59,6 +62,7 @@ __export(exports_src, {
|
|
|
59
62
|
ProjectService: () => ProjectService,
|
|
60
63
|
Project: () => Project,
|
|
61
64
|
ProgressType: () => ProgressType,
|
|
65
|
+
ParticipantType: () => ParticipantType,
|
|
62
66
|
PageableC3Type: () => PageableC3Type,
|
|
63
67
|
PageC3Type: () => PageC3Type,
|
|
64
68
|
OsApiPlugin: () => OsApiPlugin,
|
|
@@ -493,6 +497,27 @@ class KinoticProjectConfig {
|
|
|
493
497
|
fileExtensionForImports = ".js";
|
|
494
498
|
validate;
|
|
495
499
|
}
|
|
500
|
+
// packages/os-api/src/api/security/ParticipantType.ts
|
|
501
|
+
var ParticipantType;
|
|
502
|
+
((ParticipantType2) => {
|
|
503
|
+
ParticipantType2["SYSTEM"] = "system";
|
|
504
|
+
ParticipantType2["ORGANIZATION"] = "organization";
|
|
505
|
+
ParticipantType2["APPLICATION"] = "application";
|
|
506
|
+
})(ParticipantType ||= {});
|
|
507
|
+
// packages/os-api/src/api/security/ParticipantGuards.ts
|
|
508
|
+
function scopeType(participant) {
|
|
509
|
+
return participant.type;
|
|
510
|
+
}
|
|
511
|
+
function isSystemParticipant(participant) {
|
|
512
|
+
return scopeType(participant) === "system" /* SYSTEM */;
|
|
513
|
+
}
|
|
514
|
+
function isOrganizationParticipant(participant) {
|
|
515
|
+
const type = scopeType(participant);
|
|
516
|
+
return type === "organization" /* ORGANIZATION */ || type === "application" /* APPLICATION */;
|
|
517
|
+
}
|
|
518
|
+
function isApplicationParticipant(participant) {
|
|
519
|
+
return scopeType(participant) === "application" /* APPLICATION */;
|
|
520
|
+
}
|
|
496
521
|
// packages/os-api/src/api/services/IApplicationService.ts
|
|
497
522
|
var import_core = require("@kinotic-ai/core");
|
|
498
523
|
|
package/dist/index.d.cts
CHANGED
|
@@ -696,6 +696,73 @@ declare class KinoticProjectConfig {
|
|
|
696
696
|
*/
|
|
697
697
|
validate?: boolean;
|
|
698
698
|
}
|
|
699
|
+
/**
|
|
700
|
+
* Identifies which scope layer a participant authenticated against. The server serializes this as
|
|
701
|
+
* the {@code type} discriminator on a participant, and it is used to narrow a base
|
|
702
|
+
* {@code IParticipant} to one of the scope-typed participant interfaces.
|
|
703
|
+
*/
|
|
704
|
+
declare enum ParticipantType {
|
|
705
|
+
SYSTEM = "system",
|
|
706
|
+
ORGANIZATION = "organization",
|
|
707
|
+
APPLICATION = "application"
|
|
708
|
+
}
|
|
709
|
+
import { IParticipant } from "@kinotic-ai/core";
|
|
710
|
+
/**
|
|
711
|
+
* A participant authenticated against the platform SYSTEM scope — a platform operator with no
|
|
712
|
+
* organization or application context. Mirrors the server {@code SystemParticipant}.
|
|
713
|
+
*/
|
|
714
|
+
interface ISystemParticipant extends IParticipant {
|
|
715
|
+
type: ParticipantType.SYSTEM;
|
|
716
|
+
}
|
|
717
|
+
import { IParticipant as IParticipant2 } from "@kinotic-ai/core";
|
|
718
|
+
/**
|
|
719
|
+
* A participant authenticated against an Organization. {@link organizationId} is the id of the
|
|
720
|
+
* owning Organization and is never null. {@link IApplicationParticipant} extends this type, so an
|
|
721
|
+
* application-scoped participant also satisfies it. Mirrors the server
|
|
722
|
+
* {@code OrganizationParticipant}.
|
|
723
|
+
*/
|
|
724
|
+
interface IOrganizationParticipant extends IParticipant2 {
|
|
725
|
+
type: ParticipantType.ORGANIZATION | ParticipantType.APPLICATION;
|
|
726
|
+
/**
|
|
727
|
+
* The id of the Organization this participant is authenticated under; never null.
|
|
728
|
+
*/
|
|
729
|
+
organizationId: string;
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* A participant authenticated against an Application. Extends {@link IOrganizationParticipant}
|
|
733
|
+
* because every Application belongs to an Organization, so an application-scoped session
|
|
734
|
+
* intrinsically carries the owning Organization's id as well. Mirrors the server
|
|
735
|
+
* {@code ApplicationParticipant}.
|
|
736
|
+
*/
|
|
737
|
+
interface IApplicationParticipant extends IOrganizationParticipant {
|
|
738
|
+
type: ParticipantType.APPLICATION;
|
|
739
|
+
/**
|
|
740
|
+
* The id of the Application this participant is authenticated under; never null.
|
|
741
|
+
*/
|
|
742
|
+
applicationId: string;
|
|
743
|
+
/**
|
|
744
|
+
* The tenant slice of the Application's end-user data this participant belongs to, or null
|
|
745
|
+
* when the Application is not multi-tenant.
|
|
746
|
+
*/
|
|
747
|
+
tenantId?: string | null;
|
|
748
|
+
}
|
|
749
|
+
import { IParticipant as IParticipant3 } from "@kinotic-ai/core";
|
|
750
|
+
/**
|
|
751
|
+
* @return true if the participant authenticated against the platform SYSTEM scope
|
|
752
|
+
*/
|
|
753
|
+
declare function isSystemParticipant(participant: IParticipant3): participant is ISystemParticipant;
|
|
754
|
+
/**
|
|
755
|
+
* Narrows to an {@link IOrganizationParticipant}, which carries an {@code organizationId}. An
|
|
756
|
+
* application-scoped participant satisfies this too, since every Application is owned by an
|
|
757
|
+
* Organization.
|
|
758
|
+
*
|
|
759
|
+
* @return true if the participant authenticated against an Organization or an Application
|
|
760
|
+
*/
|
|
761
|
+
declare function isOrganizationParticipant(participant: IParticipant3): participant is IOrganizationParticipant;
|
|
762
|
+
/**
|
|
763
|
+
* @return true if the participant authenticated against an Application
|
|
764
|
+
*/
|
|
765
|
+
declare function isApplicationParticipant(participant: IParticipant3): participant is IApplicationParticipant;
|
|
699
766
|
import { IKinotic } from "@kinotic-ai/core";
|
|
700
767
|
import { CrudServiceProxy, ICrudServiceProxy } from "@kinotic-ai/core";
|
|
701
768
|
interface IApplicationService extends ICrudServiceProxy<Application> {
|
|
@@ -1126,4 +1193,4 @@ declare const OsApiPlugin: KinoticPlugin<IOsApiExtension>;
|
|
|
1126
1193
|
declare module "@kinotic-ai/core" {
|
|
1127
1194
|
interface KinoticSingleton extends IOsApiExtension {}
|
|
1128
1195
|
}
|
|
1129
|
-
export { WorkloadStatus, WorkloadServiceProxy, Workload, VmProviderType, VmNodeStatus, VmNodeServiceProxy, VmNode, VersionDecorator, TimeReferenceDecorator, TextDecorator, TenantSelectionC3Type, TenantIdDecorator, SingleLoggerLevelsDescriptor, SignUpRequest, SignUpCompleteRequest, QueryOptionsC3Type, QueryDecorator, ProjectType, ProjectService, Project, ProgressType, PageableC3Type, PageC3Type, OsApiPlugin, OrganizationService, Organization, NotIndexedDecorator, NestedDecorator, NamedQueriesDefinitionService, NamedQueriesDefinition, MigrationService, MigrationResult, MigrationRequest, MigrationDefinition, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticProjectConfig, InsightRequest, InsightProgress, IdDecorator, IamUserService, IamUser, IWorkloadService, IVmNodeService, IProjectService, IOsApiExtension, IOrganizationService, INamedQueriesDefinitionService, IMigrationService, ILogManager, IIamUserService, IGitHubAppInstallationService, IEntityDefinitionService, IDeviceApprovalService, IDataInsightsService, IApplicationService, GroupLoggerLevelsDescriptor, GitHubToken, GitHubRepoToken, GitHubInstallCompletion, GitHubAppInstallationService, GitHubAppInstallation, FlattenedDecorator, EsIndexConfigurationDecorator, EntityDefinitionService, EntityDefinition, EntityDecorator, EntitiesPathConfig, DiscriminatorDecorator, DeviceApprovalService, DataInsightsService, DataInsightsComponent, CompleteOrgRequest, AutoGeneratedIdDecorator, AuthType, ApplicationService, Application };
|
|
1196
|
+
export { isSystemParticipant, isOrganizationParticipant, isApplicationParticipant, WorkloadStatus, WorkloadServiceProxy, Workload, VmProviderType, VmNodeStatus, VmNodeServiceProxy, VmNode, VersionDecorator, TimeReferenceDecorator, TextDecorator, TenantSelectionC3Type, TenantIdDecorator, SingleLoggerLevelsDescriptor, SignUpRequest, SignUpCompleteRequest, QueryOptionsC3Type, QueryDecorator, ProjectType, ProjectService, Project, ProgressType, ParticipantType, PageableC3Type, PageC3Type, OsApiPlugin, OrganizationService, Organization, NotIndexedDecorator, NestedDecorator, NamedQueriesDefinitionService, NamedQueriesDefinition, MigrationService, MigrationResult, MigrationRequest, MigrationDefinition, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticProjectConfig, InsightRequest, InsightProgress, IdDecorator, IamUserService, IamUser, IWorkloadService, IVmNodeService, ISystemParticipant, IProjectService, IOsApiExtension, IOrganizationService, IOrganizationParticipant, INamedQueriesDefinitionService, IMigrationService, ILogManager, IIamUserService, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -696,6 +696,73 @@ declare class KinoticProjectConfig {
|
|
|
696
696
|
*/
|
|
697
697
|
validate?: boolean;
|
|
698
698
|
}
|
|
699
|
+
/**
|
|
700
|
+
* Identifies which scope layer a participant authenticated against. The server serializes this as
|
|
701
|
+
* the {@code type} discriminator on a participant, and it is used to narrow a base
|
|
702
|
+
* {@code IParticipant} to one of the scope-typed participant interfaces.
|
|
703
|
+
*/
|
|
704
|
+
declare enum ParticipantType {
|
|
705
|
+
SYSTEM = "system",
|
|
706
|
+
ORGANIZATION = "organization",
|
|
707
|
+
APPLICATION = "application"
|
|
708
|
+
}
|
|
709
|
+
import { IParticipant } from "@kinotic-ai/core";
|
|
710
|
+
/**
|
|
711
|
+
* A participant authenticated against the platform SYSTEM scope — a platform operator with no
|
|
712
|
+
* organization or application context. Mirrors the server {@code SystemParticipant}.
|
|
713
|
+
*/
|
|
714
|
+
interface ISystemParticipant extends IParticipant {
|
|
715
|
+
type: ParticipantType.SYSTEM;
|
|
716
|
+
}
|
|
717
|
+
import { IParticipant as IParticipant2 } from "@kinotic-ai/core";
|
|
718
|
+
/**
|
|
719
|
+
* A participant authenticated against an Organization. {@link organizationId} is the id of the
|
|
720
|
+
* owning Organization and is never null. {@link IApplicationParticipant} extends this type, so an
|
|
721
|
+
* application-scoped participant also satisfies it. Mirrors the server
|
|
722
|
+
* {@code OrganizationParticipant}.
|
|
723
|
+
*/
|
|
724
|
+
interface IOrganizationParticipant extends IParticipant2 {
|
|
725
|
+
type: ParticipantType.ORGANIZATION | ParticipantType.APPLICATION;
|
|
726
|
+
/**
|
|
727
|
+
* The id of the Organization this participant is authenticated under; never null.
|
|
728
|
+
*/
|
|
729
|
+
organizationId: string;
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* A participant authenticated against an Application. Extends {@link IOrganizationParticipant}
|
|
733
|
+
* because every Application belongs to an Organization, so an application-scoped session
|
|
734
|
+
* intrinsically carries the owning Organization's id as well. Mirrors the server
|
|
735
|
+
* {@code ApplicationParticipant}.
|
|
736
|
+
*/
|
|
737
|
+
interface IApplicationParticipant extends IOrganizationParticipant {
|
|
738
|
+
type: ParticipantType.APPLICATION;
|
|
739
|
+
/**
|
|
740
|
+
* The id of the Application this participant is authenticated under; never null.
|
|
741
|
+
*/
|
|
742
|
+
applicationId: string;
|
|
743
|
+
/**
|
|
744
|
+
* The tenant slice of the Application's end-user data this participant belongs to, or null
|
|
745
|
+
* when the Application is not multi-tenant.
|
|
746
|
+
*/
|
|
747
|
+
tenantId?: string | null;
|
|
748
|
+
}
|
|
749
|
+
import { IParticipant as IParticipant3 } from "@kinotic-ai/core";
|
|
750
|
+
/**
|
|
751
|
+
* @return true if the participant authenticated against the platform SYSTEM scope
|
|
752
|
+
*/
|
|
753
|
+
declare function isSystemParticipant(participant: IParticipant3): participant is ISystemParticipant;
|
|
754
|
+
/**
|
|
755
|
+
* Narrows to an {@link IOrganizationParticipant}, which carries an {@code organizationId}. An
|
|
756
|
+
* application-scoped participant satisfies this too, since every Application is owned by an
|
|
757
|
+
* Organization.
|
|
758
|
+
*
|
|
759
|
+
* @return true if the participant authenticated against an Organization or an Application
|
|
760
|
+
*/
|
|
761
|
+
declare function isOrganizationParticipant(participant: IParticipant3): participant is IOrganizationParticipant;
|
|
762
|
+
/**
|
|
763
|
+
* @return true if the participant authenticated against an Application
|
|
764
|
+
*/
|
|
765
|
+
declare function isApplicationParticipant(participant: IParticipant3): participant is IApplicationParticipant;
|
|
699
766
|
import { IKinotic } from "@kinotic-ai/core";
|
|
700
767
|
import { CrudServiceProxy, ICrudServiceProxy } from "@kinotic-ai/core";
|
|
701
768
|
interface IApplicationService extends ICrudServiceProxy<Application> {
|
|
@@ -1126,4 +1193,4 @@ declare const OsApiPlugin: KinoticPlugin<IOsApiExtension>;
|
|
|
1126
1193
|
declare module "@kinotic-ai/core" {
|
|
1127
1194
|
interface KinoticSingleton extends IOsApiExtension {}
|
|
1128
1195
|
}
|
|
1129
|
-
export { WorkloadStatus, WorkloadServiceProxy, Workload, VmProviderType, VmNodeStatus, VmNodeServiceProxy, VmNode, VersionDecorator, TimeReferenceDecorator, TextDecorator, TenantSelectionC3Type, TenantIdDecorator, SingleLoggerLevelsDescriptor, SignUpRequest, SignUpCompleteRequest, QueryOptionsC3Type, QueryDecorator, ProjectType, ProjectService, Project, ProgressType, PageableC3Type, PageC3Type, OsApiPlugin, OrganizationService, Organization, NotIndexedDecorator, NestedDecorator, NamedQueriesDefinitionService, NamedQueriesDefinition, MigrationService, MigrationResult, MigrationRequest, MigrationDefinition, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticProjectConfig, InsightRequest, InsightProgress, IdDecorator, IamUserService, IamUser, IWorkloadService, IVmNodeService, IProjectService, IOsApiExtension, IOrganizationService, INamedQueriesDefinitionService, IMigrationService, ILogManager, IIamUserService, IGitHubAppInstallationService, IEntityDefinitionService, IDeviceApprovalService, IDataInsightsService, IApplicationService, GroupLoggerLevelsDescriptor, GitHubToken, GitHubRepoToken, GitHubInstallCompletion, GitHubAppInstallationService, GitHubAppInstallation, FlattenedDecorator, EsIndexConfigurationDecorator, EntityDefinitionService, EntityDefinition, EntityDecorator, EntitiesPathConfig, DiscriminatorDecorator, DeviceApprovalService, DataInsightsService, DataInsightsComponent, CompleteOrgRequest, AutoGeneratedIdDecorator, AuthType, ApplicationService, Application };
|
|
1196
|
+
export { isSystemParticipant, isOrganizationParticipant, isApplicationParticipant, WorkloadStatus, WorkloadServiceProxy, Workload, VmProviderType, VmNodeStatus, VmNodeServiceProxy, VmNode, VersionDecorator, TimeReferenceDecorator, TextDecorator, TenantSelectionC3Type, TenantIdDecorator, SingleLoggerLevelsDescriptor, SignUpRequest, SignUpCompleteRequest, QueryOptionsC3Type, QueryDecorator, ProjectType, ProjectService, Project, ProgressType, ParticipantType, PageableC3Type, PageC3Type, OsApiPlugin, OrganizationService, Organization, NotIndexedDecorator, NestedDecorator, NamedQueriesDefinitionService, NamedQueriesDefinition, MigrationService, MigrationResult, MigrationRequest, MigrationDefinition, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticProjectConfig, InsightRequest, InsightProgress, IdDecorator, IamUserService, IamUser, IWorkloadService, IVmNodeService, ISystemParticipant, IProjectService, IOsApiExtension, IOrganizationService, IOrganizationParticipant, INamedQueriesDefinitionService, IMigrationService, ILogManager, IIamUserService, 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 };
|
package/dist/index.js
CHANGED
|
@@ -393,6 +393,27 @@ class KinoticProjectConfig {
|
|
|
393
393
|
fileExtensionForImports = ".js";
|
|
394
394
|
validate;
|
|
395
395
|
}
|
|
396
|
+
// packages/os-api/src/api/security/ParticipantType.ts
|
|
397
|
+
var ParticipantType;
|
|
398
|
+
((ParticipantType2) => {
|
|
399
|
+
ParticipantType2["SYSTEM"] = "system";
|
|
400
|
+
ParticipantType2["ORGANIZATION"] = "organization";
|
|
401
|
+
ParticipantType2["APPLICATION"] = "application";
|
|
402
|
+
})(ParticipantType ||= {});
|
|
403
|
+
// packages/os-api/src/api/security/ParticipantGuards.ts
|
|
404
|
+
function scopeType(participant) {
|
|
405
|
+
return participant.type;
|
|
406
|
+
}
|
|
407
|
+
function isSystemParticipant(participant) {
|
|
408
|
+
return scopeType(participant) === "system" /* SYSTEM */;
|
|
409
|
+
}
|
|
410
|
+
function isOrganizationParticipant(participant) {
|
|
411
|
+
const type = scopeType(participant);
|
|
412
|
+
return type === "organization" /* ORGANIZATION */ || type === "application" /* APPLICATION */;
|
|
413
|
+
}
|
|
414
|
+
function isApplicationParticipant(participant) {
|
|
415
|
+
return scopeType(participant) === "application" /* APPLICATION */;
|
|
416
|
+
}
|
|
396
417
|
// packages/os-api/src/api/services/IApplicationService.ts
|
|
397
418
|
import { CrudServiceProxy } from "@kinotic-ai/core";
|
|
398
419
|
|
|
@@ -680,6 +701,9 @@ var OsApiPlugin = {
|
|
|
680
701
|
}
|
|
681
702
|
};
|
|
682
703
|
export {
|
|
704
|
+
isSystemParticipant,
|
|
705
|
+
isOrganizationParticipant,
|
|
706
|
+
isApplicationParticipant,
|
|
683
707
|
WorkloadStatus,
|
|
684
708
|
WorkloadServiceProxy,
|
|
685
709
|
Workload,
|
|
@@ -699,6 +723,7 @@ export {
|
|
|
699
723
|
ProjectService,
|
|
700
724
|
Project,
|
|
701
725
|
ProgressType,
|
|
726
|
+
ParticipantType,
|
|
702
727
|
PageableC3Type,
|
|
703
728
|
PageC3Type,
|
|
704
729
|
OsApiPlugin,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kinotic-ai/os-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"ui-test": "vitest --ui --coverage.enabled=true --mode development"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@kinotic-ai/core": ">=1.
|
|
36
|
+
"@kinotic-ai/core": ">=1.6.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@kinotic-ai/idl": "1.0.9",
|
|
40
|
-
"@kinotic-ai/persistence": "1.3.
|
|
40
|
+
"@kinotic-ai/persistence": "1.3.1",
|
|
41
41
|
"rxjs": "^7.8.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@kinotic-ai/core": "1.
|
|
44
|
+
"@kinotic-ai/core": "1.6.0",
|
|
45
45
|
"@types/node": "^25.3.2",
|
|
46
46
|
"@vitest/coverage-v8": "^4.0.18",
|
|
47
47
|
"@vitest/runner": "^4.0.18",
|