@kinotic-ai/os-api 1.0.14 → 1.0.16
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 +63 -1
- package/dist/index.d.cts +135 -1
- package/dist/index.d.ts +135 -1
- package/dist/index.js +63 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -71,7 +71,10 @@ __export(exports_src, {
|
|
|
71
71
|
LoggerLevelsDescriptor: () => LoggerLevelsDescriptor,
|
|
72
72
|
LogManager: () => LogManager,
|
|
73
73
|
LogLevel: () => LogLevel,
|
|
74
|
+
KinoticProjectConfig: () => KinoticProjectConfig,
|
|
74
75
|
IdDecorator: () => IdDecorator,
|
|
76
|
+
IamUserService: () => IamUserService,
|
|
77
|
+
IamUser: () => IamUser,
|
|
75
78
|
GroupLoggerLevelsDescriptor: () => GroupLoggerLevelsDescriptor,
|
|
76
79
|
FlattenedDecorator: () => FlattenedDecorator,
|
|
77
80
|
EsIndexConfigurationDecorator: () => EsIndexConfigurationDecorator,
|
|
@@ -81,6 +84,7 @@ __export(exports_src, {
|
|
|
81
84
|
DiscriminatorDecorator: () => DiscriminatorDecorator,
|
|
82
85
|
DataInsightsService: () => DataInsightsService,
|
|
83
86
|
AutoGeneratedIdDecorator: () => AutoGeneratedIdDecorator,
|
|
87
|
+
AuthType: () => AuthType,
|
|
84
88
|
ApplicationService: () => ApplicationService,
|
|
85
89
|
Application: () => Application
|
|
86
90
|
});
|
|
@@ -294,6 +298,7 @@ var ProjectType;
|
|
|
294
298
|
// packages/os-api/src/api/model/EntityDefinition.ts
|
|
295
299
|
class EntityDefinition {
|
|
296
300
|
id;
|
|
301
|
+
organizationId;
|
|
297
302
|
applicationId;
|
|
298
303
|
projectId;
|
|
299
304
|
name;
|
|
@@ -314,6 +319,7 @@ class EntityDefinition {
|
|
|
314
319
|
// packages/os-api/src/api/model/NamedQueriesDefinition.ts
|
|
315
320
|
class NamedQueriesDefinition {
|
|
316
321
|
id;
|
|
322
|
+
organizationId;
|
|
317
323
|
applicationId;
|
|
318
324
|
projectId;
|
|
319
325
|
entityDefinitionName;
|
|
@@ -403,6 +409,38 @@ class VmNode {
|
|
|
403
409
|
this.hostname = hostname;
|
|
404
410
|
}
|
|
405
411
|
}
|
|
412
|
+
// packages/os-api/src/api/model/iam/AuthType.ts
|
|
413
|
+
var AuthType;
|
|
414
|
+
((AuthType2) => {
|
|
415
|
+
AuthType2["LOCAL"] = "LOCAL";
|
|
416
|
+
AuthType2["OIDC"] = "OIDC";
|
|
417
|
+
})(AuthType ||= {});
|
|
418
|
+
// packages/os-api/src/api/model/iam/IamUser.ts
|
|
419
|
+
class IamUser {
|
|
420
|
+
id = null;
|
|
421
|
+
email = "";
|
|
422
|
+
displayName = null;
|
|
423
|
+
authType = null;
|
|
424
|
+
oidcSubject = null;
|
|
425
|
+
oidcConfigId = null;
|
|
426
|
+
authScopeType = "";
|
|
427
|
+
authScopeId = "";
|
|
428
|
+
tenantId = null;
|
|
429
|
+
enabled = true;
|
|
430
|
+
created = null;
|
|
431
|
+
updated = null;
|
|
432
|
+
}
|
|
433
|
+
// packages/os-api/src/api/model/KinoticProjectConfig.ts
|
|
434
|
+
class KinoticProjectConfig {
|
|
435
|
+
name;
|
|
436
|
+
description;
|
|
437
|
+
organization;
|
|
438
|
+
application;
|
|
439
|
+
entitiesPaths;
|
|
440
|
+
generatedPath;
|
|
441
|
+
fileExtensionForImports = ".js";
|
|
442
|
+
validate;
|
|
443
|
+
}
|
|
406
444
|
// packages/os-api/src/api/services/IApplicationService.ts
|
|
407
445
|
var import_core = require("@kinotic-ai/core");
|
|
408
446
|
|
|
@@ -608,6 +646,29 @@ class WorkloadServiceProxy extends import_core6.CrudServiceProxy {
|
|
|
608
646
|
return this.serviceProxy.invoke("syncIndex", []);
|
|
609
647
|
}
|
|
610
648
|
}
|
|
649
|
+
// packages/os-api/src/api/services/iam/IIamUserService.ts
|
|
650
|
+
var import_core7 = require("@kinotic-ai/core");
|
|
651
|
+
|
|
652
|
+
class IamUserService extends import_core7.CrudServiceProxy {
|
|
653
|
+
constructor(kinotic) {
|
|
654
|
+
super(kinotic.serviceProxy("org.kinotic.os.api.services.iam.IamUserService"));
|
|
655
|
+
}
|
|
656
|
+
findByEmailAndScope(email, authScopeType, authScopeId) {
|
|
657
|
+
return this.serviceProxy.invoke("findByEmailAndScope", [email, authScopeType, authScopeId]);
|
|
658
|
+
}
|
|
659
|
+
findByScope(authScopeType, authScopeId, pageable) {
|
|
660
|
+
return this.serviceProxy.invoke("findByScope", [authScopeType, authScopeId, pageable]);
|
|
661
|
+
}
|
|
662
|
+
createUser(user, password) {
|
|
663
|
+
return this.serviceProxy.invoke("createUser", [user, password]);
|
|
664
|
+
}
|
|
665
|
+
changePassword(userId, currentPassword, newPassword) {
|
|
666
|
+
return this.serviceProxy.invoke("changePassword", [userId, currentPassword, newPassword]);
|
|
667
|
+
}
|
|
668
|
+
resetPassword(userId, newPassword) {
|
|
669
|
+
return this.serviceProxy.invoke("resetPassword", [userId, newPassword]);
|
|
670
|
+
}
|
|
671
|
+
}
|
|
611
672
|
// packages/os-api/src/api/OsApiPlugin.ts
|
|
612
673
|
var OsApiPlugin = {
|
|
613
674
|
install(kinotic) {
|
|
@@ -620,7 +681,8 @@ var OsApiPlugin = {
|
|
|
620
681
|
migrations: new MigrationService(kinotic),
|
|
621
682
|
dataInsights: new DataInsightsService(kinotic),
|
|
622
683
|
vmNodes: new VmNodeServiceProxy(kinotic),
|
|
623
|
-
workloads: new WorkloadServiceProxy(kinotic)
|
|
684
|
+
workloads: new WorkloadServiceProxy(kinotic),
|
|
685
|
+
iamUsers: new IamUserService(kinotic)
|
|
624
686
|
};
|
|
625
687
|
}
|
|
626
688
|
};
|
package/dist/index.d.cts
CHANGED
|
@@ -180,6 +180,11 @@ import { Identifiable as Identifiable3 } from "@kinotic-ai/core";
|
|
|
180
180
|
declare class EntityDefinition implements Identifiable3<string> {
|
|
181
181
|
id: string | null;
|
|
182
182
|
/**
|
|
183
|
+
* The id of the organization that owns this entity definition.
|
|
184
|
+
* Populated server-side by org enforcement on save.
|
|
185
|
+
*/
|
|
186
|
+
organizationId: string;
|
|
187
|
+
/**
|
|
183
188
|
* The id of the application that this entity definition belongs to.
|
|
184
189
|
* All application ids are unique throughout the entire system.
|
|
185
190
|
*/
|
|
@@ -205,6 +210,7 @@ import { FunctionDefinition } from "@kinotic-ai/idl";
|
|
|
205
210
|
*/
|
|
206
211
|
declare class NamedQueriesDefinition implements Identifiable4<string> {
|
|
207
212
|
id: string;
|
|
213
|
+
organizationId?: string | null;
|
|
208
214
|
applicationId: string;
|
|
209
215
|
projectId: string;
|
|
210
216
|
entityDefinitionName: string;
|
|
@@ -473,6 +479,36 @@ declare class VmNode implements Identifiable6<string> {
|
|
|
473
479
|
constructor(id: string, name: string, hostname: string);
|
|
474
480
|
}
|
|
475
481
|
/**
|
|
482
|
+
* Authentication method for an {@link IamUser}.
|
|
483
|
+
*/
|
|
484
|
+
declare enum AuthType {
|
|
485
|
+
LOCAL = "LOCAL",
|
|
486
|
+
OIDC = "OIDC"
|
|
487
|
+
}
|
|
488
|
+
import { Identifiable as Identifiable7 } from "@kinotic-ai/core";
|
|
489
|
+
/**
|
|
490
|
+
* Represents an authenticated identity at any scope layer in the IAM system.
|
|
491
|
+
* Each user is scoped to exactly one layer and is unique by email within that scope.
|
|
492
|
+
*
|
|
493
|
+
* - For SYSTEM and ORGANIZATION scopes, {@link tenantId} must be null.
|
|
494
|
+
* - For APPLICATION scopes, {@link tenantId} is required and identifies the
|
|
495
|
+
* client tenant the user belongs to within the application's data.
|
|
496
|
+
*/
|
|
497
|
+
declare class IamUser implements Identifiable7<string> {
|
|
498
|
+
id: string | null;
|
|
499
|
+
email: string;
|
|
500
|
+
displayName: string | null;
|
|
501
|
+
authType: AuthType | null;
|
|
502
|
+
oidcSubject: string | null;
|
|
503
|
+
oidcConfigId: string | null;
|
|
504
|
+
authScopeType: string;
|
|
505
|
+
authScopeId: string;
|
|
506
|
+
tenantId: string | null;
|
|
507
|
+
enabled: boolean;
|
|
508
|
+
created: number | null;
|
|
509
|
+
updated: number | null;
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
476
512
|
* Sent to the server to initiate an organization sign-up.
|
|
477
513
|
* The user provides {@link orgName}, {@link orgDescription}, {@link email}, and
|
|
478
514
|
* {@link displayName}. The remaining fields ({@link id}, {@link verificationToken},
|
|
@@ -498,6 +534,70 @@ interface SignUpCompleteRequest {
|
|
|
498
534
|
token: string;
|
|
499
535
|
password: string;
|
|
500
536
|
}
|
|
537
|
+
/**
|
|
538
|
+
* Configuration for a single entities path and its corresponding repository output.
|
|
539
|
+
*/
|
|
540
|
+
type EntitiesPathConfig = {
|
|
541
|
+
/**
|
|
542
|
+
* The path to search for classes decorated with @Entity.
|
|
543
|
+
*/
|
|
544
|
+
path: string;
|
|
545
|
+
/**
|
|
546
|
+
* The path where generated Repository classes will be placed.
|
|
547
|
+
*/
|
|
548
|
+
repositoryPath: string;
|
|
549
|
+
/**
|
|
550
|
+
* If true, the subfolder structure under the entities path will be mirrored under the repository path.
|
|
551
|
+
* For example, if entitiesPath is "src/model" and contains "payments/Payment.ts",
|
|
552
|
+
* the generated repository will be placed in "repositoryPath/payments/".
|
|
553
|
+
* If false, all generated repositories are placed directly in the repositoryPath.
|
|
554
|
+
* Defaults to true.
|
|
555
|
+
*/
|
|
556
|
+
mirrorFolderStructure?: boolean;
|
|
557
|
+
};
|
|
558
|
+
/**
|
|
559
|
+
* The project configuration for a Kinotic project.
|
|
560
|
+
*/
|
|
561
|
+
declare class KinoticProjectConfig {
|
|
562
|
+
/**
|
|
563
|
+
* The name of the project or undefined if a project name is used.
|
|
564
|
+
* i.e. if the project is typescript the package.json name will be used.
|
|
565
|
+
*/
|
|
566
|
+
name?: string;
|
|
567
|
+
/**
|
|
568
|
+
* The description of the project.
|
|
569
|
+
*/
|
|
570
|
+
description?: string;
|
|
571
|
+
/**
|
|
572
|
+
* The Kinotic Organization that this project belongs to.
|
|
573
|
+
*/
|
|
574
|
+
organization: string;
|
|
575
|
+
/**
|
|
576
|
+
* The Kinotic Application that this project belongs to.
|
|
577
|
+
*/
|
|
578
|
+
application: string;
|
|
579
|
+
/**
|
|
580
|
+
* The paths to search for classes decorated with @Entity that Kinotic will be created for.
|
|
581
|
+
* Each entry can be a string (simple path) or an {@link EntitiesPathConfig} object for full control
|
|
582
|
+
* over where repository classes are generated.
|
|
583
|
+
*
|
|
584
|
+
* When a plain string is provided, the {@link generatedPath} will be used as the repository output path.
|
|
585
|
+
*/
|
|
586
|
+
entitiesPaths: (string | EntitiesPathConfig)[];
|
|
587
|
+
/**
|
|
588
|
+
* The default path to where generated files will be placed when entitiesPaths contains plain strings.
|
|
589
|
+
* Ignored for entitiesPaths entries that use {@link EntitiesPathConfig}.
|
|
590
|
+
*/
|
|
591
|
+
generatedPath?: string;
|
|
592
|
+
/**
|
|
593
|
+
* The file extension to use for imports in generated files.
|
|
594
|
+
*/
|
|
595
|
+
fileExtensionForImports: string;
|
|
596
|
+
/**
|
|
597
|
+
* If true the generated Repository classes will validate all data before sending to the server.
|
|
598
|
+
*/
|
|
599
|
+
validate?: boolean;
|
|
600
|
+
}
|
|
501
601
|
import { IKinotic } from "@kinotic-ai/core";
|
|
502
602
|
import { CrudServiceProxy, ICrudServiceProxy } from "@kinotic-ai/core";
|
|
503
603
|
interface IApplicationService extends ICrudServiceProxy<Application> {
|
|
@@ -800,6 +900,39 @@ declare class WorkloadServiceProxy extends CrudServiceProxy6<Workload> implement
|
|
|
800
900
|
countForNode(nodeId: string): Promise<number>;
|
|
801
901
|
syncIndex(): Promise<void>;
|
|
802
902
|
}
|
|
903
|
+
import { CrudServiceProxy as CrudServiceProxy7, IKinotic as IKinotic10, ICrudServiceProxy as ICrudServiceProxy7, Page as Page3, Pageable as Pageable4 } from "@kinotic-ai/core";
|
|
904
|
+
interface IIamUserService extends ICrudServiceProxy7<IamUser> {
|
|
905
|
+
/**
|
|
906
|
+
* Finds the user with the given email within the given auth scope.
|
|
907
|
+
* @return Promise emitting the user or null if no user matches
|
|
908
|
+
*/
|
|
909
|
+
findByEmailAndScope(email: string, authScopeType: string, authScopeId: string): Promise<IamUser | null>;
|
|
910
|
+
/**
|
|
911
|
+
* Finds all users registered against the given auth scope.
|
|
912
|
+
*/
|
|
913
|
+
findByScope(authScopeType: string, authScopeId: string, pageable: Pageable4): Promise<Page3<IamUser>>;
|
|
914
|
+
/**
|
|
915
|
+
* Creates a user and, if a password is provided, the matching credential.
|
|
916
|
+
* APPLICATION-scoped users must carry a {@code tenantId}; SYSTEM and ORGANIZATION users must not.
|
|
917
|
+
*/
|
|
918
|
+
createUser(user: IamUser, password: string | null): Promise<IamUser>;
|
|
919
|
+
/**
|
|
920
|
+
* Verifies the current password and updates it. Used when the user knows their current password.
|
|
921
|
+
*/
|
|
922
|
+
changePassword(userId: string, currentPassword: string, newPassword: string): Promise<void>;
|
|
923
|
+
/**
|
|
924
|
+
* Replaces the user's password without verifying the current one. Administrative reset.
|
|
925
|
+
*/
|
|
926
|
+
resetPassword(userId: string, newPassword: string): Promise<void>;
|
|
927
|
+
}
|
|
928
|
+
declare class IamUserService extends CrudServiceProxy7<IamUser> implements IIamUserService {
|
|
929
|
+
constructor(kinotic: IKinotic10);
|
|
930
|
+
findByEmailAndScope(email: string, authScopeType: string, authScopeId: string): Promise<IamUser | null>;
|
|
931
|
+
findByScope(authScopeType: string, authScopeId: string, pageable: Pageable4): Promise<Page3<IamUser>>;
|
|
932
|
+
createUser(user: IamUser, password: string | null): Promise<IamUser>;
|
|
933
|
+
changePassword(userId: string, currentPassword: string, newPassword: string): Promise<void>;
|
|
934
|
+
resetPassword(userId: string, newPassword: string): Promise<void>;
|
|
935
|
+
}
|
|
803
936
|
import { KinoticPlugin } from "@kinotic-ai/core";
|
|
804
937
|
interface IOsApiExtension {
|
|
805
938
|
applications: IApplicationService;
|
|
@@ -811,9 +944,10 @@ interface IOsApiExtension {
|
|
|
811
944
|
dataInsights: IDataInsightsService;
|
|
812
945
|
vmNodes: IVmNodeService;
|
|
813
946
|
workloads: IWorkloadService;
|
|
947
|
+
iamUsers: IIamUserService;
|
|
814
948
|
}
|
|
815
949
|
declare const OsApiPlugin: KinoticPlugin<IOsApiExtension>;
|
|
816
950
|
declare module "@kinotic-ai/core" {
|
|
817
951
|
interface KinoticSingleton extends IOsApiExtension {}
|
|
818
952
|
}
|
|
819
|
-
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, NotIndexedDecorator, NestedDecorator, NamedQueriesDefinitionService, NamedQueriesDefinition, MigrationService, MigrationResult, MigrationRequest, MigrationDefinition, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, InsightRequest, InsightProgress, IdDecorator, IWorkloadService, IVmNodeService, IProjectService, IOsApiExtension, INamedQueriesDefinitionService, IMigrationService, ILogManager, IEntityDefinitionService, IDataInsightsService, IApplicationService, GroupLoggerLevelsDescriptor, FlattenedDecorator, EsIndexConfigurationDecorator, EntityDefinitionService, EntityDefinition, EntityDecorator, DiscriminatorDecorator, DataInsightsService, DataInsightsComponent, AutoGeneratedIdDecorator, ApplicationService, Application };
|
|
953
|
+
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, NotIndexedDecorator, NestedDecorator, NamedQueriesDefinitionService, NamedQueriesDefinition, MigrationService, MigrationResult, MigrationRequest, MigrationDefinition, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticProjectConfig, InsightRequest, InsightProgress, IdDecorator, IamUserService, IamUser, IWorkloadService, IVmNodeService, IProjectService, IOsApiExtension, INamedQueriesDefinitionService, IMigrationService, ILogManager, IIamUserService, IEntityDefinitionService, IDataInsightsService, IApplicationService, GroupLoggerLevelsDescriptor, FlattenedDecorator, EsIndexConfigurationDecorator, EntityDefinitionService, EntityDefinition, EntityDecorator, EntitiesPathConfig, DiscriminatorDecorator, DataInsightsService, DataInsightsComponent, AutoGeneratedIdDecorator, AuthType, ApplicationService, Application };
|
package/dist/index.d.ts
CHANGED
|
@@ -180,6 +180,11 @@ import { Identifiable as Identifiable3 } from "@kinotic-ai/core";
|
|
|
180
180
|
declare class EntityDefinition implements Identifiable3<string> {
|
|
181
181
|
id: string | null;
|
|
182
182
|
/**
|
|
183
|
+
* The id of the organization that owns this entity definition.
|
|
184
|
+
* Populated server-side by org enforcement on save.
|
|
185
|
+
*/
|
|
186
|
+
organizationId: string;
|
|
187
|
+
/**
|
|
183
188
|
* The id of the application that this entity definition belongs to.
|
|
184
189
|
* All application ids are unique throughout the entire system.
|
|
185
190
|
*/
|
|
@@ -205,6 +210,7 @@ import { FunctionDefinition } from "@kinotic-ai/idl";
|
|
|
205
210
|
*/
|
|
206
211
|
declare class NamedQueriesDefinition implements Identifiable4<string> {
|
|
207
212
|
id: string;
|
|
213
|
+
organizationId?: string | null;
|
|
208
214
|
applicationId: string;
|
|
209
215
|
projectId: string;
|
|
210
216
|
entityDefinitionName: string;
|
|
@@ -473,6 +479,36 @@ declare class VmNode implements Identifiable6<string> {
|
|
|
473
479
|
constructor(id: string, name: string, hostname: string);
|
|
474
480
|
}
|
|
475
481
|
/**
|
|
482
|
+
* Authentication method for an {@link IamUser}.
|
|
483
|
+
*/
|
|
484
|
+
declare enum AuthType {
|
|
485
|
+
LOCAL = "LOCAL",
|
|
486
|
+
OIDC = "OIDC"
|
|
487
|
+
}
|
|
488
|
+
import { Identifiable as Identifiable7 } from "@kinotic-ai/core";
|
|
489
|
+
/**
|
|
490
|
+
* Represents an authenticated identity at any scope layer in the IAM system.
|
|
491
|
+
* Each user is scoped to exactly one layer and is unique by email within that scope.
|
|
492
|
+
*
|
|
493
|
+
* - For SYSTEM and ORGANIZATION scopes, {@link tenantId} must be null.
|
|
494
|
+
* - For APPLICATION scopes, {@link tenantId} is required and identifies the
|
|
495
|
+
* client tenant the user belongs to within the application's data.
|
|
496
|
+
*/
|
|
497
|
+
declare class IamUser implements Identifiable7<string> {
|
|
498
|
+
id: string | null;
|
|
499
|
+
email: string;
|
|
500
|
+
displayName: string | null;
|
|
501
|
+
authType: AuthType | null;
|
|
502
|
+
oidcSubject: string | null;
|
|
503
|
+
oidcConfigId: string | null;
|
|
504
|
+
authScopeType: string;
|
|
505
|
+
authScopeId: string;
|
|
506
|
+
tenantId: string | null;
|
|
507
|
+
enabled: boolean;
|
|
508
|
+
created: number | null;
|
|
509
|
+
updated: number | null;
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
476
512
|
* Sent to the server to initiate an organization sign-up.
|
|
477
513
|
* The user provides {@link orgName}, {@link orgDescription}, {@link email}, and
|
|
478
514
|
* {@link displayName}. The remaining fields ({@link id}, {@link verificationToken},
|
|
@@ -498,6 +534,70 @@ interface SignUpCompleteRequest {
|
|
|
498
534
|
token: string;
|
|
499
535
|
password: string;
|
|
500
536
|
}
|
|
537
|
+
/**
|
|
538
|
+
* Configuration for a single entities path and its corresponding repository output.
|
|
539
|
+
*/
|
|
540
|
+
type EntitiesPathConfig = {
|
|
541
|
+
/**
|
|
542
|
+
* The path to search for classes decorated with @Entity.
|
|
543
|
+
*/
|
|
544
|
+
path: string;
|
|
545
|
+
/**
|
|
546
|
+
* The path where generated Repository classes will be placed.
|
|
547
|
+
*/
|
|
548
|
+
repositoryPath: string;
|
|
549
|
+
/**
|
|
550
|
+
* If true, the subfolder structure under the entities path will be mirrored under the repository path.
|
|
551
|
+
* For example, if entitiesPath is "src/model" and contains "payments/Payment.ts",
|
|
552
|
+
* the generated repository will be placed in "repositoryPath/payments/".
|
|
553
|
+
* If false, all generated repositories are placed directly in the repositoryPath.
|
|
554
|
+
* Defaults to true.
|
|
555
|
+
*/
|
|
556
|
+
mirrorFolderStructure?: boolean;
|
|
557
|
+
};
|
|
558
|
+
/**
|
|
559
|
+
* The project configuration for a Kinotic project.
|
|
560
|
+
*/
|
|
561
|
+
declare class KinoticProjectConfig {
|
|
562
|
+
/**
|
|
563
|
+
* The name of the project or undefined if a project name is used.
|
|
564
|
+
* i.e. if the project is typescript the package.json name will be used.
|
|
565
|
+
*/
|
|
566
|
+
name?: string;
|
|
567
|
+
/**
|
|
568
|
+
* The description of the project.
|
|
569
|
+
*/
|
|
570
|
+
description?: string;
|
|
571
|
+
/**
|
|
572
|
+
* The Kinotic Organization that this project belongs to.
|
|
573
|
+
*/
|
|
574
|
+
organization: string;
|
|
575
|
+
/**
|
|
576
|
+
* The Kinotic Application that this project belongs to.
|
|
577
|
+
*/
|
|
578
|
+
application: string;
|
|
579
|
+
/**
|
|
580
|
+
* The paths to search for classes decorated with @Entity that Kinotic will be created for.
|
|
581
|
+
* Each entry can be a string (simple path) or an {@link EntitiesPathConfig} object for full control
|
|
582
|
+
* over where repository classes are generated.
|
|
583
|
+
*
|
|
584
|
+
* When a plain string is provided, the {@link generatedPath} will be used as the repository output path.
|
|
585
|
+
*/
|
|
586
|
+
entitiesPaths: (string | EntitiesPathConfig)[];
|
|
587
|
+
/**
|
|
588
|
+
* The default path to where generated files will be placed when entitiesPaths contains plain strings.
|
|
589
|
+
* Ignored for entitiesPaths entries that use {@link EntitiesPathConfig}.
|
|
590
|
+
*/
|
|
591
|
+
generatedPath?: string;
|
|
592
|
+
/**
|
|
593
|
+
* The file extension to use for imports in generated files.
|
|
594
|
+
*/
|
|
595
|
+
fileExtensionForImports: string;
|
|
596
|
+
/**
|
|
597
|
+
* If true the generated Repository classes will validate all data before sending to the server.
|
|
598
|
+
*/
|
|
599
|
+
validate?: boolean;
|
|
600
|
+
}
|
|
501
601
|
import { IKinotic } from "@kinotic-ai/core";
|
|
502
602
|
import { CrudServiceProxy, ICrudServiceProxy } from "@kinotic-ai/core";
|
|
503
603
|
interface IApplicationService extends ICrudServiceProxy<Application> {
|
|
@@ -800,6 +900,39 @@ declare class WorkloadServiceProxy extends CrudServiceProxy6<Workload> implement
|
|
|
800
900
|
countForNode(nodeId: string): Promise<number>;
|
|
801
901
|
syncIndex(): Promise<void>;
|
|
802
902
|
}
|
|
903
|
+
import { CrudServiceProxy as CrudServiceProxy7, IKinotic as IKinotic10, ICrudServiceProxy as ICrudServiceProxy7, Page as Page3, Pageable as Pageable4 } from "@kinotic-ai/core";
|
|
904
|
+
interface IIamUserService extends ICrudServiceProxy7<IamUser> {
|
|
905
|
+
/**
|
|
906
|
+
* Finds the user with the given email within the given auth scope.
|
|
907
|
+
* @return Promise emitting the user or null if no user matches
|
|
908
|
+
*/
|
|
909
|
+
findByEmailAndScope(email: string, authScopeType: string, authScopeId: string): Promise<IamUser | null>;
|
|
910
|
+
/**
|
|
911
|
+
* Finds all users registered against the given auth scope.
|
|
912
|
+
*/
|
|
913
|
+
findByScope(authScopeType: string, authScopeId: string, pageable: Pageable4): Promise<Page3<IamUser>>;
|
|
914
|
+
/**
|
|
915
|
+
* Creates a user and, if a password is provided, the matching credential.
|
|
916
|
+
* APPLICATION-scoped users must carry a {@code tenantId}; SYSTEM and ORGANIZATION users must not.
|
|
917
|
+
*/
|
|
918
|
+
createUser(user: IamUser, password: string | null): Promise<IamUser>;
|
|
919
|
+
/**
|
|
920
|
+
* Verifies the current password and updates it. Used when the user knows their current password.
|
|
921
|
+
*/
|
|
922
|
+
changePassword(userId: string, currentPassword: string, newPassword: string): Promise<void>;
|
|
923
|
+
/**
|
|
924
|
+
* Replaces the user's password without verifying the current one. Administrative reset.
|
|
925
|
+
*/
|
|
926
|
+
resetPassword(userId: string, newPassword: string): Promise<void>;
|
|
927
|
+
}
|
|
928
|
+
declare class IamUserService extends CrudServiceProxy7<IamUser> implements IIamUserService {
|
|
929
|
+
constructor(kinotic: IKinotic10);
|
|
930
|
+
findByEmailAndScope(email: string, authScopeType: string, authScopeId: string): Promise<IamUser | null>;
|
|
931
|
+
findByScope(authScopeType: string, authScopeId: string, pageable: Pageable4): Promise<Page3<IamUser>>;
|
|
932
|
+
createUser(user: IamUser, password: string | null): Promise<IamUser>;
|
|
933
|
+
changePassword(userId: string, currentPassword: string, newPassword: string): Promise<void>;
|
|
934
|
+
resetPassword(userId: string, newPassword: string): Promise<void>;
|
|
935
|
+
}
|
|
803
936
|
import { KinoticPlugin } from "@kinotic-ai/core";
|
|
804
937
|
interface IOsApiExtension {
|
|
805
938
|
applications: IApplicationService;
|
|
@@ -811,9 +944,10 @@ interface IOsApiExtension {
|
|
|
811
944
|
dataInsights: IDataInsightsService;
|
|
812
945
|
vmNodes: IVmNodeService;
|
|
813
946
|
workloads: IWorkloadService;
|
|
947
|
+
iamUsers: IIamUserService;
|
|
814
948
|
}
|
|
815
949
|
declare const OsApiPlugin: KinoticPlugin<IOsApiExtension>;
|
|
816
950
|
declare module "@kinotic-ai/core" {
|
|
817
951
|
interface KinoticSingleton extends IOsApiExtension {}
|
|
818
952
|
}
|
|
819
|
-
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, NotIndexedDecorator, NestedDecorator, NamedQueriesDefinitionService, NamedQueriesDefinition, MigrationService, MigrationResult, MigrationRequest, MigrationDefinition, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, InsightRequest, InsightProgress, IdDecorator, IWorkloadService, IVmNodeService, IProjectService, IOsApiExtension, INamedQueriesDefinitionService, IMigrationService, ILogManager, IEntityDefinitionService, IDataInsightsService, IApplicationService, GroupLoggerLevelsDescriptor, FlattenedDecorator, EsIndexConfigurationDecorator, EntityDefinitionService, EntityDefinition, EntityDecorator, DiscriminatorDecorator, DataInsightsService, DataInsightsComponent, AutoGeneratedIdDecorator, ApplicationService, Application };
|
|
953
|
+
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, NotIndexedDecorator, NestedDecorator, NamedQueriesDefinitionService, NamedQueriesDefinition, MigrationService, MigrationResult, MigrationRequest, MigrationDefinition, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticProjectConfig, InsightRequest, InsightProgress, IdDecorator, IamUserService, IamUser, IWorkloadService, IVmNodeService, IProjectService, IOsApiExtension, INamedQueriesDefinitionService, IMigrationService, ILogManager, IIamUserService, IEntityDefinitionService, IDataInsightsService, IApplicationService, GroupLoggerLevelsDescriptor, FlattenedDecorator, EsIndexConfigurationDecorator, EntityDefinitionService, EntityDefinition, EntityDecorator, EntitiesPathConfig, DiscriminatorDecorator, DataInsightsService, DataInsightsComponent, AutoGeneratedIdDecorator, AuthType, ApplicationService, Application };
|
package/dist/index.js
CHANGED
|
@@ -206,6 +206,7 @@ var ProjectType;
|
|
|
206
206
|
// packages/os-api/src/api/model/EntityDefinition.ts
|
|
207
207
|
class EntityDefinition {
|
|
208
208
|
id;
|
|
209
|
+
organizationId;
|
|
209
210
|
applicationId;
|
|
210
211
|
projectId;
|
|
211
212
|
name;
|
|
@@ -226,6 +227,7 @@ class EntityDefinition {
|
|
|
226
227
|
// packages/os-api/src/api/model/NamedQueriesDefinition.ts
|
|
227
228
|
class NamedQueriesDefinition {
|
|
228
229
|
id;
|
|
230
|
+
organizationId;
|
|
229
231
|
applicationId;
|
|
230
232
|
projectId;
|
|
231
233
|
entityDefinitionName;
|
|
@@ -315,6 +317,38 @@ class VmNode {
|
|
|
315
317
|
this.hostname = hostname;
|
|
316
318
|
}
|
|
317
319
|
}
|
|
320
|
+
// packages/os-api/src/api/model/iam/AuthType.ts
|
|
321
|
+
var AuthType;
|
|
322
|
+
((AuthType2) => {
|
|
323
|
+
AuthType2["LOCAL"] = "LOCAL";
|
|
324
|
+
AuthType2["OIDC"] = "OIDC";
|
|
325
|
+
})(AuthType ||= {});
|
|
326
|
+
// packages/os-api/src/api/model/iam/IamUser.ts
|
|
327
|
+
class IamUser {
|
|
328
|
+
id = null;
|
|
329
|
+
email = "";
|
|
330
|
+
displayName = null;
|
|
331
|
+
authType = null;
|
|
332
|
+
oidcSubject = null;
|
|
333
|
+
oidcConfigId = null;
|
|
334
|
+
authScopeType = "";
|
|
335
|
+
authScopeId = "";
|
|
336
|
+
tenantId = null;
|
|
337
|
+
enabled = true;
|
|
338
|
+
created = null;
|
|
339
|
+
updated = null;
|
|
340
|
+
}
|
|
341
|
+
// packages/os-api/src/api/model/KinoticProjectConfig.ts
|
|
342
|
+
class KinoticProjectConfig {
|
|
343
|
+
name;
|
|
344
|
+
description;
|
|
345
|
+
organization;
|
|
346
|
+
application;
|
|
347
|
+
entitiesPaths;
|
|
348
|
+
generatedPath;
|
|
349
|
+
fileExtensionForImports = ".js";
|
|
350
|
+
validate;
|
|
351
|
+
}
|
|
318
352
|
// packages/os-api/src/api/services/IApplicationService.ts
|
|
319
353
|
import { CrudServiceProxy } from "@kinotic-ai/core";
|
|
320
354
|
|
|
@@ -520,6 +554,29 @@ class WorkloadServiceProxy extends CrudServiceProxy6 {
|
|
|
520
554
|
return this.serviceProxy.invoke("syncIndex", []);
|
|
521
555
|
}
|
|
522
556
|
}
|
|
557
|
+
// packages/os-api/src/api/services/iam/IIamUserService.ts
|
|
558
|
+
import { CrudServiceProxy as CrudServiceProxy7 } from "@kinotic-ai/core";
|
|
559
|
+
|
|
560
|
+
class IamUserService extends CrudServiceProxy7 {
|
|
561
|
+
constructor(kinotic) {
|
|
562
|
+
super(kinotic.serviceProxy("org.kinotic.os.api.services.iam.IamUserService"));
|
|
563
|
+
}
|
|
564
|
+
findByEmailAndScope(email, authScopeType, authScopeId) {
|
|
565
|
+
return this.serviceProxy.invoke("findByEmailAndScope", [email, authScopeType, authScopeId]);
|
|
566
|
+
}
|
|
567
|
+
findByScope(authScopeType, authScopeId, pageable) {
|
|
568
|
+
return this.serviceProxy.invoke("findByScope", [authScopeType, authScopeId, pageable]);
|
|
569
|
+
}
|
|
570
|
+
createUser(user, password) {
|
|
571
|
+
return this.serviceProxy.invoke("createUser", [user, password]);
|
|
572
|
+
}
|
|
573
|
+
changePassword(userId, currentPassword, newPassword) {
|
|
574
|
+
return this.serviceProxy.invoke("changePassword", [userId, currentPassword, newPassword]);
|
|
575
|
+
}
|
|
576
|
+
resetPassword(userId, newPassword) {
|
|
577
|
+
return this.serviceProxy.invoke("resetPassword", [userId, newPassword]);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
523
580
|
// packages/os-api/src/api/OsApiPlugin.ts
|
|
524
581
|
var OsApiPlugin = {
|
|
525
582
|
install(kinotic) {
|
|
@@ -532,7 +589,8 @@ var OsApiPlugin = {
|
|
|
532
589
|
migrations: new MigrationService(kinotic),
|
|
533
590
|
dataInsights: new DataInsightsService(kinotic),
|
|
534
591
|
vmNodes: new VmNodeServiceProxy(kinotic),
|
|
535
|
-
workloads: new WorkloadServiceProxy(kinotic)
|
|
592
|
+
workloads: new WorkloadServiceProxy(kinotic),
|
|
593
|
+
iamUsers: new IamUserService(kinotic)
|
|
536
594
|
};
|
|
537
595
|
}
|
|
538
596
|
};
|
|
@@ -568,7 +626,10 @@ export {
|
|
|
568
626
|
LoggerLevelsDescriptor,
|
|
569
627
|
LogManager,
|
|
570
628
|
LogLevel,
|
|
629
|
+
KinoticProjectConfig,
|
|
571
630
|
IdDecorator,
|
|
631
|
+
IamUserService,
|
|
632
|
+
IamUser,
|
|
572
633
|
GroupLoggerLevelsDescriptor,
|
|
573
634
|
FlattenedDecorator,
|
|
574
635
|
EsIndexConfigurationDecorator,
|
|
@@ -578,6 +639,7 @@ export {
|
|
|
578
639
|
DiscriminatorDecorator,
|
|
579
640
|
DataInsightsService,
|
|
580
641
|
AutoGeneratedIdDecorator,
|
|
642
|
+
AuthType,
|
|
581
643
|
ApplicationService,
|
|
582
644
|
Application
|
|
583
645
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kinotic-ai/os-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@kinotic-ai/idl": "1.0.9",
|
|
40
|
-
"@kinotic-ai/persistence": "1.1.
|
|
40
|
+
"@kinotic-ai/persistence": "1.1.1",
|
|
41
41
|
"rxjs": "^7.8.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|