@komune-io/im-user-domain 0.21.0-alpha.252d165 → 0.21.0-alpha.2fffa5b

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.
@@ -588,16 +588,6 @@ export declare namespace io.komune.im.f2.organization.domain.query {
588
588
 
589
589
  }
590
590
  }
591
- export declare namespace io.komune.im.f2.user.domain.command {
592
- interface UserConfigureMFACommandDTO extends f2.dsl.cqrs.Command {
593
- readonly id: string;
594
-
595
- }
596
- interface UserConfiguredMFAEventDTO extends f2.dsl.cqrs.Event {
597
- readonly id: string;
598
-
599
- }
600
- }
601
591
  export declare namespace io.komune.im.f2.user.domain.command {
602
592
  interface UserCreateCommandDTO extends f2.dsl.cqrs.Command {
603
593
  readonly email: string;
@@ -643,6 +633,16 @@ export declare namespace io.komune.im.f2.user.domain.command {
643
633
 
644
634
  }
645
635
  }
636
+ export declare namespace io.komune.im.f2.user.domain.command {
637
+ interface UserDisableMfaCommandDTO extends f2.dsl.cqrs.Command {
638
+ readonly id: string;
639
+
640
+ }
641
+ interface UserDisabledMfaEventDTO extends f2.dsl.cqrs.Event {
642
+ readonly id: string;
643
+
644
+ }
645
+ }
646
646
  export declare namespace io.komune.im.f2.user.domain.command {
647
647
  interface UserResetPasswordCommandDTO extends f2.dsl.cqrs.Command {
648
648
  readonly id: string;
@@ -719,6 +719,8 @@ export declare namespace io.komune.im.f2.user.domain.policies {
719
719
  checkRefList(authedUser: io.komune.im.commons.auth.AuthedUserDTO): boolean;
720
720
  canCreate(authedUser: io.komune.im.commons.auth.AuthedUserDTO, organizationId?: string): boolean;
721
721
  canUpdate(authedUser: io.komune.im.commons.auth.AuthedUserDTO, user: io.komune.im.f2.user.domain.model.UserDTO): boolean;
722
+ canConfigureMfa(authedUser: io.komune.im.commons.auth.AuthedUserDTO, user: io.komune.im.f2.user.domain.model.UserDTO): boolean;
723
+ canDisableMfa(authedUser: io.komune.im.commons.auth.AuthedUserDTO, user: io.komune.im.f2.user.domain.model.UserDTO): boolean;
722
724
  canUpdateMemberOf(authedUser: io.komune.im.commons.auth.AuthedUserDTO): boolean;
723
725
  canUpdateRole(authedUser: io.komune.im.commons.auth.AuthedUserDTO): boolean;
724
726
  canDisable(authedUser: io.komune.im.commons.auth.AuthedUserDTO, user: io.komune.im.f2.user.domain.model.UserDTO): boolean;
@@ -80,21 +80,21 @@ if (typeof Math.imul === 'undefined') {
80
80
  setMetadataFor(AbstractMutableCollection, 'AbstractMutableCollection', classMeta, AbstractCollection, [AbstractCollection, Collection]);
81
81
  setMetadataFor(IteratorImpl, 'IteratorImpl', classMeta);
82
82
  setMetadataFor(List, 'List', interfaceMeta, VOID, [Collection]);
83
- setMetadataFor(AbstractMutableList, 'AbstractMutableList', classMeta, AbstractMutableCollection, [AbstractMutableCollection, Collection, List]);
83
+ setMetadataFor(AbstractMutableList, 'AbstractMutableList', classMeta, AbstractMutableCollection, [AbstractMutableCollection, List, Collection]);
84
84
  setMetadataFor(Map_0, 'Map', interfaceMeta);
85
85
  setMetadataFor(AbstractMap, 'AbstractMap', classMeta, VOID, [Map_0]);
86
86
  setMetadataFor(AbstractMutableMap, 'AbstractMutableMap', classMeta, AbstractMap, [AbstractMap, Map_0]);
87
87
  setMetadataFor(Set, 'Set', interfaceMeta, VOID, [Collection]);
88
- setMetadataFor(AbstractMutableSet, 'AbstractMutableSet', classMeta, AbstractMutableCollection, [AbstractMutableCollection, Collection, Set]);
88
+ setMetadataFor(AbstractMutableSet, 'AbstractMutableSet', classMeta, AbstractMutableCollection, [AbstractMutableCollection, Set, Collection]);
89
89
  setMetadataFor(Companion, 'Companion', objectMeta);
90
- setMetadataFor(ArrayList, 'ArrayList', classMeta, AbstractMutableList, [AbstractMutableList, Collection, List], ArrayList_init_$Create$);
90
+ setMetadataFor(ArrayList, 'ArrayList', classMeta, AbstractMutableList, [AbstractMutableList, List, Collection], ArrayList_init_$Create$);
91
91
  setMetadataFor(HashMap, 'HashMap', classMeta, AbstractMutableMap, [AbstractMutableMap, Map_0], HashMap_init_$Create$);
92
- setMetadataFor(HashMapKeys, 'HashMapKeys', classMeta, AbstractMutableSet, [Collection, Set, AbstractMutableSet]);
93
- setMetadataFor(HashMapEntrySetBase, 'HashMapEntrySetBase', classMeta, AbstractMutableSet, [Collection, Set, AbstractMutableSet]);
92
+ setMetadataFor(HashMapKeys, 'HashMapKeys', classMeta, AbstractMutableSet, [Set, Collection, AbstractMutableSet]);
93
+ setMetadataFor(HashMapEntrySetBase, 'HashMapEntrySetBase', classMeta, AbstractMutableSet, [Set, Collection, AbstractMutableSet]);
94
94
  setMetadataFor(HashMapEntrySet, 'HashMapEntrySet', classMeta, HashMapEntrySetBase);
95
95
  setMetadataFor(HashMapKeysDefault$iterator$1, VOID, classMeta);
96
96
  setMetadataFor(HashMapKeysDefault, 'HashMapKeysDefault', classMeta, AbstractMutableSet);
97
- setMetadataFor(HashSet, 'HashSet', classMeta, AbstractMutableSet, [AbstractMutableSet, Collection, Set], HashSet_init_$Create$);
97
+ setMetadataFor(HashSet, 'HashSet', classMeta, AbstractMutableSet, [AbstractMutableSet, Set, Collection], HashSet_init_$Create$);
98
98
  setMetadataFor(Companion_0, 'Companion', objectMeta);
99
99
  setMetadataFor(Itr, 'Itr', classMeta);
100
100
  setMetadataFor(KeysItr, 'KeysItr', classMeta, Itr);
@@ -140,7 +140,7 @@ if (typeof Math.imul === 'undefined') {
140
140
  setMetadataFor(InternalMap, 'InternalMap', interfaceMeta);
141
141
  setMetadataFor(InternalHashMap, 'InternalHashMap', classMeta, VOID, [InternalMap], InternalHashMap_init_$Create$);
142
142
  setMetadataFor(LinkedHashMap, 'LinkedHashMap', classMeta, HashMap, [HashMap, Map_0], LinkedHashMap_init_$Create$);
143
- setMetadataFor(LinkedHashSet, 'LinkedHashSet', classMeta, HashSet, [HashSet, Collection, Set], LinkedHashSet_init_$Create$);
143
+ setMetadataFor(LinkedHashSet, 'LinkedHashSet', classMeta, HashSet, [HashSet, Set, Collection], LinkedHashSet_init_$Create$);
144
144
  setMetadataFor(Exception, 'Exception', classMeta, Error, VOID, Exception_init_$Create$);
145
145
  setMetadataFor(RuntimeException, 'RuntimeException', classMeta, Exception, VOID, RuntimeException_init_$Create$);
146
146
  setMetadataFor(IllegalStateException, 'IllegalStateException', classMeta, RuntimeException, VOID, IllegalStateException_init_$Create$);
@@ -383,7 +383,7 @@ if (typeof Math.imul === 'undefined') {
383
383
  setMetadataFor(Symbol_0, 'Symbol', classMeta);
384
384
  setMetadataFor(SetTimeoutBasedDispatcher, 'SetTimeoutBasedDispatcher', classMeta, CoroutineDispatcher, VOID, VOID, VOID, VOID, [1]);
385
385
  setMetadataFor(NodeDispatcher, 'NodeDispatcher', objectMeta, SetTimeoutBasedDispatcher, VOID, VOID, VOID, VOID, [1]);
386
- setMetadataFor(MessageQueue, 'MessageQueue', classMeta, VOID, [Collection, List]);
386
+ setMetadataFor(MessageQueue, 'MessageQueue', classMeta, VOID, [List, Collection]);
387
387
  setMetadataFor(ScheduledMessageQueue, 'ScheduledMessageQueue', classMeta, MessageQueue);
388
388
  setMetadataFor(WindowMessageQueue, 'WindowMessageQueue', classMeta, MessageQueue);
389
389
  setMetadataFor(Dispatchers, 'Dispatchers', objectMeta);
@@ -530,14 +530,14 @@ if (typeof Math.imul === 'undefined') {
530
530
  setMetadataFor(OrganizationRefGetResultDTO, 'OrganizationRefGetResultDTO', interfaceMeta, VOID, [Event]);
531
531
  setMetadataFor(OrganizationRefListQueryDTO, 'OrganizationRefListQueryDTO', interfaceMeta, VOID, [Query]);
532
532
  setMetadataFor(OrganizationRefListResultDTO, 'OrganizationRefListResultDTO', interfaceMeta, VOID, [Event]);
533
- setMetadataFor(UserConfigureMFACommandDTO, 'UserConfigureMFACommandDTO', interfaceMeta, VOID, [Command]);
534
- setMetadataFor(UserConfiguredMFAEventDTO, 'UserConfiguredMFAEventDTO', interfaceMeta, VOID, [Event]);
535
533
  setMetadataFor(UserCreateCommandDTO, 'UserCreateCommandDTO', interfaceMeta, VOID, [Command]);
536
534
  setMetadataFor(UserCreatedEventDTO, 'UserCreatedEventDTO', interfaceMeta, VOID, [Event]);
537
535
  setMetadataFor(UserDeleteCommandDTO_0, 'UserDeleteCommandDTO', interfaceMeta, VOID, [UserDeleteCommandDTO, Command]);
538
536
  setMetadataFor(UserDeletedEventDTO_0, 'UserDeletedEventDTO', interfaceMeta, VOID, [UserDeletedEventDTO, Event]);
539
537
  setMetadataFor(UserDisableCommandDTO, 'UserDisableCommandDTO', interfaceMeta, VOID, [Command]);
540
538
  setMetadataFor(UserDisabledEventDTO, 'UserDisabledEventDTO', interfaceMeta, VOID, [Event]);
539
+ setMetadataFor(UserDisableMfaCommandDTO, 'UserDisableMfaCommandDTO', interfaceMeta, VOID, [Command]);
540
+ setMetadataFor(UserDisabledMfaEventDTO, 'UserDisabledMfaventDTO', interfaceMeta, VOID, [Event]);
541
541
  setMetadataFor(UserResetPasswordCommandDTO, 'UserResetPasswordCommandDTO', interfaceMeta, VOID, [Command]);
542
542
  setMetadataFor(UserResetPasswordEventDTO, 'UserResetPasswordEventDTO', interfaceMeta, VOID, [Event]);
543
543
  setMetadataFor(UserUpdateCommandDTO, 'UserUpdateCommandDTO', interfaceMeta, VOID, [Command]);
@@ -12305,10 +12305,6 @@ if (typeof Math.imul === 'undefined') {
12305
12305
  }
12306
12306
  function OrganizationRefListResultDTO() {
12307
12307
  }
12308
- function UserConfigureMFACommandDTO() {
12309
- }
12310
- function UserConfiguredMFAEventDTO() {
12311
- }
12312
12308
  function UserCreateCommandDTO() {
12313
12309
  }
12314
12310
  function UserCreatedEventDTO() {
@@ -12321,6 +12317,10 @@ if (typeof Math.imul === 'undefined') {
12321
12317
  }
12322
12318
  function UserDisabledEventDTO() {
12323
12319
  }
12320
+ function UserDisableMfaCommandDTO() {
12321
+ }
12322
+ function UserDisabledMfaEventDTO() {
12323
+ }
12324
12324
  function UserResetPasswordCommandDTO() {
12325
12325
  }
12326
12326
  function UserResetPasswordEventDTO() {
@@ -12393,6 +12393,12 @@ if (typeof Math.imul === 'undefined') {
12393
12393
  protoOf(UserPolicies).canUpdate = function (authedUser, user) {
12394
12394
  return canWriteUser(this, authedUser, user);
12395
12395
  };
12396
+ protoOf(UserPolicies).canConfigureMfa = function (authedUser, user) {
12397
+ return isMySelf(this, authedUser, user);
12398
+ };
12399
+ protoOf(UserPolicies).canDisableMfa = function (authedUser, user) {
12400
+ return isMySelf(this, authedUser, user);
12401
+ };
12396
12402
  protoOf(UserPolicies).canUpdateMemberOf = function (authedUser) {
12397
12403
  return hasRole(authedUser, ImRole_IM_ORGANIZATION_WRITE_getInstance());
12398
12404
  };