@kinotic-ai/os-api 1.6.0 → 1.7.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
@@ -349,7 +349,7 @@ class NamedQueriesDefinition {
349
349
  projectId;
350
350
  entityDefinitionName;
351
351
  namedQueries;
352
- constructor(organizationId, id, applicationId, projectId, entityDefinitionName, namedQueries) {
352
+ constructor(id, organizationId, applicationId, projectId, entityDefinitionName, namedQueries) {
353
353
  this.id = id;
354
354
  this.organizationId = organizationId;
355
355
  this.applicationId = applicationId;
@@ -449,8 +449,8 @@ class IamUser {
449
449
  authType = null;
450
450
  oidcSubject = null;
451
451
  oidcConfigId = null;
452
- authScopeType = "";
453
- authScopeId = "";
452
+ organizationId = null;
453
+ applicationId = null;
454
454
  tenantId = null;
455
455
  enabled = true;
456
456
  created = null;
@@ -714,25 +714,22 @@ var import_core8 = require("@kinotic-ai/core");
714
714
 
715
715
  class IamUserService extends import_core8.CrudServiceProxy {
716
716
  constructor(kinotic) {
717
- super(kinotic.serviceProxy("org.kinotic.os.api.services.iam.IamUserService"));
717
+ super(kinotic.serviceProxy("org.kinotic.domain.api.services.iam.IamUserService"));
718
718
  }
719
- findByEmailAndScope(email, authScopeType, authScopeId) {
720
- return this.serviceProxy.invoke("findByEmailAndScope", [email, authScopeType, authScopeId]);
719
+ findByEmail(email, organizationId, applicationId) {
720
+ return arguments.length >= 3 ? this.serviceProxy.invoke("findByEmail", [email, organizationId, applicationId]) : this.serviceProxy.invoke("findByEmail", [email]);
721
721
  }
722
- findByScope(authScopeType, authScopeId, pageable) {
723
- return this.serviceProxy.invoke("findByScope", [authScopeType, authScopeId, pageable]);
722
+ findFirstOrgUserByEmail(email) {
723
+ return this.serviceProxy.invoke("findFirstOrgUserByEmail", [email]);
724
724
  }
725
- createUser(user, password) {
726
- return this.serviceProxy.invoke("createUser", [user, password]);
727
- }
728
- changePassword(userId, currentPassword, newPassword) {
729
- return this.serviceProxy.invoke("changePassword", [userId, currentPassword, newPassword]);
725
+ findByOidcIdentity(oidcSubject, oidcConfigId, organizationId, applicationId) {
726
+ return this.serviceProxy.invoke("findByOidcIdentity", [oidcSubject, oidcConfigId, organizationId, applicationId]);
730
727
  }
731
- resetPassword(userId, newPassword) {
732
- return this.serviceProxy.invoke("resetPassword", [userId, newPassword]);
728
+ findAllByOidcIdentity(oidcSubject, oidcConfigId) {
729
+ return this.serviceProxy.invoke("findAllByOidcIdentity", [oidcSubject, oidcConfigId]);
733
730
  }
734
- findFirstByEmailInScopeType(email, authScopeType) {
735
- return this.serviceProxy.invoke("findFirstByEmailInScopeType", [email, authScopeType]);
731
+ createUser(user, password) {
732
+ return this.serviceProxy.invoke("createUser", [user, password]);
736
733
  }
737
734
  }
738
735
  // packages/os-api/src/api/services/IDeviceApprovalService.ts
package/dist/index.d.cts CHANGED
@@ -261,7 +261,7 @@ declare class NamedQueriesDefinition implements Identifiable5<string> {
261
261
  projectId: string;
262
262
  entityDefinitionName: string;
263
263
  namedQueries: FunctionDefinition[];
264
- constructor(organizationId: string, id: string, applicationId: string, projectId: string, entityDefinitionName: string, namedQueries: FunctionDefinition[]);
264
+ constructor(id: string, organizationId: string, applicationId: string, projectId: string, entityDefinitionName: string, namedQueries: FunctionDefinition[]);
265
265
  }
266
266
  /**
267
267
  * Represents a migration definition that can be sent via the API.
@@ -533,12 +533,12 @@ declare enum AuthType {
533
533
  }
534
534
  import { Identifiable as Identifiable8 } from "@kinotic-ai/core";
535
535
  /**
536
- * Represents an authenticated identity at any scope layer in the IAM system.
537
- * Each user is scoped to exactly one layer and is unique by email within that scope.
536
+ * Represents an authenticated identity in the IAM system. Scope is encoded structurally by
537
+ * which of {@link organizationId} / {@link applicationId} is set:
538
538
  *
539
- * - For SYSTEM and ORGANIZATION scopes, {@link tenantId} must be null.
540
- * - For APPLICATION scopes, {@link tenantId} is required and identifies the
541
- * client tenant the user belongs to within the application's data.
539
+ * - both null SYSTEM
540
+ * - {@link organizationId} only ORGANIZATION
541
+ * - both set APPLICATION, with {@link tenantId} identifying the end-user data slice
542
542
  */
543
543
  declare class IamUser implements Identifiable8<string> {
544
544
  id: string | null;
@@ -547,39 +547,42 @@ declare class IamUser implements Identifiable8<string> {
547
547
  authType: AuthType | null;
548
548
  oidcSubject: string | null;
549
549
  oidcConfigId: string | null;
550
- authScopeType: string;
551
- authScopeId: string;
550
+ organizationId: string | null;
551
+ applicationId: string | null;
552
552
  tenantId: string | null;
553
553
  enabled: boolean;
554
554
  created: number | null;
555
555
  updated: number | null;
556
556
  }
557
557
  /**
558
- * Sent to the server to initiate an organization sign-up.
559
- * The user provides {@link orgName}, {@link orgDescription}, {@link email}, and
560
- * {@link displayName}. The remaining fields ({@link id}, {@link verificationToken},
561
- * {@link expiresAt}, {@link created}) are populated by the server before the record
562
- * is persisted.
558
+ * Sent to {@code POST /api/signup} to start an email/password organization sign-up.
559
+ * Only the user's identity is collected up front; the organization name and password are
560
+ * provided after email verification (see {@link SignUpCompleteRequest}).
563
561
  */
564
562
  interface SignUpRequest {
565
- id?: string | null;
566
- verificationToken?: string | null;
567
- expiresAt?: number | null;
568
- created?: number | null;
569
- orgName: string;
570
- orgDescription?: string | null;
571
563
  email: string;
572
564
  displayName: string;
573
565
  }
574
566
  /**
575
- * Sent to the server to complete an organization sign-up after email verification.
576
- * The {@link token} comes from the verification email link; the {@link password}
577
- * is what the user enters on the "set your password" form.
567
+ * Sent to {@code POST /api/signup/complete} after the user clicks the verification link.
568
+ * The {@link token} comes from that link; {@link orgName} (with optional {@link orgDescription})
569
+ * names the organization to create, and {@link password} is the chosen account password.
578
570
  */
579
571
  interface SignUpCompleteRequest {
580
572
  token: string;
573
+ orgName: string;
574
+ orgDescription?: string | null;
581
575
  password: string;
582
576
  }
577
+ /**
578
+ * Sent to {@code POST /api/signup/complete-org} to finish an OIDC sign-up by naming the
579
+ * organization to create. The verified identity is held server-side, keyed by {@link token}.
580
+ */
581
+ interface CompleteOrgRequest {
582
+ token: string;
583
+ orgName: string;
584
+ orgDescription?: string | null;
585
+ }
583
586
  import { Identifiable as Identifiable9 } from "@kinotic-ai/core";
584
587
  /**
585
588
  * Persisted record of one GitHub App installation that a Kinotic Org has authorised.
@@ -1012,65 +1015,46 @@ declare class WorkloadServiceProxy extends CrudServiceProxy7<Workload> implement
1012
1015
  countForNode(nodeId: string): Promise<number>;
1013
1016
  syncIndex(): Promise<void>;
1014
1017
  }
1015
- import { CrudServiceProxy as CrudServiceProxy8, IKinotic as IKinotic11, ICrudServiceProxy as ICrudServiceProxy8, Page as Page3, Pageable as Pageable4 } from "@kinotic-ai/core";
1018
+ import { CrudServiceProxy as CrudServiceProxy8, IKinotic as IKinotic11, ICrudServiceProxy as ICrudServiceProxy8 } from "@kinotic-ai/core";
1019
+ /**
1020
+ * Client proxy for the server's {@code IamUserService}; method shapes mirror the Java interface.
1021
+ *
1022
+ * NOTE: the server interface now lives in {@code kinotic-domain} and is not currently
1023
+ * {@code @Publish}-annotated, so this proxy is not callable over RPC until the backend publishes
1024
+ * the service. The shape here is kept in sync so it is ready once that happens; confirm the
1025
+ * published namespace before relying on it.
1026
+ */
1016
1027
  interface IIamUserService extends ICrudServiceProxy8<IamUser> {
1028
+ /** Finds the first user with the given email across all scopes, or null. */
1029
+ findByEmail(email: string): Promise<IamUser | null>;
1017
1030
  /**
1018
- * Finds the user with the given email within the given auth scope.
1019
- * @param email the email address to look up
1020
- * @param authScopeType the scope type the user is registered against (e.g. {@code SYSTEM}, {@code ORGANIZATION}, {@code APPLICATION})
1021
- * @param authScopeId the id of the scope the user is registered against
1022
- * @return {@link Promise} emitting the matching user, or {@code null} if no user matches
1031
+ * Finds the user with the given email within a scope identified structurally by
1032
+ * (organizationId, applicationId): both null SYSTEM, organizationId only → ORGANIZATION,
1033
+ * both set APPLICATION.
1023
1034
  */
1024
- findByEmailAndScope(email: string, authScopeType: string, authScopeId: string): Promise<IamUser | null>;
1035
+ findByEmail(email: string, organizationId: string | null, applicationId: string | null): Promise<IamUser | null>;
1025
1036
  /**
1026
- * Finds all users registered against the given auth scope.
1027
- * @param authScopeType the scope type to filter by (e.g. {@code SYSTEM}, {@code ORGANIZATION}, {@code APPLICATION})
1028
- * @param authScopeId the id of the scope to filter by
1029
- * @param pageable the paging and sort options
1030
- * @return {@link Promise} emitting a page of users registered against the scope
1037
+ * Finds the first ORGANIZATION-scope user with the given email across all organizations.
1038
+ * Used by sign-up to enforce one user per email before the new org's id exists.
1031
1039
  */
1032
- findByScope(authScopeType: string, authScopeId: string, pageable: Pageable4): Promise<Page3<IamUser>>;
1040
+ findFirstOrgUserByEmail(email: string): Promise<IamUser | null>;
1033
1041
  /**
1034
- * Creates a user and, if a password is provided, the matching credential.
1035
- * {@code APPLICATION}-scoped users must carry a {@code tenantId}; {@code SYSTEM} and {@code ORGANIZATION} users must not.
1036
- * @param user the user to create
1037
- * @param password the password to set, or {@code null} to create the user without a credential
1038
- * @return {@link Promise} emitting the persisted user
1042
+ * Finds the user (if any) with the given OIDC identity within a specific scope, using the
1043
+ * same (organizationId, applicationId) null conventions as {@link findByEmail}.
1039
1044
  */
1045
+ findByOidcIdentity(oidcSubject: string, oidcConfigId: string, organizationId: string | null, applicationId: string | null): Promise<IamUser | null>;
1046
+ /** Finds every user across scopes for a given OIDC identity — e.g. the orgs it can access. */
1047
+ findAllByOidcIdentity(oidcSubject: string, oidcConfigId: string): Promise<IamUser[]>;
1048
+ /** Creates a user and, if a password is provided, the matching credential. */
1040
1049
  createUser(user: IamUser, password: string | null): Promise<IamUser>;
1041
- /**
1042
- * Verifies the current password and updates it. Used when the user knows their current password.
1043
- * @param userId the id of the user whose password should be changed
1044
- * @param currentPassword the user's current password
1045
- * @param newPassword the new password to set
1046
- * @return {@link Promise} that resolves when the password has been updated
1047
- */
1048
- changePassword(userId: string, currentPassword: string, newPassword: string): Promise<void>;
1049
- /**
1050
- * Replaces the user's password without verifying the current one. Administrative reset.
1051
- * @param userId the id of the user whose password should be reset
1052
- * @param newPassword the new password to set
1053
- * @return {@link Promise} that resolves when the password has been reset
1054
- */
1055
- resetPassword(userId: string, newPassword: string): Promise<void>;
1056
- /**
1057
- * Finds the first user with the given email across all scope ids of the given scope type.
1058
- * Used by the sign-up flow to enforce one user per email at organization-creation time,
1059
- * before the new organization's scope id exists.
1060
- * @param email the email address to look up
1061
- * @param authScopeType the scope type to search within (e.g. {@code ORGANIZATION})
1062
- * @return {@link Promise} emitting the first matching user, or {@code null} if no user matches
1063
- */
1064
- findFirstByEmailInScopeType(email: string, authScopeType: string): Promise<IamUser | null>;
1065
1050
  }
1066
1051
  declare class IamUserService extends CrudServiceProxy8<IamUser> implements IIamUserService {
1067
1052
  constructor(kinotic: IKinotic11);
1068
- findByEmailAndScope(email: string, authScopeType: string, authScopeId: string): Promise<IamUser | null>;
1069
- findByScope(authScopeType: string, authScopeId: string, pageable: Pageable4): Promise<Page3<IamUser>>;
1053
+ findByEmail(email: string, organizationId?: string | null, applicationId?: string | null): Promise<IamUser | null>;
1054
+ findFirstOrgUserByEmail(email: string): Promise<IamUser | null>;
1055
+ findByOidcIdentity(oidcSubject: string, oidcConfigId: string, organizationId: string | null, applicationId: string | null): Promise<IamUser | null>;
1056
+ findAllByOidcIdentity(oidcSubject: string, oidcConfigId: string): Promise<IamUser[]>;
1070
1057
  createUser(user: IamUser, password: string | null): Promise<IamUser>;
1071
- changePassword(userId: string, currentPassword: string, newPassword: string): Promise<void>;
1072
- resetPassword(userId: string, newPassword: string): Promise<void>;
1073
- findFirstByEmailInScopeType(email: string, authScopeType: string): Promise<IamUser | null>;
1074
1058
  }
1075
1059
  import { IKinotic as IKinotic12 } from "@kinotic-ai/core";
1076
1060
  /**
@@ -1142,4 +1126,4 @@ declare const OsApiPlugin: KinoticPlugin<IOsApiExtension>;
1142
1126
  declare module "@kinotic-ai/core" {
1143
1127
  interface KinoticSingleton extends IOsApiExtension {}
1144
1128
  }
1145
- 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, AutoGeneratedIdDecorator, AuthType, ApplicationService, Application };
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 };
package/dist/index.d.ts CHANGED
@@ -261,7 +261,7 @@ declare class NamedQueriesDefinition implements Identifiable5<string> {
261
261
  projectId: string;
262
262
  entityDefinitionName: string;
263
263
  namedQueries: FunctionDefinition[];
264
- constructor(organizationId: string, id: string, applicationId: string, projectId: string, entityDefinitionName: string, namedQueries: FunctionDefinition[]);
264
+ constructor(id: string, organizationId: string, applicationId: string, projectId: string, entityDefinitionName: string, namedQueries: FunctionDefinition[]);
265
265
  }
266
266
  /**
267
267
  * Represents a migration definition that can be sent via the API.
@@ -533,12 +533,12 @@ declare enum AuthType {
533
533
  }
534
534
  import { Identifiable as Identifiable8 } from "@kinotic-ai/core";
535
535
  /**
536
- * Represents an authenticated identity at any scope layer in the IAM system.
537
- * Each user is scoped to exactly one layer and is unique by email within that scope.
536
+ * Represents an authenticated identity in the IAM system. Scope is encoded structurally by
537
+ * which of {@link organizationId} / {@link applicationId} is set:
538
538
  *
539
- * - For SYSTEM and ORGANIZATION scopes, {@link tenantId} must be null.
540
- * - For APPLICATION scopes, {@link tenantId} is required and identifies the
541
- * client tenant the user belongs to within the application's data.
539
+ * - both null SYSTEM
540
+ * - {@link organizationId} only ORGANIZATION
541
+ * - both set APPLICATION, with {@link tenantId} identifying the end-user data slice
542
542
  */
543
543
  declare class IamUser implements Identifiable8<string> {
544
544
  id: string | null;
@@ -547,39 +547,42 @@ declare class IamUser implements Identifiable8<string> {
547
547
  authType: AuthType | null;
548
548
  oidcSubject: string | null;
549
549
  oidcConfigId: string | null;
550
- authScopeType: string;
551
- authScopeId: string;
550
+ organizationId: string | null;
551
+ applicationId: string | null;
552
552
  tenantId: string | null;
553
553
  enabled: boolean;
554
554
  created: number | null;
555
555
  updated: number | null;
556
556
  }
557
557
  /**
558
- * Sent to the server to initiate an organization sign-up.
559
- * The user provides {@link orgName}, {@link orgDescription}, {@link email}, and
560
- * {@link displayName}. The remaining fields ({@link id}, {@link verificationToken},
561
- * {@link expiresAt}, {@link created}) are populated by the server before the record
562
- * is persisted.
558
+ * Sent to {@code POST /api/signup} to start an email/password organization sign-up.
559
+ * Only the user's identity is collected up front; the organization name and password are
560
+ * provided after email verification (see {@link SignUpCompleteRequest}).
563
561
  */
564
562
  interface SignUpRequest {
565
- id?: string | null;
566
- verificationToken?: string | null;
567
- expiresAt?: number | null;
568
- created?: number | null;
569
- orgName: string;
570
- orgDescription?: string | null;
571
563
  email: string;
572
564
  displayName: string;
573
565
  }
574
566
  /**
575
- * Sent to the server to complete an organization sign-up after email verification.
576
- * The {@link token} comes from the verification email link; the {@link password}
577
- * is what the user enters on the "set your password" form.
567
+ * Sent to {@code POST /api/signup/complete} after the user clicks the verification link.
568
+ * The {@link token} comes from that link; {@link orgName} (with optional {@link orgDescription})
569
+ * names the organization to create, and {@link password} is the chosen account password.
578
570
  */
579
571
  interface SignUpCompleteRequest {
580
572
  token: string;
573
+ orgName: string;
574
+ orgDescription?: string | null;
581
575
  password: string;
582
576
  }
577
+ /**
578
+ * Sent to {@code POST /api/signup/complete-org} to finish an OIDC sign-up by naming the
579
+ * organization to create. The verified identity is held server-side, keyed by {@link token}.
580
+ */
581
+ interface CompleteOrgRequest {
582
+ token: string;
583
+ orgName: string;
584
+ orgDescription?: string | null;
585
+ }
583
586
  import { Identifiable as Identifiable9 } from "@kinotic-ai/core";
584
587
  /**
585
588
  * Persisted record of one GitHub App installation that a Kinotic Org has authorised.
@@ -1012,65 +1015,46 @@ declare class WorkloadServiceProxy extends CrudServiceProxy7<Workload> implement
1012
1015
  countForNode(nodeId: string): Promise<number>;
1013
1016
  syncIndex(): Promise<void>;
1014
1017
  }
1015
- import { CrudServiceProxy as CrudServiceProxy8, IKinotic as IKinotic11, ICrudServiceProxy as ICrudServiceProxy8, Page as Page3, Pageable as Pageable4 } from "@kinotic-ai/core";
1018
+ import { CrudServiceProxy as CrudServiceProxy8, IKinotic as IKinotic11, ICrudServiceProxy as ICrudServiceProxy8 } from "@kinotic-ai/core";
1019
+ /**
1020
+ * Client proxy for the server's {@code IamUserService}; method shapes mirror the Java interface.
1021
+ *
1022
+ * NOTE: the server interface now lives in {@code kinotic-domain} and is not currently
1023
+ * {@code @Publish}-annotated, so this proxy is not callable over RPC until the backend publishes
1024
+ * the service. The shape here is kept in sync so it is ready once that happens; confirm the
1025
+ * published namespace before relying on it.
1026
+ */
1016
1027
  interface IIamUserService extends ICrudServiceProxy8<IamUser> {
1028
+ /** Finds the first user with the given email across all scopes, or null. */
1029
+ findByEmail(email: string): Promise<IamUser | null>;
1017
1030
  /**
1018
- * Finds the user with the given email within the given auth scope.
1019
- * @param email the email address to look up
1020
- * @param authScopeType the scope type the user is registered against (e.g. {@code SYSTEM}, {@code ORGANIZATION}, {@code APPLICATION})
1021
- * @param authScopeId the id of the scope the user is registered against
1022
- * @return {@link Promise} emitting the matching user, or {@code null} if no user matches
1031
+ * Finds the user with the given email within a scope identified structurally by
1032
+ * (organizationId, applicationId): both null SYSTEM, organizationId only → ORGANIZATION,
1033
+ * both set APPLICATION.
1023
1034
  */
1024
- findByEmailAndScope(email: string, authScopeType: string, authScopeId: string): Promise<IamUser | null>;
1035
+ findByEmail(email: string, organizationId: string | null, applicationId: string | null): Promise<IamUser | null>;
1025
1036
  /**
1026
- * Finds all users registered against the given auth scope.
1027
- * @param authScopeType the scope type to filter by (e.g. {@code SYSTEM}, {@code ORGANIZATION}, {@code APPLICATION})
1028
- * @param authScopeId the id of the scope to filter by
1029
- * @param pageable the paging and sort options
1030
- * @return {@link Promise} emitting a page of users registered against the scope
1037
+ * Finds the first ORGANIZATION-scope user with the given email across all organizations.
1038
+ * Used by sign-up to enforce one user per email before the new org's id exists.
1031
1039
  */
1032
- findByScope(authScopeType: string, authScopeId: string, pageable: Pageable4): Promise<Page3<IamUser>>;
1040
+ findFirstOrgUserByEmail(email: string): Promise<IamUser | null>;
1033
1041
  /**
1034
- * Creates a user and, if a password is provided, the matching credential.
1035
- * {@code APPLICATION}-scoped users must carry a {@code tenantId}; {@code SYSTEM} and {@code ORGANIZATION} users must not.
1036
- * @param user the user to create
1037
- * @param password the password to set, or {@code null} to create the user without a credential
1038
- * @return {@link Promise} emitting the persisted user
1042
+ * Finds the user (if any) with the given OIDC identity within a specific scope, using the
1043
+ * same (organizationId, applicationId) null conventions as {@link findByEmail}.
1039
1044
  */
1045
+ findByOidcIdentity(oidcSubject: string, oidcConfigId: string, organizationId: string | null, applicationId: string | null): Promise<IamUser | null>;
1046
+ /** Finds every user across scopes for a given OIDC identity — e.g. the orgs it can access. */
1047
+ findAllByOidcIdentity(oidcSubject: string, oidcConfigId: string): Promise<IamUser[]>;
1048
+ /** Creates a user and, if a password is provided, the matching credential. */
1040
1049
  createUser(user: IamUser, password: string | null): Promise<IamUser>;
1041
- /**
1042
- * Verifies the current password and updates it. Used when the user knows their current password.
1043
- * @param userId the id of the user whose password should be changed
1044
- * @param currentPassword the user's current password
1045
- * @param newPassword the new password to set
1046
- * @return {@link Promise} that resolves when the password has been updated
1047
- */
1048
- changePassword(userId: string, currentPassword: string, newPassword: string): Promise<void>;
1049
- /**
1050
- * Replaces the user's password without verifying the current one. Administrative reset.
1051
- * @param userId the id of the user whose password should be reset
1052
- * @param newPassword the new password to set
1053
- * @return {@link Promise} that resolves when the password has been reset
1054
- */
1055
- resetPassword(userId: string, newPassword: string): Promise<void>;
1056
- /**
1057
- * Finds the first user with the given email across all scope ids of the given scope type.
1058
- * Used by the sign-up flow to enforce one user per email at organization-creation time,
1059
- * before the new organization's scope id exists.
1060
- * @param email the email address to look up
1061
- * @param authScopeType the scope type to search within (e.g. {@code ORGANIZATION})
1062
- * @return {@link Promise} emitting the first matching user, or {@code null} if no user matches
1063
- */
1064
- findFirstByEmailInScopeType(email: string, authScopeType: string): Promise<IamUser | null>;
1065
1050
  }
1066
1051
  declare class IamUserService extends CrudServiceProxy8<IamUser> implements IIamUserService {
1067
1052
  constructor(kinotic: IKinotic11);
1068
- findByEmailAndScope(email: string, authScopeType: string, authScopeId: string): Promise<IamUser | null>;
1069
- findByScope(authScopeType: string, authScopeId: string, pageable: Pageable4): Promise<Page3<IamUser>>;
1053
+ findByEmail(email: string, organizationId?: string | null, applicationId?: string | null): Promise<IamUser | null>;
1054
+ findFirstOrgUserByEmail(email: string): Promise<IamUser | null>;
1055
+ findByOidcIdentity(oidcSubject: string, oidcConfigId: string, organizationId: string | null, applicationId: string | null): Promise<IamUser | null>;
1056
+ findAllByOidcIdentity(oidcSubject: string, oidcConfigId: string): Promise<IamUser[]>;
1070
1057
  createUser(user: IamUser, password: string | null): Promise<IamUser>;
1071
- changePassword(userId: string, currentPassword: string, newPassword: string): Promise<void>;
1072
- resetPassword(userId: string, newPassword: string): Promise<void>;
1073
- findFirstByEmailInScopeType(email: string, authScopeType: string): Promise<IamUser | null>;
1074
1058
  }
1075
1059
  import { IKinotic as IKinotic12 } from "@kinotic-ai/core";
1076
1060
  /**
@@ -1142,4 +1126,4 @@ declare const OsApiPlugin: KinoticPlugin<IOsApiExtension>;
1142
1126
  declare module "@kinotic-ai/core" {
1143
1127
  interface KinoticSingleton extends IOsApiExtension {}
1144
1128
  }
1145
- 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, AutoGeneratedIdDecorator, AuthType, ApplicationService, Application };
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 };
package/dist/index.js CHANGED
@@ -249,7 +249,7 @@ class NamedQueriesDefinition {
249
249
  projectId;
250
250
  entityDefinitionName;
251
251
  namedQueries;
252
- constructor(organizationId, id, applicationId, projectId, entityDefinitionName, namedQueries) {
252
+ constructor(id, organizationId, applicationId, projectId, entityDefinitionName, namedQueries) {
253
253
  this.id = id;
254
254
  this.organizationId = organizationId;
255
255
  this.applicationId = applicationId;
@@ -349,8 +349,8 @@ class IamUser {
349
349
  authType = null;
350
350
  oidcSubject = null;
351
351
  oidcConfigId = null;
352
- authScopeType = "";
353
- authScopeId = "";
352
+ organizationId = null;
353
+ applicationId = null;
354
354
  tenantId = null;
355
355
  enabled = true;
356
356
  created = null;
@@ -614,25 +614,22 @@ import { CrudServiceProxy as CrudServiceProxy8 } from "@kinotic-ai/core";
614
614
 
615
615
  class IamUserService extends CrudServiceProxy8 {
616
616
  constructor(kinotic) {
617
- super(kinotic.serviceProxy("org.kinotic.os.api.services.iam.IamUserService"));
617
+ super(kinotic.serviceProxy("org.kinotic.domain.api.services.iam.IamUserService"));
618
618
  }
619
- findByEmailAndScope(email, authScopeType, authScopeId) {
620
- return this.serviceProxy.invoke("findByEmailAndScope", [email, authScopeType, authScopeId]);
619
+ findByEmail(email, organizationId, applicationId) {
620
+ return arguments.length >= 3 ? this.serviceProxy.invoke("findByEmail", [email, organizationId, applicationId]) : this.serviceProxy.invoke("findByEmail", [email]);
621
621
  }
622
- findByScope(authScopeType, authScopeId, pageable) {
623
- return this.serviceProxy.invoke("findByScope", [authScopeType, authScopeId, pageable]);
622
+ findFirstOrgUserByEmail(email) {
623
+ return this.serviceProxy.invoke("findFirstOrgUserByEmail", [email]);
624
624
  }
625
- createUser(user, password) {
626
- return this.serviceProxy.invoke("createUser", [user, password]);
627
- }
628
- changePassword(userId, currentPassword, newPassword) {
629
- return this.serviceProxy.invoke("changePassword", [userId, currentPassword, newPassword]);
625
+ findByOidcIdentity(oidcSubject, oidcConfigId, organizationId, applicationId) {
626
+ return this.serviceProxy.invoke("findByOidcIdentity", [oidcSubject, oidcConfigId, organizationId, applicationId]);
630
627
  }
631
- resetPassword(userId, newPassword) {
632
- return this.serviceProxy.invoke("resetPassword", [userId, newPassword]);
628
+ findAllByOidcIdentity(oidcSubject, oidcConfigId) {
629
+ return this.serviceProxy.invoke("findAllByOidcIdentity", [oidcSubject, oidcConfigId]);
633
630
  }
634
- findFirstByEmailInScopeType(email, authScopeType) {
635
- return this.serviceProxy.invoke("findFirstByEmailInScopeType", [email, authScopeType]);
631
+ createUser(user, password) {
632
+ return this.serviceProxy.invoke("createUser", [user, password]);
636
633
  }
637
634
  }
638
635
  // packages/os-api/src/api/services/IDeviceApprovalService.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kinotic-ai/os-api",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -33,11 +33,11 @@
33
33
  "ui-test": "vitest --ui --coverage.enabled=true --mode development"
34
34
  },
35
35
  "peerDependencies": {
36
- "@kinotic-ai/core": ">=1.2.0"
36
+ "@kinotic-ai/core": ">=1.4.0"
37
37
  },
38
38
  "dependencies": {
39
39
  "@kinotic-ai/idl": "1.0.9",
40
- "@kinotic-ai/persistence": "1.2.1",
40
+ "@kinotic-ai/persistence": "1.3.0",
41
41
  "rxjs": "^7.8.2"
42
42
  },
43
43
  "devDependencies": {