@anzusystems/common-admin 1.47.0-beta.dev-1789936376 → 1.47.0-beta.dev-1790143991

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/labs.d.ts CHANGED
@@ -8,12 +8,17 @@ import { DefineComponent } from 'vue';
8
8
  import { InjectionKey } from 'vue';
9
9
  import { MaybeRefOrGetter } from 'vue';
10
10
  import { Method } from 'axios';
11
+ import { Promisify } from '@vueuse/shared';
11
12
  import { PublicProps } from 'vue';
12
13
  import { Ref } from 'vue';
13
14
  import { RouteLocationRaw } from 'vue-router';
15
+ import { SetupStoreDefinition } from 'pinia';
14
16
  import { ShallowRef } from 'vue';
15
17
  import { ShallowUnwrapRef } from 'vue';
16
18
  import { UseDebounceFnReturn } from '@vueuse/shared';
19
+ import { Validation } from '@vuelidate/core';
20
+ import { ValidationRuleWithoutParams } from '@vuelidate/core';
21
+ import { ValidationRuleWithParams } from '@vuelidate/core';
17
22
  import { VNode } from 'vue';
18
23
 
19
24
  declare const __VLS_base: DefineComponent<__VLS_PublicProps, {
@@ -23,12 +28,12 @@ declare const __VLS_base: DefineComponent<__VLS_PublicProps, {
23
28
  "update:datatableHiddenColumns": (value: string[] | undefined) => any;
24
29
  "update:showDetail": (value: boolean) => any;
25
30
  } & {
26
- reset: () => any;
27
31
  submit: () => any;
32
+ reset: () => any;
28
33
  bookmarkLoadAfter: () => any;
29
34
  }, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
30
- onReset?: (() => any) | undefined;
31
35
  onSubmit?: (() => any) | undefined;
36
+ onReset?: (() => any) | undefined;
32
37
  "onUpdate:datatableHiddenColumns"?: ((value: string[] | undefined) => any) | undefined;
33
38
  onBookmarkLoadAfter?: (() => any) | undefined;
34
39
  "onUpdate:showDetail"?: ((value: boolean) => any) | undefined;
@@ -43,6 +48,52 @@ declare const __VLS_base: DefineComponent<__VLS_PublicProps, {
43
48
  hideMore: boolean;
44
49
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
45
50
 
51
+ declare const __VLS_base_10: DefineComponent<__VLS_PublicProps_9, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
52
+ "update:user": (value: AnzuUser) => any;
53
+ }, string, PublicProps, Readonly<__VLS_PublicProps_9> & Readonly<{
54
+ "onUpdate:user"?: ((value: AnzuUser) => any) | undefined;
55
+ }>, {
56
+ readonly: boolean;
57
+ isEdit: boolean;
58
+ randomColor: boolean;
59
+ permissionGroupEndPoint: string;
60
+ idInput: boolean;
61
+ requiredMetadata: boolean;
62
+ enabledNote: string;
63
+ metadataNote: string;
64
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
65
+
66
+ declare const __VLS_base_11: DefineComponent<__VLS_PublicProps_11, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
67
+ "update:user": (value: AnzuUser) => any;
68
+ }, string, PublicProps, Readonly<__VLS_PublicProps_11> & Readonly<{
69
+ "onUpdate:user"?: ((value: AnzuUser) => any) | undefined;
70
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
71
+
72
+ declare const __VLS_base_12: DefineComponent<__VLS_PublicProps_12, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
73
+ "update:modelValue": (value: boolean) => any;
74
+ }, string, PublicProps, Readonly<__VLS_PublicProps_12> & Readonly<{
75
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
76
+ }>, {
77
+ note: string;
78
+ readonly: boolean;
79
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
80
+
81
+ declare const __VLS_base_13: DefineComponent<__VLS_PublicProps_14, {
82
+ refresh: () => void;
83
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
84
+ "update:activeTab": (value: string) => any;
85
+ } & {
86
+ created: (descriptor: AnyUserSystemDescriptor) => any;
87
+ }, string, PublicProps, Readonly<__VLS_PublicProps_14> & Readonly<{
88
+ onCreated?: ((descriptor: AnyUserSystemDescriptor) => any) | undefined;
89
+ "onUpdate:activeTab"?: ((value: string) => any) | undefined;
90
+ }>, {
91
+ unsavedChanges: boolean;
92
+ readonly: boolean;
93
+ refreshHook: UserSystemRefreshHook;
94
+ tabQueryKey: string;
95
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
96
+
46
97
  declare const __VLS_base_2: DefineComponent<__VLS_Props_2, {
47
98
  resetFilter: () => void;
48
99
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
@@ -59,12 +110,12 @@ declare const __VLS_base_3: DefineComponent<__VLS_PublicProps_2, {
59
110
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
60
111
  "update:datatableHiddenColumns": (value: string[] | undefined) => any;
61
112
  } & {
62
- reset: () => any;
63
113
  submit: () => any;
114
+ reset: () => any;
64
115
  bookmarkLoadAfter: () => any;
65
116
  }, string, PublicProps, Readonly<__VLS_PublicProps_2> & Readonly<{
66
- onReset?: (() => any) | undefined;
67
117
  onSubmit?: (() => any) | undefined;
118
+ onReset?: (() => any) | undefined;
68
119
  "onUpdate:datatableHiddenColumns"?: ((value: string[] | undefined) => any) | undefined;
69
120
  onBookmarkLoadAfter?: (() => any) | undefined;
70
121
  }>, {
@@ -108,9 +159,9 @@ declare const __VLS_base_5: DefineComponent<__VLS_PublicProps_4, {}, {}, {}, {},
108
159
  "onUpdate:loadingLocal"?: ((value: boolean) => any) | undefined;
109
160
  "onUpdate:fetchedItemsMinimal"?: ((value: Map<string | number, any>) => any) | undefined;
110
161
  }>, {
111
- required: boolean;
112
- label: string;
113
162
  loading: boolean;
163
+ label: string;
164
+ required: boolean;
114
165
  clearable: boolean;
115
166
  errorMessage: string;
116
167
  v: any;
@@ -127,6 +178,62 @@ declare const __VLS_base_5: DefineComponent<__VLS_PublicProps_4, {}, {}, {}, {},
127
178
  minSearchText: string;
128
179
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
129
180
 
181
+ declare const __VLS_base_6: DefineComponent<__VLS_Props_18, {
182
+ refresh: UseDebounceFnReturn<() => Promise<void>>;
183
+ resetFilter: () => void;
184
+ submitFilter: () => void;
185
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
186
+ rowClick: (permissionGroup: PermissionGroup) => any;
187
+ }, string, PublicProps, Readonly<__VLS_Props_18> & Readonly<{
188
+ onRowClick?: ((permissionGroup: PermissionGroup) => any) | undefined;
189
+ }>, {
190
+ entity: string;
191
+ endPoint: string;
192
+ canUpdate: boolean;
193
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
194
+
195
+ declare const __VLS_base_7: DefineComponent<__VLS_Props_19, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_19> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
196
+
197
+ declare const __VLS_base_8: DefineComponent<__VLS_Props_22, {
198
+ refresh: UseDebounceFnReturn<() => Promise<void>>;
199
+ resetFilter: () => void;
200
+ submitFilter: () => void;
201
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
202
+ rowClick: (user: AnzuUser) => any;
203
+ }, string, PublicProps, Readonly<__VLS_Props_22> & Readonly<{
204
+ onRowClick?: ((user: AnzuUser) => any) | undefined;
205
+ }>, {
206
+ entity: string;
207
+ endPoint: string;
208
+ canUpdate: boolean;
209
+ permissionGroupEndPoint: string;
210
+ systemColumns: Array<string | {
211
+ key: string;
212
+ title: string;
213
+ }>;
214
+ impersonate: (user: AnzuUser) => void;
215
+ canImpersonate: boolean;
216
+ filterFields: readonly MakeFilterOption[];
217
+ filterClient: () => AxiosInstance;
218
+ filterUserId: IntegerIdNullable;
219
+ filterStore: FilterStoreIdentifier;
220
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
221
+
222
+ declare const __VLS_base_9: DefineComponent<__VLS_PublicProps_8, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
223
+ "update:datatableHiddenColumns": (value: string[] | undefined) => any;
224
+ } & {
225
+ submit: () => any;
226
+ reset: () => any;
227
+ }, string, PublicProps, Readonly<__VLS_PublicProps_8> & Readonly<{
228
+ onSubmit?: (() => any) | undefined;
229
+ onReset?: (() => any) | undefined;
230
+ "onUpdate:datatableHiddenColumns"?: ((value: string[] | undefined) => any) | undefined;
231
+ }>, {
232
+ userId: IntegerIdNullable;
233
+ client: () => AxiosInstance;
234
+ store: FilterStoreIdentifier;
235
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
236
+
130
237
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
131
238
 
132
239
  declare const __VLS_export_10: DefineComponent<__VLS_Props_8, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
@@ -458,10 +565,163 @@ declare const __VLS_export_22: DefineComponent<__VLS_Props_15, {}, {}, {}, {}, C
458
565
 
459
566
  declare const __VLS_export_23: DefineComponent<__VLS_Props_16, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_16> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
460
567
 
568
+ declare const __VLS_export_24: DefineComponent<__VLS_PublicProps_6, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
569
+ "update:modelValue": (value: Permissions_2) => any;
570
+ }, string, PublicProps, Readonly<__VLS_PublicProps_6> & Readonly<{
571
+ "onUpdate:modelValue"?: ((value: Permissions_2) => any) | undefined;
572
+ }>, {
573
+ roles: string[];
574
+ resolvedPermissions: Permissions_2;
575
+ entity: string;
576
+ readonly: boolean;
577
+ endPoint: string;
578
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
579
+
580
+ declare const __VLS_export_25: __VLS_WithSlots_6<typeof __VLS_base_6, __VLS_Slots_6>;
581
+
582
+ declare const __VLS_export_26: __VLS_WithSlots_7<typeof __VLS_base_7, __VLS_Slots_7>;
583
+
584
+ declare const __VLS_export_27: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
585
+ submit: () => any;
586
+ reset: () => any;
587
+ }, string, PublicProps, Readonly<{}> & Readonly<{
588
+ onSubmit?: (() => any) | undefined;
589
+ onReset?: (() => any) | undefined;
590
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
591
+
592
+ declare const __VLS_export_28: DefineComponent<__VLS_Props_20, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_20> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
593
+
594
+ declare const __VLS_export_29: DefineComponent<__VLS_PublicProps_7, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
595
+ "update:modelValue": (value: number | number[] | null) => any;
596
+ }, string, PublicProps, Readonly<__VLS_PublicProps_7> & Readonly<{
597
+ "onUpdate:modelValue"?: ((value: number | number[] | null) => any) | undefined;
598
+ }>, {
599
+ label: string;
600
+ required: boolean;
601
+ dataCy: string;
602
+ entity: string;
603
+ clearable: boolean;
604
+ readonly: boolean;
605
+ multiple: boolean;
606
+ endPoint: string;
607
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
608
+
461
609
  declare const __VLS_export_3: __VLS_WithSlots_3<typeof __VLS_base_3, __VLS_Slots_3>;
462
610
 
611
+ declare const __VLS_export_30: __VLS_WithSlots_8<typeof __VLS_base_8, __VLS_Slots_8>;
612
+
613
+ declare const __VLS_export_31: __VLS_WithSlots_9<typeof __VLS_base_9, __VLS_Slots_9>;
614
+
615
+ declare const __VLS_export_32: __VLS_WithSlots_10<typeof __VLS_base_10, __VLS_Slots_10>;
616
+
617
+ declare const __VLS_export_33: DefineComponent<__VLS_PublicProps_10, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
618
+ "update:modelValue": (value: string[]) => any;
619
+ }, string, PublicProps, Readonly<__VLS_PublicProps_10> & Readonly<{
620
+ "onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
621
+ }>, {
622
+ entity: string;
623
+ readonly: boolean;
624
+ endPoint: string;
625
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
626
+
627
+ declare const __VLS_export_34: __VLS_WithSlots_11<typeof __VLS_base_11, __VLS_Slots_11>;
628
+
629
+ declare const __VLS_export_35: __VLS_WithSlots_12<typeof __VLS_base_12, __VLS_Slots_12>;
630
+
631
+ declare const __VLS_export_36: DefineComponent<__VLS_PublicProps_13, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
632
+ "update:user": (value: BaseUser) => any;
633
+ }, string, PublicProps, Readonly<__VLS_PublicProps_13> & Readonly<{
634
+ "onUpdate:user"?: ((value: BaseUser) => any) | undefined;
635
+ }>, {
636
+ note: string;
637
+ required: boolean;
638
+ readonly: boolean;
639
+ isEdit: boolean;
640
+ randomColor: boolean;
641
+ validationScope: string | false | symbol;
642
+ idInput: boolean;
643
+ scopeSystem: string;
644
+ scopeSubject: string;
645
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
646
+
647
+ declare const __VLS_export_37: DefineComponent<__VLS_Props_29, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_29> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
648
+
649
+ declare const __VLS_export_38: DefineComponent<__VLS_Props_30, {
650
+ refresh: () => Promise<void>;
651
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
652
+ create: (descriptor: AnyUserSystemDescriptor, user: BaseUser) => any;
653
+ }, string, PublicProps, Readonly<__VLS_Props_30> & Readonly<{
654
+ onCreate?: ((descriptor: AnyUserSystemDescriptor, user: BaseUser) => any) | undefined;
655
+ }>, {
656
+ source: BaseUser | null;
657
+ readonly: boolean;
658
+ createEnabled: boolean;
659
+ creating: boolean;
660
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
661
+
662
+ declare const __VLS_export_39: DefineComponent<__VLS_Props_31, {
663
+ refresh: () => void;
664
+ refreshSystem: (system: string) => void;
665
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
666
+ create: (descriptor: AnyUserSystemDescriptor, user: BaseUser) => any;
667
+ }, string, PublicProps, Readonly<__VLS_Props_31> & Readonly<{
668
+ onCreate?: ((descriptor: AnyUserSystemDescriptor, user: BaseUser) => any) | undefined;
669
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
670
+
463
671
  declare const __VLS_export_4: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
464
672
 
673
+ declare const __VLS_export_40: __VLS_WithSlots_13<typeof __VLS_base_13, __VLS_Slots_13>;
674
+
675
+ declare const __VLS_export_41: DefineComponent<__VLS_Props_33, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
676
+ confirm: (user: BaseUser) => any;
677
+ }, string, PublicProps, Readonly<__VLS_Props_33> & Readonly<{
678
+ onConfirm?: ((user: BaseUser) => any) | undefined;
679
+ }>, {
680
+ disabled: boolean;
681
+ userId: IntegerIdNullable;
682
+ willBeEnabled: boolean;
683
+ loading: boolean;
684
+ source: BaseUser | null;
685
+ requiredMetadata: boolean;
686
+ createNote: string;
687
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
688
+
689
+ declare const __VLS_export_42: DefineComponent<__VLS_Props_34, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_34> & Readonly<{}>, {
690
+ internalLabel: string;
691
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
692
+
693
+ declare const __VLS_export_43: DefineComponent<__VLS_Props_35, {
694
+ search: (value: string) => Promise<void>;
695
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
696
+ searched: (term: string) => any;
697
+ }, string, PublicProps, Readonly<__VLS_Props_35> & Readonly<{
698
+ onSearched?: ((term: string) => any) | undefined;
699
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
700
+
701
+ declare const __VLS_export_44: DefineComponent<__VLS_PublicProps_15, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
702
+ "update:open": (value: boolean) => any;
703
+ } & {
704
+ run: (systems: string[]) => any;
705
+ }, string, PublicProps, Readonly<__VLS_PublicProps_15> & Readonly<{
706
+ onRun?: ((systems: string[]) => any) | undefined;
707
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
708
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
709
+
710
+ declare const __VLS_export_45: DefineComponent<__VLS_PublicProps_16, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
711
+ "update:open": (value: boolean) => any;
712
+ } & {
713
+ confirm: (payload: {
714
+ target: BaseUser;
715
+ systems: string[];
716
+ }) => any;
717
+ }, string, PublicProps, Readonly<__VLS_PublicProps_16> & Readonly<{
718
+ onConfirm?: ((payload: {
719
+ target: BaseUser;
720
+ systems: string[];
721
+ }) => any) | undefined;
722
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
723
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
724
+
465
725
  declare const __VLS_export_5: DefineComponent<__VLS_Props_4, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
466
726
  change: () => any;
467
727
  }, string, PublicProps, Readonly<__VLS_Props_4> & Readonly<{
@@ -535,6 +795,34 @@ declare type __VLS_ModelProps = {
535
795
  'showDetail'?: boolean;
536
796
  };
537
797
 
798
+ declare type __VLS_ModelProps_10 = {
799
+ modelValue: string[];
800
+ };
801
+
802
+ declare type __VLS_ModelProps_11 = {
803
+ 'user': AnzuUser;
804
+ };
805
+
806
+ declare type __VLS_ModelProps_12 = {
807
+ modelValue: boolean;
808
+ };
809
+
810
+ declare type __VLS_ModelProps_13 = {
811
+ 'user': BaseUser;
812
+ };
813
+
814
+ declare type __VLS_ModelProps_14 = {
815
+ 'activeTab'?: string;
816
+ };
817
+
818
+ declare type __VLS_ModelProps_15 = {
819
+ 'open': boolean;
820
+ };
821
+
822
+ declare type __VLS_ModelProps_16 = {
823
+ 'open': boolean;
824
+ };
825
+
538
826
  declare type __VLS_ModelProps_2 = {
539
827
  'datatableHiddenColumns'?: string[] | undefined;
540
828
  };
@@ -553,6 +841,23 @@ declare type __VLS_ModelProps_5 = {
553
841
  modelValue: boolean;
554
842
  };
555
843
 
844
+ declare type __VLS_ModelProps_6 = {
845
+ modelValue: Permissions_2;
846
+ };
847
+
848
+ declare type __VLS_ModelProps_7 = {
849
+ modelValue: IntegerId | IntegerId[] | null;
850
+ };
851
+
852
+ declare type __VLS_ModelProps_8 = {
853
+ /** The column set a bookmark restores along with the filter values. */
854
+ 'datatableHiddenColumns'?: string[] | undefined;
855
+ };
856
+
857
+ declare type __VLS_ModelProps_9 = {
858
+ 'user': AnzuUser;
859
+ };
860
+
556
861
  declare type __VLS_PrettifyLocal<T> = (T extends any ? {
557
862
  [K in keyof T]: T[K];
558
863
  } : {
@@ -667,10 +972,251 @@ declare type __VLS_Props_16 = {
667
972
  logPaths: LogPaths;
668
973
  };
669
974
 
975
+ declare type __VLS_Props_17 = {
976
+ client: AxiosClientFn;
977
+ /** Which backend's permission vocabulary to draw. Never a global -- see `permissionConfigActions`. */
978
+ system: string;
979
+ entity?: string | undefined;
980
+ endPoint?: string | undefined;
981
+ /**
982
+ * The grants the subject already has from roles and groups. Undefined means "this model is a
983
+ * group, not a user": the origin column then reads every explicit grant as coming from the
984
+ * group itself rather than from the user.
985
+ */
986
+ resolvedPermissions?: Permissions_2 | undefined;
987
+ roles?: string[];
988
+ /** One component for detail and edit (decision 27). Readonly drops the grant column. */
989
+ readonly?: boolean;
990
+ };
991
+
992
+ declare type __VLS_Props_18 = {
993
+ client: AxiosClientFn;
994
+ /** Backend identity: keys the filter store and the cache, and reaches every api call. */
995
+ system: string;
996
+ entity?: string | undefined;
997
+ endPoint?: string | undefined;
998
+ /** Where a row and the detail button go. The library cannot know an app's typed route names. */
999
+ detailRoute: (permissionGroup: PermissionGroup) => RouteLocationRaw;
1000
+ editRoute: (permissionGroup: PermissionGroup) => RouteLocationRaw;
1001
+ /** Already-evaluated ACL. A boolean, not an `AclValue`: see 5.1 of the plan. */
1002
+ canUpdate?: boolean;
1003
+ };
1004
+
1005
+ declare type __VLS_Props_19 = {
1006
+ client: AxiosClientFn;
1007
+ system: string;
1008
+ /**
1009
+ * Where the grants editor reads the permission config -- `GET /adm/v1/permissions/config` when
1010
+ * left out, which every backend has.
1011
+ *
1012
+ * Named for what it is, and deliberately not `endPoint`: a page holding the permission-group
1013
+ * endpoint passed it here as `endPoint`, the editor fetched the group list as its config and
1014
+ * crashed -- and, the config store being keyed by system, left that system's user pages broken
1015
+ * until reload. A stray `end-point` now falls through as an attribute and changes nothing.
1016
+ */
1017
+ permissionConfigEndPoint?: string | undefined;
1018
+ };
1019
+
670
1020
  declare type __VLS_Props_2 = {
671
1021
  formName?: string;
672
1022
  };
673
1023
 
1024
+ declare type __VLS_Props_20 = {
1025
+ client: AxiosClientFn;
1026
+ /** Backend identity for the permission config fetch, not the i18n namespace below. */
1027
+ system: string;
1028
+ /**
1029
+ * Where the grants editor reads the permission config -- `GET /adm/v1/permissions/config` when
1030
+ * left out, which every backend has.
1031
+ *
1032
+ * Named for what it is, and deliberately not `endPoint`: a page holding the permission-group
1033
+ * endpoint passed it here as `endPoint`, the editor fetched the group list as its config and
1034
+ * crashed -- and, the config store being keyed by system, left that system's user pages broken
1035
+ * until reload. A stray `end-point` now falls through as an attribute and changes nothing.
1036
+ */
1037
+ permissionConfigEndPoint?: string | undefined;
1038
+ };
1039
+
1040
+ declare type __VLS_Props_21 = {
1041
+ client: AxiosClientFn;
1042
+ system: string;
1043
+ entity?: string | undefined;
1044
+ endPoint?: string | undefined;
1045
+ label?: string | undefined;
1046
+ required?: boolean | undefined;
1047
+ multiple?: boolean;
1048
+ clearable?: boolean;
1049
+ readonly?: boolean;
1050
+ dataCy?: string;
1051
+ };
1052
+
1053
+ declare type __VLS_Props_22 = {
1054
+ client: AxiosClientFn;
1055
+ system: string;
1056
+ entity?: string | undefined;
1057
+ endPoint?: string | undefined;
1058
+ detailRoute: (user: AnzuUser) => RouteLocationRaw;
1059
+ editRoute: (user: AnzuUser) => RouteLocationRaw;
1060
+ /** Already-evaluated ACL of the owning system. */
1061
+ canUpdate?: boolean;
1062
+ /** The permission-group endpoint, which is not the user one. */
1063
+ permissionGroupEndPoint?: string;
1064
+ /**
1065
+ * Extra columns the app draws through `#systemColumns`, appended after the shared ones.
1066
+ *
1067
+ * A bare key takes its header from the library's own `common.anzuUser.model.*`, which holds
1068
+ * eight keys and none of any system's -- so a system column passes its title already
1069
+ * translated, out of the namespace that has it.
1070
+ */
1071
+ systemColumns?: Array<string | {
1072
+ key: string;
1073
+ title: string;
1074
+ }>;
1075
+ /**
1076
+ * Signing in as somebody else, as a switchable feature.
1077
+ *
1078
+ * A callback rather than a path, because there is more than one mechanism: cms posts to
1079
+ * `/adm/users/{id}/impersonate` and gets a JWT with an impersonation claim, blog opens the
1080
+ * public site through `window.open`. Only the cms one reaches a shared component -- blog's
1081
+ * hangs off its product user, which is a different view -- so one prop is enough for now.
1082
+ * Left unset, nothing is drawn.
1083
+ */
1084
+ impersonate?: ((user: AnzuUser) => void) | undefined;
1085
+ canImpersonate?: boolean;
1086
+ /**
1087
+ * Filter fields this system adds to the shared three.
1088
+ *
1089
+ * A parameter and not part of the shared list, because the same filter is not the same query
1090
+ * everywhere: cms asks for permission groups with `memberOf`, dam with `custom`, and
1091
+ * `allowedSites` exists only in cms. A plain field needs nothing more -- the generic renderer
1092
+ * draws it -- while one that wants a remote autocomplete comes in through `#filter.<name>`.
1093
+ */
1094
+ filterFields?: readonly MakeFilterOption[];
1095
+ /**
1096
+ * Saved filters, which are stored per user, so both are needed for the button to appear. cms
1097
+ * and dam have them on the list this replaces; the other three admins do not.
1098
+ */
1099
+ filterClient?: (() => AxiosInstance) | undefined;
1100
+ filterUserId?: IntegerIdNullable | undefined;
1101
+ /** Where saved bookmarks are filed; see `AAnzuUserFilter`. */
1102
+ filterStore?: FilterStoreIdentifier | undefined;
1103
+ };
1104
+
1105
+ declare type __VLS_Props_23 = {
1106
+ /**
1107
+ * Both are what switches the bookmark UI on in `AFilterWrapper`, and both have to be there for
1108
+ * it to appear -- bookmarks are stored per user. Left unset, the filter is drawn without them,
1109
+ * which is what admin-inhouse, blog and forum have.
1110
+ */
1111
+ client?: (() => AxiosInstance) | undefined;
1112
+ userId?: IntegerIdNullable | undefined;
1113
+ /**
1114
+ * What the saved bookmarks are filed under on the server.
1115
+ *
1116
+ * Left unset it is the filter's own `common` / `anzuUser`. cms overrides it with the pair its
1117
+ * old list used, so the bookmarks operators already have keep showing up -- the field names are
1118
+ * the same, and a new key would simply orphan them.
1119
+ */
1120
+ store?: FilterStoreIdentifier | undefined;
1121
+ };
1122
+
1123
+ declare type __VLS_Props_24 = {
1124
+ client: AxiosClientFn;
1125
+ system: string;
1126
+ /**
1127
+ * The permission-group endpoint, which is not the user one.
1128
+ *
1129
+ * There is deliberately no `entity` prop here. `entity` names a *resource*, not a system, and
1130
+ * it is what a server validation failure is filed under -- so the group autocomplete, the role
1131
+ * list and the permission editor each use their own, and passing the user's down would file a
1132
+ * group's error under the user's labels.
1133
+ */
1134
+ permissionGroupEndPoint?: string;
1135
+ /**
1136
+ * One component for detail and edit (decision 27). Two parallel components drift: a field
1137
+ * added to the editable one and forgotten in the other is a silent divergence with nothing to
1138
+ * fail.
1139
+ */
1140
+ readonly?: boolean;
1141
+ isEdit?: boolean;
1142
+ /** From the system's descriptor. */
1143
+ requiredMetadata?: boolean;
1144
+ idInput?: boolean;
1145
+ randomColor?: boolean;
1146
+ enabledNote?: string | undefined;
1147
+ metadataNote?: string | undefined;
1148
+ };
1149
+
1150
+ declare type __VLS_Props_25 = {
1151
+ client: AxiosClientFn;
1152
+ /** Roles are per backend: they come from that system's `/adm/v1/permissions/config`. */
1153
+ system: string;
1154
+ entity?: string | undefined;
1155
+ endPoint?: string | undefined;
1156
+ readonly?: boolean;
1157
+ };
1158
+
1159
+ declare type __VLS_Props_26 = {
1160
+ /**
1161
+ * Reads the source account from the server. It is a prop because the shape of a user differs per
1162
+ * system -- cms answers `CmsUserDto`, dam `DamUserDto` -- and because the page already holds an
1163
+ * api instance pointed at the right backend.
1164
+ */
1165
+ fetchSourceUser: (id: number) => Promise<AnzuUser>;
1166
+ /**
1167
+ * Copies whatever the system keeps beyond roles, groups and grants. cms has nineteen such
1168
+ * fields; systems with none leave this out.
1169
+ */
1170
+ copySystemFields?: ((target: AnzuUser, source: AnzuUser) => void) | undefined;
1171
+ /** i18n keys listed in the dialog, so the operator sees exactly what will be overwritten. */
1172
+ copiedSettingKeys?: string[];
1173
+ };
1174
+
1175
+ declare type __VLS_Props_27 = {
1176
+ readonly?: boolean;
1177
+ /**
1178
+ * The system's `enabledNote`. A static string from the descriptor rather than a slot: a slot
1179
+ * would have to be filled by every admin separately, could drift from the wording in the bulk
1180
+ * dialog, and -- worst -- could be forgotten in admin-blog, which is the one place the sentence
1181
+ * matters most. The slot below stays as an escape hatch for more than a line of text.
1182
+ */
1183
+ note?: string | undefined;
1184
+ };
1185
+
1186
+ declare type __VLS_Props_28 = {
1187
+ /**
1188
+ * The system's validation profile (`requiredMetadata`). The cross-system repair form passes
1189
+ * `true` outright: it writes to nine places at once, and a loose form could put an empty name
1190
+ * into cms -- a record cms's own form would then refuse to save.
1191
+ */
1192
+ required?: boolean;
1193
+ /**
1194
+ * Whether the id is typed in at all. False only in cms, whose backend resolves it from SSO.
1195
+ * With `isEdit` this makes three states, which one `readonly` could not express: not drawn,
1196
+ * editable, or shown read-only.
1197
+ */
1198
+ idInput?: boolean;
1199
+ isEdit?: boolean;
1200
+ readonly?: boolean;
1201
+ /**
1202
+ * Random colour on an empty value, as all four admins do today. Deliberately not passed by the
1203
+ * cross-system repair form: it is always strict, so it would invent a colour on open and mark
1204
+ * it as a change in every system at once.
1205
+ */
1206
+ randomColor?: boolean;
1207
+ /** The system's `metadataNote` -- the same sentence the cross-system dialog shows. */
1208
+ note?: string | undefined;
1209
+ /** i18n namespace for the field labels; the backend identity does not belong here. */
1210
+ scopeSystem?: string;
1211
+ scopeSubject?: string;
1212
+ /** Vuelidate scope. Omitted means the page's own collector picks these rules up. */
1213
+ validationScope?: string | symbol | false | undefined;
1214
+ };
1215
+
1216
+ declare type __VLS_Props_29 = {
1217
+ axes: UserSystemAxes;
1218
+ };
1219
+
674
1220
  declare type __VLS_Props_3 = {
675
1221
  hideButtons?: boolean;
676
1222
  formName?: string;
@@ -680,6 +1226,125 @@ declare type __VLS_Props_3 = {
680
1226
  store?: FilterStoreIdentifier | boolean;
681
1227
  };
682
1228
 
1229
+ declare type __VLS_Props_30 = {
1230
+ descriptor: AnyUserSystemDescriptor;
1231
+ userId: IntegerId;
1232
+ /**
1233
+ * On a viewing page there is no Create. A write action on a read-only screen would be the first
1234
+ * in the fleet; Manage stays, because it only leads somewhere.
1235
+ */
1236
+ readonly?: boolean;
1237
+ /** Whether the account about to be created would be switched on. */
1238
+ createEnabled?: boolean;
1239
+ /** What the owning system holds, to prefill the create form. */
1240
+ source?: BaseUser | null;
1241
+ creating?: boolean;
1242
+ };
1243
+
1244
+ declare type __VLS_Props_31 = {
1245
+ descriptors: AnyUserSystemDescriptor[];
1246
+ userId: IntegerId;
1247
+ readonly?: boolean;
1248
+ /** Whether an account created from here would be switched on -- the dialog says so out loud. */
1249
+ createEnabled?: boolean;
1250
+ /** What the owning system holds, to prefill the create form. */
1251
+ source?: BaseUser | null;
1252
+ /** The system a create is currently running for. */
1253
+ creatingSystem?: string | null;
1254
+ };
1255
+
1256
+ declare type __VLS_Props_32 = {
1257
+ userId: IntegerId;
1258
+ /** Which tab carries the owning form, i.e. gets the slot. */
1259
+ owner: string;
1260
+ /**
1261
+ * The tabs, in the order they are drawn, plus "other systems" appended by this component.
1262
+ *
1263
+ * A prop and not something derived from the descriptor array, because the list depends on the
1264
+ * route rather than on what the admin owns: admin-inhouse owns four systems and has two tabs,
1265
+ * since the system is part of the path.
1266
+ */
1267
+ ownedTabs: string[];
1268
+ /** Every system this admin can reach. The "other systems" tab lists the ones not in a tab. */
1269
+ descriptors: AnyUserSystemDescriptor[];
1270
+ /**
1271
+ * "After a 401, refresh once and try again."
1272
+ *
1273
+ * The library cannot decide this for itself: the mechanism exists only in the apps, and each
1274
+ * one does it differently -- inhouse `refreshSession`, cms and contentHub their own
1275
+ * `refresh-token` call. Without it an expired token renders as "no account in this system",
1276
+ * which is the one confusion decision 16 forbids. Every panel this shell draws gets it.
1277
+ */
1278
+ refreshHook?: UserSystemRefreshHook | undefined;
1279
+ readonly?: boolean;
1280
+ /**
1281
+ * Whether the owning form holds edits that have not been saved.
1282
+ *
1283
+ * It drives two things. The dot on the owning tab, so the operator can see it from the other
1284
+ * tabs -- the Save button itself is visible everywhere, by decision, because a button that
1285
+ * disappeared would read as "this is read-only". And the guard below, which is the only thing
1286
+ * standing between unsaved work and the button in a panel that leaves the page: switching a tab
1287
+ * is not navigation, so nothing else ever asks.
1288
+ */
1289
+ unsavedChanges?: boolean;
1290
+ /** Query key for the deep link. */
1291
+ tabQueryKey?: string;
1292
+ };
1293
+
1294
+ declare type __VLS_Props_33 = {
1295
+ /** The system's name as the app translates it. */
1296
+ systemLabel: string;
1297
+ /** The system's `createNote` -- what is special about having an account there. */
1298
+ createNote?: string | undefined;
1299
+ /**
1300
+ * Whether the account about to be created will be switched on.
1301
+ *
1302
+ * The sentence about a working public account is composed here rather than carried by the
1303
+ * descriptor, because it depends on the value being sent: creating from a panel copies the
1304
+ * source account's `enabled` -- usually true -- while creating after a search that found
1305
+ * nobody sends false, since there is no source to copy from.
1306
+ */
1307
+ willBeEnabled?: boolean;
1308
+ loading?: boolean;
1309
+ disabled?: boolean;
1310
+ /** The target system's `requiredMetadata`: the profile the form validates against. */
1311
+ requiredMetadata?: boolean;
1312
+ /** The person's id. Always drawn and never editable here -- this path is about somebody who exists. */
1313
+ userId?: IntegerIdNullable;
1314
+ /**
1315
+ * What is already known about them, to prefill the form.
1316
+ *
1317
+ * Not the body that gets posted: the caller reads the source again immediately before the POST.
1318
+ * This is what the operator sees and completes, and completing it is the point -- a person known
1319
+ * only in blog usually has an empty `person`, while the target may require it, so a silent copy
1320
+ * would create a record the target's own form then refuses to save.
1321
+ */
1322
+ source?: BaseUser | null;
1323
+ };
1324
+
1325
+ declare type __VLS_Props_34 = {
1326
+ target: UserSystemManageTarget;
1327
+ /** The system's name as the app translates it. */
1328
+ systemLabel: string;
1329
+ /** "Edit" instead of "Manage in X" -- used where the operator is already in that admin. */
1330
+ internalLabel?: string | undefined;
1331
+ };
1332
+
1333
+ declare type __VLS_Props_35 = {
1334
+ /** Order matters twice: the order of the rows, and the priority when pre-filling. */
1335
+ descriptors: AnyUserSystemDescriptor[];
1336
+ refreshHook?: UserSystemRefreshHook | undefined;
1337
+ };
1338
+
1339
+ declare type __VLS_Props_36 = {
1340
+ action: BulkActionType;
1341
+ descriptors: AnyUserSystemDescriptor[];
1342
+ };
1343
+
1344
+ declare type __VLS_Props_37 = {
1345
+ descriptors: AnyUserSystemDescriptor[];
1346
+ };
1347
+
683
1348
  declare type __VLS_Props_4 = {
684
1349
  name: string;
685
1350
  allT?: string;
@@ -728,6 +1393,20 @@ declare type __VLS_Props_9 = {
728
1393
 
729
1394
  declare type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
730
1395
 
1396
+ declare type __VLS_PublicProps_10 = __VLS_Props_25 & __VLS_ModelProps_10;
1397
+
1398
+ declare type __VLS_PublicProps_11 = __VLS_Props_26 & __VLS_ModelProps_11;
1399
+
1400
+ declare type __VLS_PublicProps_12 = __VLS_Props_27 & __VLS_ModelProps_12;
1401
+
1402
+ declare type __VLS_PublicProps_13 = __VLS_Props_28 & __VLS_ModelProps_13;
1403
+
1404
+ declare type __VLS_PublicProps_14 = __VLS_Props_32 & __VLS_ModelProps_14;
1405
+
1406
+ declare type __VLS_PublicProps_15 = __VLS_Props_36 & __VLS_ModelProps_15;
1407
+
1408
+ declare type __VLS_PublicProps_16 = __VLS_Props_37 & __VLS_ModelProps_16;
1409
+
731
1410
  declare type __VLS_PublicProps_2 = __VLS_Props_3 & __VLS_ModelProps_2;
732
1411
 
733
1412
  declare type __VLS_PublicProps_3 = __VLS_Props_11 & __VLS_ModelProps_3;
@@ -736,6 +1415,14 @@ declare type __VLS_PublicProps_4 = __VLS_Props_13 & __VLS_ModelProps_4;
736
1415
 
737
1416
  declare type __VLS_PublicProps_5 = __VLS_Props_14 & __VLS_ModelProps_5;
738
1417
 
1418
+ declare type __VLS_PublicProps_6 = __VLS_Props_17 & __VLS_ModelProps_6;
1419
+
1420
+ declare type __VLS_PublicProps_7 = __VLS_Props_21 & __VLS_ModelProps_7;
1421
+
1422
+ declare type __VLS_PublicProps_8 = __VLS_Props_23 & __VLS_ModelProps_8;
1423
+
1424
+ declare type __VLS_PublicProps_9 = __VLS_Props_24 & __VLS_ModelProps_9;
1425
+
739
1426
  declare type __VLS_Slots = {} & {
740
1427
  [K in NonNullable<typeof __VLS_123>]?: (props: typeof __VLS_124) => any;
741
1428
  } & {
@@ -750,6 +1437,26 @@ declare type __VLS_Slots = {} & {
750
1437
  detail?: (props: typeof __VLS_108) => any;
751
1438
  };
752
1439
 
1440
+ declare type __VLS_Slots_10 = {} & {
1441
+ copyPermissions?: (props: typeof __VLS_42) => any;
1442
+ } & {
1443
+ systemFields?: (props: typeof __VLS_50) => any;
1444
+ } & {
1445
+ actions?: (props: typeof __VLS_80) => any;
1446
+ };
1447
+
1448
+ declare type __VLS_Slots_11 = {} & {
1449
+ sourcePicker?: (props: typeof __VLS_35) => any;
1450
+ };
1451
+
1452
+ declare type __VLS_Slots_12 = {} & {
1453
+ note?: (props: typeof __VLS_17) => any;
1454
+ };
1455
+
1456
+ declare type __VLS_Slots_13 = {} & {
1457
+ default?: (props: typeof __VLS_30) => any;
1458
+ };
1459
+
753
1460
  declare type __VLS_Slots_2 = {} & {
754
1461
  default?: (props: typeof __VLS_11) => any;
755
1462
  };
@@ -768,40 +1475,126 @@ declare type __VLS_Slots_4 = {} & {
768
1475
  title?: (props: typeof __VLS_45) => any;
769
1476
  };
770
1477
 
771
- declare type __VLS_Slots_5 = {} & {
772
- 'append-item'?: (props: typeof __VLS_14) => any;
1478
+ declare type __VLS_Slots_5 = {} & {
1479
+ 'append-item'?: (props: typeof __VLS_14) => any;
1480
+ };
1481
+
1482
+ declare type __VLS_Slots_6 = {} & {
1483
+ createdBy?: (props: typeof __VLS_47) => any;
1484
+ } & {
1485
+ modifiedBy?: (props: typeof __VLS_55) => any;
1486
+ };
1487
+
1488
+ declare type __VLS_Slots_7 = {} & {
1489
+ tracking?: (props: typeof __VLS_82) => any;
1490
+ };
1491
+
1492
+ declare type __VLS_Slots_8 = {} & {
1493
+ [K in NonNullable<typeof __VLS_12>]?: (props: typeof __VLS_13) => any;
1494
+ } & {
1495
+ permissionGroups?: (props: typeof __VLS_54) => any;
1496
+ } & {
1497
+ systemColumns?: (props: typeof __VLS_70) => any;
1498
+ } & {
1499
+ createdBy?: (props: typeof __VLS_78) => any;
1500
+ } & {
1501
+ modifiedBy?: (props: typeof __VLS_86) => any;
1502
+ } & {
1503
+ rowActions?: (props: typeof __VLS_111) => any;
1504
+ };
1505
+
1506
+ declare type __VLS_Slots_9 = {} & {
1507
+ [K in NonNullable<typeof __VLS_20>]?: (props: typeof __VLS_21) => any;
1508
+ };
1509
+
1510
+ declare type __VLS_WithSlots<T, S> = T & {
1511
+ new (): {
1512
+ $slots: S;
1513
+ };
1514
+ };
1515
+
1516
+ declare type __VLS_WithSlots_10<T, S> = T & {
1517
+ new (): {
1518
+ $slots: S;
1519
+ };
1520
+ };
1521
+
1522
+ declare type __VLS_WithSlots_11<T, S> = T & {
1523
+ new (): {
1524
+ $slots: S;
1525
+ };
1526
+ };
1527
+
1528
+ declare type __VLS_WithSlots_12<T, S> = T & {
1529
+ new (): {
1530
+ $slots: S;
1531
+ };
1532
+ };
1533
+
1534
+ declare type __VLS_WithSlots_13<T, S> = T & {
1535
+ new (): {
1536
+ $slots: S;
1537
+ };
1538
+ };
1539
+
1540
+ declare type __VLS_WithSlots_2<T, S> = T & {
1541
+ new (): {
1542
+ $slots: S;
1543
+ };
1544
+ };
1545
+
1546
+ declare type __VLS_WithSlots_3<T, S> = T & {
1547
+ new (): {
1548
+ $slots: S;
1549
+ };
1550
+ };
1551
+
1552
+ declare type __VLS_WithSlots_4<T, S> = T & {
1553
+ new (): {
1554
+ $slots: S;
1555
+ };
773
1556
  };
774
1557
 
775
- declare type __VLS_WithSlots<T, S> = T & {
1558
+ declare type __VLS_WithSlots_5<T, S> = T & {
776
1559
  new (): {
777
1560
  $slots: S;
778
1561
  };
779
1562
  };
780
1563
 
781
- declare type __VLS_WithSlots_2<T, S> = T & {
1564
+ declare type __VLS_WithSlots_6<T, S> = T & {
782
1565
  new (): {
783
1566
  $slots: S;
784
1567
  };
785
1568
  };
786
1569
 
787
- declare type __VLS_WithSlots_3<T, S> = T & {
1570
+ declare type __VLS_WithSlots_7<T, S> = T & {
788
1571
  new (): {
789
1572
  $slots: S;
790
1573
  };
791
1574
  };
792
1575
 
793
- declare type __VLS_WithSlots_4<T, S> = T & {
1576
+ declare type __VLS_WithSlots_8<T, S> = T & {
794
1577
  new (): {
795
1578
  $slots: S;
796
1579
  };
797
1580
  };
798
1581
 
799
- declare type __VLS_WithSlots_5<T, S> = T & {
1582
+ declare type __VLS_WithSlots_9<T, S> = T & {
800
1583
  new (): {
801
1584
  $slots: S;
802
1585
  };
803
1586
  };
804
1587
 
1588
+ export declare const AAnzuUserDatatable: typeof __VLS_export_30;
1589
+
1590
+ export declare const AAnzuUserFilter: typeof __VLS_export_31;
1591
+
1592
+ export declare const AAnzuUserForm: typeof __VLS_export_32;
1593
+
1594
+ export declare const AAnzuUserRoleAutocomplete: typeof __VLS_export_33;
1595
+
1596
+ declare type AclValue = `${string}_${string}_${string}`;
1597
+
805
1598
  export declare const ADatatableOrdering: typeof __VLS_export_13;
806
1599
 
807
1600
  export declare const ADatatablePagination: typeof __VLS_export_14;
@@ -839,6 +1632,8 @@ declare interface AddButtonSlotProps_3 {
839
1632
  };
840
1633
  }
841
1634
 
1635
+ declare type AddToCachedArgs<T extends DocId | IntegerId> = Array<T | null | undefined> | Array<Array<T | null | undefined> | T | null | undefined>;
1636
+
842
1637
  export declare const AFilterBooleanSelect: typeof __VLS_export_5;
843
1638
 
844
1639
  export declare const AFilterDatetimePicker: typeof __VLS_export_6;
@@ -875,16 +1670,123 @@ export declare const ALogListView: typeof __VLS_export_22;
875
1670
 
876
1671
  export declare const ANestedSortableListEditor: typeof __VLS_export_20;
877
1672
 
1673
+ /**
1674
+ * The erasure boundary for a heterogeneous array.
1675
+ *
1676
+ * Descriptors differ in `TUser` -- blog's `extraState` reaches for `status`, forum's for
1677
+ * `settings.banned` -- so an array of them cannot keep each one's type. Without a single place to
1678
+ * erase it, `strict: true` would demand a cast in every admin, at every call site. This does it
1679
+ * once, where the array is built.
1680
+ */
1681
+ export declare type AnyUserSystemDescriptor = UserSystemDescriptor<string, AnzuUser>;
1682
+
1683
+ export declare const ANZU_USER_ENDPOINT = "/adm/v1/anzu-user";
1684
+
1685
+ export declare const ANZU_USER_ENTITY = "anzuUser";
1686
+
1687
+ declare interface AnzuUser extends AnzuUserAndTimeTrackingAware, BaseUser {
1688
+ enabled: boolean;
1689
+ locale: LanguageCode | null;
1690
+ roles: string[];
1691
+ permissionGroups: IntegerId[];
1692
+ permissions: Permissions_2;
1693
+ resolvedPermissions: Permissions_2;
1694
+ _resourceName: string;
1695
+ _system: string;
1696
+ }
1697
+
1698
+ export declare interface AnzuUserActionsParams {
1699
+ client: AxiosClientFn;
1700
+ system: string;
1701
+ entity?: string;
1702
+ /**
1703
+ * i18n scope for a server-side validation failure, which is a different question from which
1704
+ * backend answered. `AnzuApiValidationError` builds `<system>.<entity>.model.<field>` keys, so
1705
+ * the pair has to name the namespace the *labels* live under. It defaults to `common` +
1706
+ * `anzuUser`, which is where the shared form's own fields are; an admin whose form carries
1707
+ * system fields as well passes its own pair, and keeps the base keys beside them.
1708
+ */
1709
+ validationSystem?: string;
1710
+ validationEntity?: string;
1711
+ endPoint?: string;
1712
+ /** Vuelidate scope, when the page collects its fields under one of its own. */
1713
+ validationScope?: string | symbol;
1714
+ }
1715
+
878
1716
  declare interface AnzuUserAndTimeTrackingAware extends CreatedByAware {
879
1717
  createdAt: DatetimeUTC;
880
1718
  modifiedAt: DatetimeUTC;
881
1719
  modifiedBy: IntegerIdNullable;
882
1720
  }
883
1721
 
1722
+ export declare interface AnzuUserApiParams {
1723
+ client: AxiosClientFn;
1724
+ /**
1725
+ * Both reach every `useApiRequest` built here. The admins' copies declared `system = 'common'`
1726
+ * and `entity = 'anzuUser'` as file constants, which is why a shared version has to take them:
1727
+ * the same file now serves nine backends, and the error context has to name the right one.
1728
+ */
1729
+ system: string;
1730
+ entity?: string;
1731
+ /**
1732
+ * i18n scope for a server-side validation failure, which is a different question from which
1733
+ * backend answered. `AnzuApiValidationError` builds `<system>.<entity>.model.<field>` keys, and
1734
+ * for a component shared by nine backends the labels are always the library's own `common.*` --
1735
+ * `weather.anzuUser.model.email` exists nowhere. Defaults to `common` plus the entity;
1736
+ * contentHub passes its own pair to keep the keys it already has.
1737
+ */
1738
+ validationSystem?: string;
1739
+ validationEntity?: string;
1740
+ endPoint?: string;
1741
+ }
1742
+
1743
+ /** `/adm/v1/anzu-user`. Absent in contentHub, which has only `/adm/users`. */
1744
+ export declare interface AnzuUserEndpointPair {
1745
+ get: string;
1746
+ put: string;
1747
+ post: string;
1748
+ }
1749
+
1750
+ export declare const anzuUserFilterStorageKey: (system: string) => string;
1751
+
1752
+ declare const anzuUserListFields: ({
1753
+ name: "id";
1754
+ default: null;
1755
+ type: "integer";
1756
+ variant?: undefined;
1757
+ render?: undefined;
1758
+ } | {
1759
+ name: "email";
1760
+ variant: "startsWith";
1761
+ default: null;
1762
+ type: "string";
1763
+ render: {
1764
+ skip: true;
1765
+ };
1766
+ } | {
1767
+ name: "enabled";
1768
+ default: null;
1769
+ type: "boolean";
1770
+ variant?: undefined;
1771
+ render?: undefined;
1772
+ })[];
1773
+
884
1774
  declare interface AnzuUserMinimal extends BaseUser {
885
1775
  id: IntegerId;
886
1776
  }
887
1777
 
1778
+ export declare const APermissionEditor: typeof __VLS_export_24;
1779
+
1780
+ export declare const APermissionGroupDatatable: typeof __VLS_export_25;
1781
+
1782
+ export declare const APermissionGroupDetail: typeof __VLS_export_26;
1783
+
1784
+ export declare const APermissionGroupFilter: typeof __VLS_export_27;
1785
+
1786
+ export declare const APermissionGroupManage: typeof __VLS_export_28;
1787
+
1788
+ export declare const APermissionGroupRemoteAutocomplete: typeof __VLS_export_29;
1789
+
888
1790
  export declare type ApiErrorContext = {
889
1791
  system: string;
890
1792
  entity: string;
@@ -905,6 +1807,18 @@ export declare type ApiErrorContext = {
905
1807
  * reaches the logger and is filtered here, on this field.
906
1808
  */
907
1809
  status?: number;
1810
+ /**
1811
+ * The i18n scope a field-level validation failure is reported under, when it is not the same as
1812
+ * the backend above.
1813
+ *
1814
+ * `AnzuApiValidationError` turns the server's field names into `<system>.<entity>.model.<field>`
1815
+ * translation keys. For a component shared by nine backends those two are different questions:
1816
+ * *which* backend failed -- which is what the report needs -- and *whose labels* name its fields,
1817
+ * which for a shared form is always the library's own `common.*`. Left unset, the two stay one
1818
+ * value, exactly as before.
1819
+ */
1820
+ validationSystem?: string;
1821
+ validationEntity?: string;
908
1822
  };
909
1823
 
910
1824
  export declare type ApiErrorLogger = (error: Error, context: ApiErrorContext) => void;
@@ -927,6 +1841,30 @@ export declare const ASubjectSelect: typeof __VLS_export_17;
927
1841
 
928
1842
  export declare const AUnsavedConfirmDialog: typeof __VLS_export_21;
929
1843
 
1844
+ export declare const AUserBulkActionDialog: typeof __VLS_export_44;
1845
+
1846
+ export declare const AUserCopyPermissionsDialog: typeof __VLS_export_34;
1847
+
1848
+ export declare const AUserCreateInSystemButton: typeof __VLS_export_41;
1849
+
1850
+ export declare const AUserEnabledSwitch: typeof __VLS_export_35;
1851
+
1852
+ export declare const AUserManageButton: typeof __VLS_export_42;
1853
+
1854
+ export declare const AUserMetadataForm: typeof __VLS_export_36;
1855
+
1856
+ export declare const AUserMetadataRepairDialog: typeof __VLS_export_45;
1857
+
1858
+ export declare const AUserOtherSystemsTable: typeof __VLS_export_39;
1859
+
1860
+ export declare const AUserSystemOverview: typeof __VLS_export_43;
1861
+
1862
+ export declare const AUserSystemPanel: typeof __VLS_export_38;
1863
+
1864
+ export declare const AUserSystemStatusChip: typeof __VLS_export_37;
1865
+
1866
+ export declare const AUserTabsShell: typeof __VLS_export_40;
1867
+
930
1868
  export declare type AxiosClientFn = () => AxiosInstance;
931
1869
 
932
1870
  declare interface BaseUser {
@@ -943,6 +1881,11 @@ declare interface BaseUser {
943
1881
  };
944
1882
  }
945
1883
 
1884
+ /** `/adm/users`. Only cms, dam and contentHub have it; it is the only path with a `PATCH`. */
1885
+ export declare interface BaseUserEndpointPair extends AnzuUserEndpointPair {
1886
+ patch: string;
1887
+ }
1888
+
946
1889
  /**
947
1890
  * Hash for a filter link, with values equal to their default left out.
948
1891
  *
@@ -954,6 +1897,44 @@ declare interface BaseUser {
954
1897
  */
955
1898
  export declare function buildFilterHash<F extends readonly MakeFilterOption<string>[]>(filterConfig: FilterConfig<F>, filters: Partial<Record<keyof FilterData<F> & string, AllowedFilterValues>>, sortBy?: DatatableSortBy): string;
956
1899
 
1900
+ export declare const BulkAction: {
1901
+ readonly Enable: "enable";
1902
+ readonly Disable: "disable";
1903
+ readonly Metadata: "metadata";
1904
+ };
1905
+
1906
+ export declare type BulkActionType = (typeof BulkAction)[keyof typeof BulkAction];
1907
+
1908
+ export declare interface BulkLogEntry {
1909
+ system: string;
1910
+ outcome: BulkOutcomeType;
1911
+ /**
1912
+ * Which run the line belongs to.
1913
+ *
1914
+ * The log survives a run so that a retry does not erase the systems that succeeded a minute ago,
1915
+ * and the retry button acts on whatever the log calls failed. Without these two fields a failed
1916
+ * metadata write would be retried as a disable, and a previous person's failures would be retried
1917
+ * against the id currently on screen -- neither `setEnabled` nor `writeMetadata` can tell it is
1918
+ * being asked about a different action or a different account.
1919
+ */
1920
+ action: BulkActionType;
1921
+ subjectId: IntegerIdNullable;
1922
+ detail?: string;
1923
+ }
1924
+
1925
+ export declare const BulkOutcome: {
1926
+ readonly Pending: "pending";
1927
+ readonly Running: "running";
1928
+ readonly Done: "done";
1929
+ readonly Forbidden: "forbidden";
1930
+ readonly Unauthenticated: "unauthenticated";
1931
+ readonly NotFound: "notFound";
1932
+ readonly Invalid: "invalid";
1933
+ readonly Unavailable: "unavailable";
1934
+ };
1935
+
1936
+ export declare type BulkOutcomeType = (typeof BulkOutcome)[keyof typeof BulkOutcome];
1937
+
957
1938
  /**
958
1939
  * `_unresolved` is terminal: the fetch settled without resolving the item, either because
959
1940
  * it failed or because the server did not return it.
@@ -963,6 +1944,37 @@ declare type CachedItem<T extends object> = T & {
963
1944
  _unresolved?: boolean;
964
1945
  };
965
1946
 
1947
+ export declare interface CachedPermissionGroupsParams {
1948
+ client: AxiosClientFn;
1949
+ system: string;
1950
+ entity?: string;
1951
+ endPoint?: string;
1952
+ }
1953
+
1954
+ /**
1955
+ * How a probe response becomes axes.
1956
+ *
1957
+ * 401 is its own case and it is not a detail. A first 401 is ambiguous -- an expired session looks
1958
+ * exactly like "no account here" -- and since the buttons are gated by this answer alone, showing
1959
+ * an expired token as "no account here" is the one confusion decision 16 forbids. The caller is
1960
+ * expected to have retried through its refresh hook before classifying; what arrives here is the
1961
+ * verdict after that retry.
1962
+ *
1963
+ * 422 deliberately has no case. A detail GET loads the record and returns it; it does not validate
1964
+ * a body. A 422 belongs to the log of writes.
1965
+ */
1966
+ export declare const classifyProbeStatus: (status: number | null) => Pick<UserSystemAxes, "presence" | "access">;
1967
+
1968
+ /**
1969
+ * What the operator is told about a failed write.
1970
+ *
1971
+ * 422 and 400 are their own line and not a generic failure: a PUT validates the whole body, and an
1972
+ * account carrying a colour or an e-mail that no longer passes validation will fail even on a plain
1973
+ * "disable". With legacy data that is an ordinary outcome, and "could not be saved" would send
1974
+ * somebody looking for a bug that is not there.
1975
+ */
1976
+ export declare const classifyWriteStatus: (status: number | null) => BulkOutcomeType;
1977
+
966
1978
  declare type CollabCachedUsersMap = Map<IntegerId, CachedItem<AnzuUserMinimal>>;
967
1979
 
968
1980
  declare type CollabComponentConfig = undefined | {
@@ -1014,6 +2026,22 @@ export declare function createFilterStore<F extends readonly MakeFilterOption<st
1014
2026
  */
1015
2027
  export declare function createListEditorStateScope(): ListEditorStateScope;
1016
2028
 
2029
+ export declare const CrossSystemPhase: {
2030
+ readonly Idle: "idle";
2031
+ /** First round of an e-mail search: find the person and their id. */
2032
+ readonly MatchingEmail: "matchingEmail";
2033
+ /** Second round: ask every system by that id, to catch the ones holding a different e-mail. */
2034
+ readonly VerifyingById: "verifyingById";
2035
+ readonly Done: "done";
2036
+ };
2037
+
2038
+ export declare type CrossSystemPhaseType = (typeof CrossSystemPhase)[keyof typeof CrossSystemPhase];
2039
+
2040
+ export declare interface CrossSystemSearchParams {
2041
+ descriptors: AnyUserSystemDescriptor[];
2042
+ refreshHook?: UserSystemRefreshHook | undefined;
2043
+ }
2044
+
1017
2045
  declare interface DatatableColumnsConfigMoreOptions {
1018
2046
  storeColumnsLocalStorage: string | boolean;
1019
2047
  disableActions: boolean;
@@ -1083,6 +2111,8 @@ export declare const DEFAULT_LOG_PATHS: LogPaths;
1083
2111
  /** What reporting does until an application says otherwise; exported so a test can put it back. */
1084
2112
  export declare const defaultApiErrorLogger: ApiErrorLogger;
1085
2113
 
2114
+ export declare const defineUserSystemDescriptor: <TSystem extends string, TUser extends AnzuUser>(descriptor: UserSystemDescriptor<TSystem, TUser>) => AnyUserSystemDescriptor;
2115
+
1086
2116
  /**
1087
2117
  * UUID v4 as string.
1088
2118
  */
@@ -1112,6 +2142,8 @@ declare interface EmptySlotProps_3 {
1112
2142
  };
1113
2143
  }
1114
2144
 
2145
+ export declare const emptyUserSystemAxes: () => UserSystemAxes;
2146
+
1115
2147
  export declare type ExecuteRequestParams<B> = {
1116
2148
  urlTemplate?: string;
1117
2149
  urlParams?: UrlParams;
@@ -1243,7 +2275,7 @@ export declare type FilterStore<T extends readonly {
1243
2275
  [K in T[number]['name']]: AllowedFilterValues;
1244
2276
  };
1245
2277
 
1246
- declare type FilterStoreIdentifier = {
2278
+ export declare type FilterStoreIdentifier = {
1247
2279
  system: string;
1248
2280
  subject: string;
1249
2281
  };
@@ -1254,6 +2286,17 @@ declare type FilterVariant = 'search' | 'lt' | 'in' | 'notIn' | 'endsWith' | 'st
1254
2286
 
1255
2287
  declare type FilterVariant_2 = 'search' | 'lt' | 'in' | 'notIn' | 'endsWith' | 'startsWith' | 'memberOf' | 'contains' | 'neq' | 'gte' | 'gt' | 'eq' | 'lte' | 'custom';
1256
2288
 
2289
+ /**
2290
+ * Which of the six fields the systems disagree about.
2291
+ *
2292
+ * Blog is compared on `person.*` like everything else, and its own root `firstName`/`lastName`
2293
+ * columns are deliberately left out of this: those are the byline under an article, the blog's slug
2294
+ * and the public API, not back-office metadata. That blog's `person` is empty for most bloggers and
2295
+ * will therefore read as different is correct -- the back-office identity really is unset there,
2296
+ * and the first repair fills it in.
2297
+ */
2298
+ export declare const findMetadataDifferences: (records: Map<string, BaseUser>) => MetadataDifference[];
2299
+
1257
2300
  /**
1258
2301
  * Pretty-prints a JSON string, and hands back whatever it was given when that is not what it is.
1259
2302
  * Log context carries request and response bodies that are usually but not always JSON.
@@ -1271,6 +2314,14 @@ export declare const generateListQuery: (pagination: Ref<Pagination>, filterData
1271
2314
 
1272
2315
  export declare type GetKey<TItem> = keyof TItem | ((item: TItem) => ListEditorKey);
1273
2316
 
2317
+ declare const Grant: {
2318
+ readonly Deny: 0;
2319
+ readonly AllowOwner: 1;
2320
+ readonly Allow: 2;
2321
+ };
2322
+
2323
+ declare type GrantType = (typeof Grant)[keyof typeof Grant];
2324
+
1274
2325
  declare interface HeaderSlotProps {
1275
2326
  title: string | null;
1276
2327
  }
@@ -1293,6 +2344,20 @@ declare type IntegerId = number;
1293
2344
  */
1294
2345
  declare type IntegerIdNullable = number | null;
1295
2346
 
2347
+ /** A system a bulk action may act on: it answered, the account is there, and access was granted. */
2348
+ export declare const isActionable: (axes: UserSystemAxes) => boolean;
2349
+
2350
+ /**
2351
+ * Whether the probe answered authoritatively that nobody is there.
2352
+ *
2353
+ * Creating an account is offered only when every relevant system said so. A record that could not
2354
+ * be read is not a record that does not exist, and since no admin can delete an AnzuUser, a
2355
+ * duplicate identity created on a guess cannot be taken back.
2356
+ */
2357
+ export declare const isAuthoritativelyAbsent: (axes: UserSystemAxes) => boolean;
2358
+
2359
+ export declare const isEmailTerm: (term: string) => boolean;
2360
+
1296
2361
  export declare const isLogType: (value: unknown) => value is LogTypeType;
1297
2362
 
1298
2363
  /** Whether `router.push({ hash })` would leave the hash intact — see `buildFilterHash`. */
@@ -1329,6 +2394,8 @@ declare const JobStatus: {
1329
2394
 
1330
2395
  declare type JobStatusType = (typeof JobStatus)[keyof typeof JobStatus];
1331
2396
 
2397
+ declare type LanguageCode = 'en' | 'sk' | 'cs' | 'xx';
2398
+
1332
2399
  export declare interface ListEditorApi<TItem> {
1333
2400
  viewItems: ComputedRef<ListViewItem<TItem>[]>;
1334
2401
  addItem: (data: TItem, positionHint?: PositionHint) => TItem[];
@@ -1456,6 +2523,10 @@ declare type ListEditorValidationScope = string | number | boolean | symbol;
1456
2523
 
1457
2524
  export declare type ListEditorValidationState = 'valid' | 'invalid' | 'warning' | null;
1458
2525
 
2526
+ declare type ListFields = typeof permissionGroupListFields;
2527
+
2528
+ declare type ListFields_2 = typeof anzuUserListFields;
2529
+
1459
2530
  export declare interface ListViewItem<TItem> {
1460
2531
  key: ListEditorKey;
1461
2532
  index: number;
@@ -1691,6 +2762,12 @@ export declare interface MakeFilterOption<TName extends string = string> {
1691
2762
  render?: Partial<FilerRenderOptions>;
1692
2763
  }
1693
2764
 
2765
+ export declare interface MetadataDifference {
2766
+ field: UserMetadataField;
2767
+ /** System to the value it holds, for every system that answered with a record. */
2768
+ values: Map<string, string>;
2769
+ }
2770
+
1694
2771
  export declare interface NestedListEditorApi<TItem extends Record<string, any>> {
1695
2772
  viewItems: ComputedRef<NestedViewItem<TItem>[]>;
1696
2773
  findNode: (id: ListEditorKey) => {
@@ -1846,6 +2923,14 @@ export declare interface NestedViewItem<TItem> extends ListViewItem<TItem> {
1846
2923
  */
1847
2924
  export declare const nextListEditorTempId: () => number;
1848
2925
 
2926
+ /**
2927
+ * The one tab that is not a system.
2928
+ *
2929
+ * A module of its own because `<script setup>` cannot export, and both the shell and the pages that
2930
+ * read `?tab=` need to name it.
2931
+ */
2932
+ export declare const OTHER_SYSTEMS_TAB = "__otherSystems";
2933
+
1849
2934
  export declare interface Pagination {
1850
2935
  sortBy: DatatableSortBy;
1851
2936
  page: number;
@@ -1860,6 +2945,181 @@ declare interface PaginationOptions {
1860
2945
  rowsPerPage: number;
1861
2946
  }
1862
2947
 
2948
+ export declare const PERMISSION_CONFIG_ENDPOINT = "/adm/v1/permissions/config";
2949
+
2950
+ export declare const PERMISSION_CONFIG_ENTITY = "permissionConfig";
2951
+
2952
+ export declare const PERMISSION_GROUP_ENDPOINT = "/adm/v1/permission-group";
2953
+
2954
+ export declare const PERMISSION_GROUP_ENTITY = "permissionGroup";
2955
+
2956
+ export declare interface PermissionActionsParams {
2957
+ client: AxiosClientFn;
2958
+ system: string;
2959
+ entity?: string;
2960
+ endPoint?: string;
2961
+ }
2962
+
2963
+ declare interface PermissionConfig {
2964
+ roles: string[];
2965
+ defaultGrants: GrantType[];
2966
+ config: {
2967
+ [subject: string]: {
2968
+ [action: string]: {
2969
+ grants?: GrantType[];
2970
+ };
2971
+ };
2972
+ };
2973
+ translation: {
2974
+ subjects: {
2975
+ [subject: string]: {
2976
+ [lang: string]: string;
2977
+ };
2978
+ };
2979
+ actions: {
2980
+ [action: string]: {
2981
+ [lang: string]: string;
2982
+ };
2983
+ };
2984
+ roles: {
2985
+ [role: string]: {
2986
+ [lang: string]: string;
2987
+ };
2988
+ };
2989
+ };
2990
+ }
2991
+
2992
+ export declare interface PermissionConfigActionsParams {
2993
+ client: AxiosClientFn;
2994
+ /**
2995
+ * The system this config belongs to. It is a parameter and not a global -- admin-inhouse used to
2996
+ * read it from a `curSystem` ref, which made the whole module impossible to use from a page that
2997
+ * shows two systems at once and impossible to move here at all.
2998
+ */
2999
+ system: string;
3000
+ entity?: string;
3001
+ endPoint?: string;
3002
+ /**
3003
+ * Fetch as soon as the composable is built, the way every admin does today. Turn it off where
3004
+ * the caller wants to decide when (a dialog that may never open, a test).
3005
+ */
3006
+ autoFetch?: boolean;
3007
+ }
3008
+
3009
+ export declare interface PermissionConfigApiParams {
3010
+ client: AxiosClientFn;
3011
+ /**
3012
+ * Which backend this instance talks to. It reaches `useApiRequest` for error context and is the
3013
+ * key everything downstream is stored under, so two systems can be loaded side by side.
3014
+ */
3015
+ system: string;
3016
+ /** Goes into every `useApiRequest` call; see the per-system entity note in `permissionGroupApi`. */
3017
+ entity?: string;
3018
+ endPoint?: string;
3019
+ }
3020
+
3021
+ /**
3022
+ * One entry per system. The admins this replaces kept `loading` and `initialized` as two module
3023
+ * booleans shared by every system they fetched, which is wrong the moment the fetches run in
3024
+ * parallel: the first one to finish cleared the flag for all of them, and the first one to fail
3025
+ * left it set forever because there was no `finally`.
3026
+ */
3027
+ export declare interface PermissionConfigEntry {
3028
+ config: PermissionConfig;
3029
+ loading: boolean;
3030
+ initialized: boolean;
3031
+ }
3032
+
3033
+ declare interface PermissionGroup extends PermissionGroupMinimal, AnzuUserAndTimeTrackingAware {
3034
+ description: string;
3035
+ _system: string;
3036
+ _resourceName: 'permissionGroup';
3037
+ }
3038
+
3039
+ export declare interface PermissionGroupActionsParams {
3040
+ client: AxiosClientFn;
3041
+ system: string;
3042
+ entity?: string;
3043
+ /**
3044
+ * i18n scope for a server-side validation failure, which is a different question from which
3045
+ * backend answered. `AnzuApiValidationError` builds `<system>.<entity>.model.<field>` keys, so
3046
+ * the pair has to name the namespace the *labels* live under. It defaults to `common` +
3047
+ * `permissionGroup`, which is where the shared form's own fields are; an admin whose form carries
3048
+ * system fields as well passes its own pair, and keeps the base keys beside them.
3049
+ */
3050
+ validationSystem?: string;
3051
+ validationEntity?: string;
3052
+ endPoint?: string;
3053
+ }
3054
+
3055
+ export declare interface PermissionGroupApiParams {
3056
+ client: AxiosClientFn;
3057
+ /**
3058
+ * Both of these reach every `useApiRequest` this builds, and both have to be taken rather than
3059
+ * assumed. admin-cms is the proof: its `permissionGroupApi.ts` declared `SYSTEM_COMMON` at the
3060
+ * top and then sent `SYSTEM_CMS` on one of its four calls, so the same file reported two
3061
+ * different systems for the same endpoint. A copy of that file per system multiplies the bug;
3062
+ * one file that is told which system it is cannot have it.
3063
+ */
3064
+ system: string;
3065
+ entity?: string;
3066
+ /**
3067
+ * i18n scope for a server-side validation failure, which is a different question from which
3068
+ * backend answered. `AnzuApiValidationError` builds `<system>.<entity>.model.<field>` keys, and
3069
+ * for a component shared by nine backends the labels are always the library's own `common.*` --
3070
+ * `weather.anzuUser.model.email` exists nowhere. Defaults to `common` plus the entity;
3071
+ * contentHub passes its own pair to keep the keys it already has.
3072
+ */
3073
+ validationSystem?: string;
3074
+ validationEntity?: string;
3075
+ endPoint?: string;
3076
+ }
3077
+
3078
+ /**
3079
+ * Local-storage key for the list filter. Named rather than derived so it cannot collide with the
3080
+ * per-admin views this replaces, which store under `tableFilter_common_permissionGroup`; while
3081
+ * both versions are on screen they must not share remembered filters (rule 8.0).
3082
+ */
3083
+ export declare const permissionGroupFilterStorageKey: (system: string) => string;
3084
+
3085
+ declare const permissionGroupListFields: ({
3086
+ name: "id";
3087
+ default: null;
3088
+ type: "integer";
3089
+ variant?: undefined;
3090
+ render?: undefined;
3091
+ } | {
3092
+ name: "title";
3093
+ variant: "startsWith";
3094
+ default: null;
3095
+ type: "string";
3096
+ render: {
3097
+ skip: true;
3098
+ };
3099
+ })[];
3100
+
3101
+ declare interface PermissionGroupMinimal {
3102
+ id: IntegerId;
3103
+ title: string;
3104
+ permissions: Permissions_2;
3105
+ }
3106
+
3107
+ declare type Permissions_2 = {
3108
+ [key in AclValue]?: GrantType;
3109
+ };
3110
+
3111
+ declare type PermissionTranslationGroup = 'subjects' | 'actions' | 'roles';
3112
+
3113
+ /**
3114
+ * Which record the repair form is pre-filled from: the first system in the configured order that
3115
+ * has one.
3116
+ *
3117
+ * Never "whichever answered first" -- the fan-out is parallel, so that would be a different answer
3118
+ * on every run. The order is a default rather than a hidden rule: the dialog names the source and
3119
+ * lets it be changed.
3120
+ */
3121
+ export declare const pickPrefillSource: (order: string[], records: Map<string, BaseUser>) => string | null;
3122
+
1863
3123
  /** Which mutation is asking for positions to be (re)assigned. */
1864
3124
  export declare type PositionAction = 'add' | 'update' | 'remove' | 'move' | 'payload';
1865
3125
 
@@ -1897,6 +3157,19 @@ export declare type PositionOption<TItem> = false | keyof TItem | {
1897
3157
  */
1898
3158
  export declare type PositionStrategy = 'renumber' | 'preserve-values';
1899
3159
 
3160
+ /**
3161
+ * The status the backend answered with, or null when nothing ever answered.
3162
+ *
3163
+ * Read off the axios failure the mapped error kept as its cause, not off the class. Going by class
3164
+ * alone misses exactly the answers that exist *because* the backend replied with a body: a
3165
+ * validation failure is `AnzuApiValidationError`, a dependency conflict is
3166
+ * `AnzuApiDependencyExistsError`, and both are 422s that have to be reported as such. Reported as
3167
+ * "the system did not answer" they would send the operator looking for an outage instead of at the
3168
+ * account whose stored data no longer validates -- which, with legacy rows, is the failure that
3169
+ * happens most.
3170
+ */
3171
+ export declare const probeStatusFromError: (error: unknown) => number | null;
3172
+
1900
3173
  declare interface Props<TItem extends Record<string, any>> {
1901
3174
  /**
1902
3175
  * New-row factory. Add / "add after" insert `factory()` through the controller
@@ -2256,6 +3529,8 @@ declare interface Props_4 {
2256
3529
  */
2257
3530
  export declare function provideListEditorStateScope(inherited: ListEditorStateScope | null): ListEditorStateScope;
2258
3531
 
3532
+ export declare const readMetadataField: (user: BaseUser, field: UserMetadataField) => string;
3533
+
2259
3534
  /**
2260
3535
  * Non-mutating renumber to sequential positions matching array order — the same
2261
3536
  * renumbering the editors apply on commit. Unchanged items stay reference-equal.
@@ -2285,15 +3560,57 @@ declare interface ReorderToggleSlotProps {
2285
3560
  };
2286
3561
  }
2287
3562
 
2288
- declare interface ReorderToggleSlotProps_2 {
2289
- mode: ReorderMode_2;
2290
- disabled: boolean;
2291
- hasPendingChanges: boolean;
2292
- actions: {
2293
- enterReorderMode: () => void;
2294
- exitReorderMode: () => void;
2295
- };
2296
- }
3563
+ declare interface ReorderToggleSlotProps_2 {
3564
+ mode: ReorderMode_2;
3565
+ disabled: boolean;
3566
+ hasPendingChanges: boolean;
3567
+ actions: {
3568
+ enterReorderMode: () => void;
3569
+ exitReorderMode: () => void;
3570
+ };
3571
+ }
3572
+
3573
+ /** Creating an account goes the same way a write does. */
3574
+ export declare const resolveCreateEndpoint: (descriptor: AnyUserSystemDescriptor) => string;
3575
+
3576
+ /**
3577
+ * `enabled` has no `PATCH` anywhere: the only method that calls `setEnabled` is the full update.
3578
+ * So it goes GET + PUT, on the same path, with the whole DTO the GET returned.
3579
+ */
3580
+ export declare const resolveEnabledWrite: (descriptor: AnyUserSystemDescriptor) => {
3581
+ get: string;
3582
+ url: string;
3583
+ };
3584
+
3585
+ /**
3586
+ * Metadata is written through `PATCH /adm/users/{id}` wherever that path exists: the method behind
3587
+ * it can only write e-mail, locale, avatar and person -- it has no setter for roles, permissions,
3588
+ * groups or `enabled`. That is a stronger guarantee than being careful about what goes in the body.
3589
+ */
3590
+ export declare const resolveMetadataWrite: (descriptor: AnyUserSystemDescriptor) => {
3591
+ method: "PATCH";
3592
+ get: string;
3593
+ url: string;
3594
+ } | {
3595
+ method: "PUT";
3596
+ get: string;
3597
+ url: string;
3598
+ };
3599
+
3600
+ /**
3601
+ * The pair the probe reads through, with the one invariant the type cannot state: both branches of
3602
+ * `endpoints` are nullable, so nothing stops a descriptor naming `probe: 'base'` on a system that
3603
+ * has no `/adm/users`. Every admin's descriptor test asserts this resolves for each of its
3604
+ * systems.
3605
+ */
3606
+ export declare const resolveProbeEndpoint: (descriptor: AnyUserSystemDescriptor) => AnzuUserEndpointPair;
3607
+
3608
+ /**
3609
+ * The single closed function from axes to what is drawn. Order matters: a system switched off in
3610
+ * configuration is reported as such whatever else is known about it, and access is decided before
3611
+ * presence because a forbidden record is not an absent one.
3612
+ */
3613
+ export declare const resolveUserSystemState: (axes: UserSystemAxes) => UserSystemStateType;
2297
3614
 
2298
3615
  declare interface RowActions<TItem> {
2299
3616
  edit: () => void;
@@ -2503,6 +3820,9 @@ declare const SortOrder: {
2503
3820
 
2504
3821
  declare type SortOrderType = (typeof SortOrder)[keyof typeof SortOrder];
2505
3822
 
3823
+ /** Systems whose stored value differs from the one about to be written. Nothing else is touched. */
3824
+ export declare const systemsNeedingWrite: (target: BaseUser, records: Map<string, BaseUser>, fields?: readonly UserMetadataField[]) => string[];
3825
+
2506
3826
  export declare const TimeIntervalSpecialOptions: {
2507
3827
  readonly CurrentMonth: "cm";
2508
3828
  readonly LastMonth: "lm";
@@ -2558,6 +3878,241 @@ declare type UrlParams = {
2558
3878
  [key: string]: number | string;
2559
3879
  };
2560
3880
 
3881
+ /**
3882
+ * Per instance, like every other actions composable here. The admins' versions kept their loading
3883
+ * flags at module scope.
3884
+ */
3885
+ export declare const useAnzuUserActions: (params: AnzuUserActionsParams) => {
3886
+ isDirty: ComputedRef<boolean>;
3887
+ /** Takes the record as it stands as the new baseline; the page calls it after it seeds one. */
3888
+ markPristine: () => void;
3889
+ anzuUserList: Ref<{
3890
+ enabled: boolean;
3891
+ locale: LanguageCode | null;
3892
+ roles: string[];
3893
+ permissionGroups: IntegerId[];
3894
+ permissions: Permissions_2;
3895
+ resolvedPermissions: Permissions_2;
3896
+ _resourceName: string;
3897
+ _system: string;
3898
+ createdAt: DatetimeUTC;
3899
+ modifiedAt: DatetimeUTC;
3900
+ modifiedBy: IntegerIdNullable;
3901
+ createdBy: IntegerIdNullable;
3902
+ id?: IntegerIdNullable | undefined;
3903
+ email: string;
3904
+ person: {
3905
+ firstName: string;
3906
+ lastName: string;
3907
+ fullName: string;
3908
+ };
3909
+ avatar: {
3910
+ color: string;
3911
+ text: string;
3912
+ };
3913
+ }[], AnzuUser[] | {
3914
+ enabled: boolean;
3915
+ locale: LanguageCode | null;
3916
+ roles: string[];
3917
+ permissionGroups: IntegerId[];
3918
+ permissions: Permissions_2;
3919
+ resolvedPermissions: Permissions_2;
3920
+ _resourceName: string;
3921
+ _system: string;
3922
+ createdAt: DatetimeUTC;
3923
+ modifiedAt: DatetimeUTC;
3924
+ modifiedBy: IntegerIdNullable;
3925
+ createdBy: IntegerIdNullable;
3926
+ id?: IntegerIdNullable | undefined;
3927
+ email: string;
3928
+ person: {
3929
+ firstName: string;
3930
+ lastName: string;
3931
+ fullName: string;
3932
+ };
3933
+ avatar: {
3934
+ color: string;
3935
+ text: string;
3936
+ };
3937
+ }[]>;
3938
+ loadingAnzuUserList: Ref<boolean, boolean>;
3939
+ datatableHiddenColumns: Ref<string[], string[]>;
3940
+ fetchAnzuUserList: (pagination: Ref<Pagination>, filterData: FilterData<any>, filterConfig: FilterConfig<any>) => Promise<void>;
3941
+ cancelAnzuUserList: () => void;
3942
+ anzuUser: Ref<{
3943
+ enabled: boolean;
3944
+ locale: LanguageCode | null;
3945
+ roles: string[];
3946
+ permissionGroups: IntegerId[];
3947
+ permissions: Permissions_2;
3948
+ resolvedPermissions: Permissions_2;
3949
+ _resourceName: string;
3950
+ _system: string;
3951
+ createdAt: DatetimeUTC;
3952
+ modifiedAt: DatetimeUTC;
3953
+ modifiedBy: IntegerIdNullable;
3954
+ createdBy: IntegerIdNullable;
3955
+ id?: IntegerIdNullable | undefined;
3956
+ email: string;
3957
+ person: {
3958
+ firstName: string;
3959
+ lastName: string;
3960
+ fullName: string;
3961
+ };
3962
+ avatar: {
3963
+ color: string;
3964
+ text: string;
3965
+ };
3966
+ }, AnzuUser | {
3967
+ enabled: boolean;
3968
+ locale: LanguageCode | null;
3969
+ roles: string[];
3970
+ permissionGroups: IntegerId[];
3971
+ permissions: Permissions_2;
3972
+ resolvedPermissions: Permissions_2;
3973
+ _resourceName: string;
3974
+ _system: string;
3975
+ createdAt: DatetimeUTC;
3976
+ modifiedAt: DatetimeUTC;
3977
+ modifiedBy: IntegerIdNullable;
3978
+ createdBy: IntegerIdNullable;
3979
+ id?: IntegerIdNullable | undefined;
3980
+ email: string;
3981
+ person: {
3982
+ firstName: string;
3983
+ lastName: string;
3984
+ fullName: string;
3985
+ };
3986
+ avatar: {
3987
+ color: string;
3988
+ text: string;
3989
+ };
3990
+ }>;
3991
+ loadingAnzuUser: Ref<boolean, boolean>;
3992
+ fetchAnzuUser: (id: IntegerId) => Promise<void>;
3993
+ createAnzuUser: () => Promise<AnzuUser | null>;
3994
+ updateAnzuUser: () => Promise<boolean>;
3995
+ loadingCreateAnzuUser: Ref<boolean, boolean>;
3996
+ loadingUpdateAnzuUser: Ref<boolean, boolean>;
3997
+ resetAnzuUserStore: (system?: string, resourceName?: string) => void;
3998
+ };
3999
+
4000
+ /**
4001
+ * Generic in the user type, because the three systems that answer on `/adm/users` return a DTO of
4002
+ * their own -- `CmsUserDto`, `DamUserDto`, `ContentHubUserDto` -- each extending `UserDto` with
4003
+ * system fields. Losing those in the round trip is exactly what the write invariant forbids: the
4004
+ * body of a write is the whole object the preceding GET returned.
4005
+ */
4006
+ export declare const useAnzuUserApi: <T extends AnzuUser = AnzuUser>({ client, system, entity, validationSystem, validationEntity, endPoint, }: AnzuUserApiParams) => {
4007
+ useFetchAnzuUserListByIds: () => UseApiFetchByIdsReturnType<T>;
4008
+ useFetchAnzuUserList: () => UseApiFetchListReturnType<T>;
4009
+ useFetchAnzuUser: () => UseApiRequestReturnType<T, null>;
4010
+ useCreateAnzuUser: () => UseApiRequestReturnType<T, T>;
4011
+ useUpdateAnzuUser: () => UseApiRequestReturnType<T, T>;
4012
+ usePatchBaseUser: (patchEndPoint: string) => UseApiRequestReturnType<T, T>;
4013
+ };
4014
+
4015
+ /**
4016
+ * Exact match on e-mail, for the cross-system search.
4017
+ *
4018
+ * `startsWith` -- what the list filter uses and what admin-inhouse's search used -- cannot answer
4019
+ * the question that search asks. "Is this person here under this address" has to be `eq`, or
4020
+ * `jozko@sme.sk` matches `jozko.mrkvicka@sme.sk` and the fan-out reports the wrong identity.
4021
+ */
4022
+ export declare function useAnzuUserEmailLookupFilter(): {
4023
+ filterConfig: FilterConfig<{
4024
+ name: "email";
4025
+ variant: "eq";
4026
+ default: null;
4027
+ type: "string";
4028
+ }[]>;
4029
+ filterData: FilterData<{
4030
+ name: "email";
4031
+ variant: "eq";
4032
+ default: null;
4033
+ type: "string";
4034
+ }[]>;
4035
+ };
4036
+
4037
+ /**
4038
+ * The three fields every system has, plus whatever that system adds.
4039
+ *
4040
+ * The extras are a parameter rather than fields in the list above because the same filter is not
4041
+ * the same query everywhere: cms asks for permission groups with `memberOf` and dam with `custom`,
4042
+ * and cms has `allowedSites`, which exists nowhere else. Hard-coding either variant would send the
4043
+ * wrong query to the other backend, and leaving them out costs those two lists filters they have
4044
+ * today.
4045
+ *
4046
+ * `AFilterWrapper` draws any field that is not `render.skip` by itself, so a plain extra field
4047
+ * needs nothing else; one that wants its own widget -- a remote autocomplete -- is passed through
4048
+ * the matching slot.
4049
+ */
4050
+ export declare function useAnzuUserListFilter<E extends readonly MakeFilterOption[] = []>(system: string, extraFields?: E): {
4051
+ filterConfig: FilterConfig<readonly [...ListFields_2, ...E]>;
4052
+ filterData: FilterData<readonly [...ListFields_2, ...E]>;
4053
+ };
4054
+
4055
+ /**
4056
+ * The one user the owning form is editing. Cross-system pages do not use this -- they hold a
4057
+ * result per system and never a single "current" user -- so it stays a single record, the way the
4058
+ * admins have it.
4059
+ */
4060
+ export declare const useAnzuUserOneStore: SetupStoreDefinition<"labsAnzuUserOneStore", {
4061
+ anzuUser: Ref<{
4062
+ enabled: boolean;
4063
+ locale: LanguageCode | null;
4064
+ roles: string[];
4065
+ permissionGroups: IntegerId[];
4066
+ permissions: Permissions_2;
4067
+ resolvedPermissions: Permissions_2;
4068
+ _resourceName: string;
4069
+ _system: string;
4070
+ createdAt: DatetimeUTC;
4071
+ modifiedAt: DatetimeUTC;
4072
+ modifiedBy: IntegerIdNullable;
4073
+ createdBy: IntegerIdNullable;
4074
+ id?: IntegerIdNullable | undefined;
4075
+ email: string;
4076
+ person: {
4077
+ firstName: string;
4078
+ lastName: string;
4079
+ fullName: string;
4080
+ };
4081
+ avatar: {
4082
+ color: string;
4083
+ text: string;
4084
+ };
4085
+ }, AnzuUser | {
4086
+ enabled: boolean;
4087
+ locale: LanguageCode | null;
4088
+ roles: string[];
4089
+ permissionGroups: IntegerId[];
4090
+ permissions: Permissions_2;
4091
+ resolvedPermissions: Permissions_2;
4092
+ _resourceName: string;
4093
+ _system: string;
4094
+ createdAt: DatetimeUTC;
4095
+ modifiedAt: DatetimeUTC;
4096
+ modifiedBy: IntegerIdNullable;
4097
+ createdBy: IntegerIdNullable;
4098
+ id?: IntegerIdNullable | undefined;
4099
+ email: string;
4100
+ person: {
4101
+ firstName: string;
4102
+ lastName: string;
4103
+ fullName: string;
4104
+ };
4105
+ avatar: {
4106
+ color: string;
4107
+ text: string;
4108
+ };
4109
+ }>;
4110
+ loadingAnzuUser: Ref<boolean, boolean>;
4111
+ setAnzuUser: (newAnzuUser: AnzuUser) => void;
4112
+ setLoadingAnzuUser: (loading: boolean) => void;
4113
+ reset: (system?: string, resourceName?: string) => void;
4114
+ }>;
4115
+
2561
4116
  /**
2562
4117
  * A request that asks the backend to do something and reads nothing back -- a delete, or a call that
2563
4118
  * only starts work and answers 202. Any successful status resolves; a body, if one arrives, is
@@ -2571,6 +4126,9 @@ export declare type UseApiFetchByIdsParams = {
2571
4126
  client: AxiosClientFn;
2572
4127
  system: string;
2573
4128
  entity: string;
4129
+ /** i18n scope for field-level validation failures; defaults to `system` / `entity`. */
4130
+ validationSystem?: string;
4131
+ validationEntity?: string;
2574
4132
  urlTemplate?: string;
2575
4133
  urlParams?: UrlParams;
2576
4134
  /** Anything axios takes except what this helper decides: the method, the url, the body and the signal. */
@@ -2637,6 +4195,9 @@ export declare type UseApiFetchItemsParams = {
2637
4195
  client: AxiosClientFn;
2638
4196
  system: string;
2639
4197
  entity: string;
4198
+ /** i18n scope for field-level validation failures; defaults to `system` / `entity`. */
4199
+ validationSystem?: string;
4200
+ validationEntity?: string;
2640
4201
  /**
2641
4202
  * The url, query and all: whatever built the query has already run by the time it gets here.
2642
4203
  *
@@ -2701,6 +4262,9 @@ export declare type UseApiFetchListBatchParams = {
2701
4262
  client: AxiosClientFn;
2702
4263
  system: string;
2703
4264
  entity: string;
4265
+ /** i18n scope for field-level validation failures; defaults to `system` / `entity`. */
4266
+ validationSystem?: string;
4267
+ validationEntity?: string;
2704
4268
  urlTemplate?: string;
2705
4269
  urlParams?: UrlParams;
2706
4270
  /** Anything axios takes except what this helper decides: the method, the url, the body and the signal. */
@@ -2741,6 +4305,9 @@ export declare type UseApiFetchListParams = {
2741
4305
  client: AxiosClientFn;
2742
4306
  system: string;
2743
4307
  entity: string;
4308
+ /** i18n scope for field-level validation failures; defaults to `system` / `entity`. */
4309
+ validationSystem?: string;
4310
+ validationEntity?: string;
2744
4311
  urlTemplate?: string;
2745
4312
  urlParams?: UrlParams;
2746
4313
  /** Anything axios takes except what this helper decides: the method, the url, the body and the signal. */
@@ -2820,6 +4387,9 @@ export declare type UseApiRequestParams = {
2820
4387
  method: Method;
2821
4388
  system: string;
2822
4389
  entity: string;
4390
+ /** i18n scope for field-level validation failures; defaults to `system` / `entity`. */
4391
+ validationSystem?: string;
4392
+ validationEntity?: string;
2823
4393
  urlTemplate?: string;
2824
4394
  urlParams?: UrlParams;
2825
4395
  /** Anything axios takes except what this helper decides: the method, the url, the body and the signal. */
@@ -2854,6 +4424,20 @@ export declare type UseApiRequestReturnType<R, B> = {
2854
4424
  loading: Ref<boolean>;
2855
4425
  };
2856
4426
 
4427
+ export declare const useCachedPermissionGroups: (params: CachedPermissionGroupsParams) => {
4428
+ cachedPermissionGroups: Ref<Map<number, CachedItem<PermissionGroupMinimal>>, Map<number, CachedItem<PermissionGroupMinimal>>>;
4429
+ toFetchCachedPermissionGroups: Ref<Set<number>, Set<number>>;
4430
+ fetchCachedPermissionGroups: () => Promisify<Promise<PermissionGroup[]>>;
4431
+ immediateFetchCachedPermissionGroups: () => Promise<PermissionGroup[]>;
4432
+ addToCachedPermissionGroups: (...args: AddToCachedArgs<number>) => void;
4433
+ addManualToCachedPermissionGroups: (data: PermissionGroup) => void;
4434
+ addManualMinimalToCachedPermissionGroups: (data: PermissionGroupMinimal) => void;
4435
+ hasCachedPermissionGroup: (id: number | null | undefined) => boolean;
4436
+ getCachedPermissionGroup: (id: number | null | undefined) => CachedItem<PermissionGroupMinimal> | undefined;
4437
+ isLoadedCachedPermissionGroup: (id: number | null | undefined) => boolean;
4438
+ clearCachedPermissionGroups: () => void;
4439
+ };
4440
+
2857
4441
  declare type UseCachedType = () => {
2858
4442
  fetch: any;
2859
4443
  add: any;
@@ -3228,6 +4812,306 @@ declare interface UsePaginationReturnType {
3228
4812
  incrementPage: () => number;
3229
4813
  }
3230
4814
 
4815
+ /**
4816
+ * Builds the grant map a user would end up with, for the editor's "resolved" column, out of what
4817
+ * the page already holds: the groups the user is in plus the grants set on the user directly.
4818
+ *
4819
+ * It is not the backend's `resolvedPermissions`. That one arrives with the record and includes
4820
+ * roles; this one is what the screen would send if saved now, so the editor can show the effect of
4821
+ * a group the operator has just ticked without a round trip.
4822
+ */
4823
+ export declare const usePermissionActions: (params: PermissionActionsParams) => {
4824
+ resolvePermissions: (user: AnzuUser) => Permissions_2;
4825
+ resolveGroupPermissions: (permissionGroupIds: IntegerId[]) => Permissions_2;
4826
+ };
4827
+
4828
+ export declare const usePermissionConfigActions: (params: PermissionConfigActionsParams) => {
4829
+ permissionConfig: ComputedRef<PermissionConfig>;
4830
+ loadingPermissionConfig: ComputedRef<boolean>;
4831
+ isPermissionConfigInitialized: ComputedRef<boolean>;
4832
+ fetchPermissionConfig: (force?: boolean) => Promise<void>;
4833
+ translatePermission: (group: PermissionTranslationGroup, key: string) => string;
4834
+ resetPermissionConfig: () => void;
4835
+ };
4836
+
4837
+ export declare const usePermissionConfigApi: ({ client, system, entity, endPoint, }: PermissionConfigApiParams) => {
4838
+ useFetchPermissionConfig: () => UseApiRequestReturnType<PermissionConfig, null>;
4839
+ };
4840
+
4841
+ export declare const usePermissionConfigStore: SetupStoreDefinition<"labsPermissionConfigStore", {
4842
+ entries: Ref<Map<string, {
4843
+ config: {
4844
+ roles: string[];
4845
+ defaultGrants: GrantType[];
4846
+ config: {
4847
+ [subject: string]: {
4848
+ [action: string]: {
4849
+ grants?: GrantType[];
4850
+ };
4851
+ };
4852
+ };
4853
+ translation: {
4854
+ subjects: {
4855
+ [subject: string]: {
4856
+ [lang: string]: string;
4857
+ };
4858
+ };
4859
+ actions: {
4860
+ [action: string]: {
4861
+ [lang: string]: string;
4862
+ };
4863
+ };
4864
+ roles: {
4865
+ [role: string]: {
4866
+ [lang: string]: string;
4867
+ };
4868
+ };
4869
+ };
4870
+ };
4871
+ loading: boolean;
4872
+ initialized: boolean;
4873
+ }> & Omit<Map<string, PermissionConfigEntry>, keyof Map<any, any>>, Map<string, PermissionConfigEntry> | (Map<string, {
4874
+ config: {
4875
+ roles: string[];
4876
+ defaultGrants: GrantType[];
4877
+ config: {
4878
+ [subject: string]: {
4879
+ [action: string]: {
4880
+ grants?: GrantType[];
4881
+ };
4882
+ };
4883
+ };
4884
+ translation: {
4885
+ subjects: {
4886
+ [subject: string]: {
4887
+ [lang: string]: string;
4888
+ };
4889
+ };
4890
+ actions: {
4891
+ [action: string]: {
4892
+ [lang: string]: string;
4893
+ };
4894
+ };
4895
+ roles: {
4896
+ [role: string]: {
4897
+ [lang: string]: string;
4898
+ };
4899
+ };
4900
+ };
4901
+ };
4902
+ loading: boolean;
4903
+ initialized: boolean;
4904
+ }> & Omit<Map<string, PermissionConfigEntry>, keyof Map<any, any>>)>;
4905
+ getEntry: (system: string) => PermissionConfigEntry;
4906
+ setLoading: (system: string, loading: boolean) => void;
4907
+ setConfig: (system: string, config: PermissionConfig) => void;
4908
+ resetSystem: (system: string) => void;
4909
+ reset: () => void;
4910
+ }>;
4911
+
4912
+ /**
4913
+ * Everything below is per instance. The admins kept `listLoading`, `detailLoading` and
4914
+ * `datatableHiddenColumns` at module scope, which is a single set of flags shared by every caller
4915
+ * -- fine for one list on one backend, wrong for a library a page may instantiate twice.
4916
+ */
4917
+ export declare const usePermissionGroupActions: (params: PermissionGroupActionsParams) => {
4918
+ datatableHiddenColumns: Ref<string[], string[]>;
4919
+ permissionGroupList: Ref<{
4920
+ description: string;
4921
+ _system: string;
4922
+ _resourceName: "permissionGroup";
4923
+ id: IntegerId;
4924
+ title: string;
4925
+ permissions: Permissions_2;
4926
+ createdAt: DatetimeUTC;
4927
+ modifiedAt: DatetimeUTC;
4928
+ modifiedBy: IntegerIdNullable;
4929
+ createdBy: IntegerIdNullable;
4930
+ }[], PermissionGroup[] | {
4931
+ description: string;
4932
+ _system: string;
4933
+ _resourceName: "permissionGroup";
4934
+ id: IntegerId;
4935
+ title: string;
4936
+ permissions: Permissions_2;
4937
+ createdAt: DatetimeUTC;
4938
+ modifiedAt: DatetimeUTC;
4939
+ modifiedBy: IntegerIdNullable;
4940
+ createdBy: IntegerIdNullable;
4941
+ }[]>;
4942
+ loadingPermissionGroupList: Ref<boolean, boolean>;
4943
+ fetchPermissionGroupList: (pagination: Ref<Pagination>, filterData: FilterData<any>, filterConfig: FilterConfig<any>) => Promise<void>;
4944
+ cancelPermissionGroupList: () => void;
4945
+ permissionGroup: Ref<{
4946
+ description: string;
4947
+ _system: string;
4948
+ _resourceName: "permissionGroup";
4949
+ id: IntegerId;
4950
+ title: string;
4951
+ permissions: Permissions_2;
4952
+ createdAt: DatetimeUTC;
4953
+ modifiedAt: DatetimeUTC;
4954
+ modifiedBy: IntegerIdNullable;
4955
+ createdBy: IntegerIdNullable;
4956
+ }, PermissionGroup | {
4957
+ description: string;
4958
+ _system: string;
4959
+ _resourceName: "permissionGroup";
4960
+ id: IntegerId;
4961
+ title: string;
4962
+ permissions: Permissions_2;
4963
+ createdAt: DatetimeUTC;
4964
+ modifiedAt: DatetimeUTC;
4965
+ modifiedBy: IntegerIdNullable;
4966
+ createdBy: IntegerIdNullable;
4967
+ }>;
4968
+ loadingPermissionGroup: Ref<boolean, boolean>;
4969
+ fetchPermissionGroup: (id: IntegerId) => Promise<void>;
4970
+ createPermissionGroup: () => Promise<PermissionGroup | null>;
4971
+ updatePermissionGroup: () => Promise<boolean>;
4972
+ deletePermissionGroup: (id: IntegerId) => Promise<boolean>;
4973
+ loadingCreatePermissionGroup: Ref<boolean, boolean>;
4974
+ loadingUpdatePermissionGroup: Ref<boolean, boolean>;
4975
+ loadingDeletePermissionGroup: Ref<boolean, boolean>;
4976
+ fetchPermissionGroupOptions: (pagination: Ref<Pagination>, filterData: FilterData<any>, filterConfig: FilterConfig<any>) => Promise<ValueObjectOption<IntegerId>[]>;
4977
+ fetchPermissionGroupOptionsByIds: (ids: IntegerId[]) => Promise<ValueObjectOption<IntegerId>[]>;
4978
+ resetPermissionGroupStore: () => void;
4979
+ };
4980
+
4981
+ export declare const usePermissionGroupApi: ({ client, system, entity, validationSystem, validationEntity, endPoint, }: PermissionGroupApiParams) => {
4982
+ useFetchPermissionGroupListByIds: () => UseApiFetchByIdsReturnType<PermissionGroup>;
4983
+ useFetchPermissionGroupList: () => UseApiFetchListReturnType<PermissionGroup>;
4984
+ useFetchPermissionGroup: () => UseApiRequestReturnType<PermissionGroup, null>;
4985
+ useCreatePermissionGroup: () => UseApiRequestReturnType<PermissionGroup, PermissionGroup>;
4986
+ useUpdatePermissionGroup: () => UseApiRequestReturnType<PermissionGroup, PermissionGroup>;
4987
+ useDeletePermissionGroup: () => UseApiRequestReturnType<void, null>;
4988
+ };
4989
+
4990
+ export declare function usePermissionGroupInnerFilter(): {
4991
+ filterConfig: FilterConfig<{
4992
+ name: "title";
4993
+ variant: "startsWith";
4994
+ default: null;
4995
+ type: "string";
4996
+ }[]>;
4997
+ filterData: FilterData<{
4998
+ name: "title";
4999
+ variant: "startsWith";
5000
+ default: null;
5001
+ type: "string";
5002
+ }[]>;
5003
+ };
5004
+
5005
+ export declare function usePermissionGroupListFilter(system: string): {
5006
+ filterConfig: FilterConfig<ListFields>;
5007
+ filterData: FilterData<ListFields>;
5008
+ };
5009
+
5010
+ /**
5011
+ * A single open group, not a map keyed by system.
5012
+ *
5013
+ * Decision 9 of the plan: one system is one route and one view, and there is no cross-system view
5014
+ * of permission groups at all. Only one group is ever open, so a per-system map would be state
5015
+ * nothing reads -- unlike the config store next door, which really is asked about several systems
5016
+ * at once by the cross-system user pages.
5017
+ */
5018
+ export declare const usePermissionGroupOneStore: SetupStoreDefinition<"labsPermissionGroupOneStore", {
5019
+ permissionGroup: Ref<{
5020
+ description: string;
5021
+ _system: string;
5022
+ _resourceName: "permissionGroup";
5023
+ id: IntegerId;
5024
+ title: string;
5025
+ permissions: Permissions_2;
5026
+ createdAt: DatetimeUTC;
5027
+ modifiedAt: DatetimeUTC;
5028
+ modifiedBy: IntegerIdNullable;
5029
+ createdBy: IntegerIdNullable;
5030
+ }, PermissionGroup | {
5031
+ description: string;
5032
+ _system: string;
5033
+ _resourceName: "permissionGroup";
5034
+ id: IntegerId;
5035
+ title: string;
5036
+ permissions: Permissions_2;
5037
+ createdAt: DatetimeUTC;
5038
+ modifiedAt: DatetimeUTC;
5039
+ modifiedBy: IntegerIdNullable;
5040
+ createdBy: IntegerIdNullable;
5041
+ }>;
5042
+ loadingPermissionGroup: Ref<boolean, boolean>;
5043
+ setPermissionGroup: (newPermissionGroup: PermissionGroup) => void;
5044
+ setLoadingPermissionGroup: (loading: boolean) => void;
5045
+ reset: () => void;
5046
+ }>;
5047
+
5048
+ /**
5049
+ * The same three rules all five admins carry today, verbatim. They are not derived from the
5050
+ * backend: `PermissionGroupDto` only requires a title, and the lengths here are the front-end's
5051
+ * own stricter profile.
5052
+ */
5053
+ export declare function usePermissionGroupValidation(permissionGroup: Ref<PermissionGroup>): {
5054
+ v$: Ref< Validation<{
5055
+ permissionGroup: {
5056
+ title: {
5057
+ required: ValidationRuleWithoutParams<any>;
5058
+ minLength: ValidationRuleWithParams<{
5059
+ min: number;
5060
+ }, any>;
5061
+ maxLength: ValidationRuleWithParams<{
5062
+ max: number;
5063
+ }, any>;
5064
+ };
5065
+ description: {
5066
+ maxLength: ValidationRuleWithParams<{
5067
+ max: number;
5068
+ }, any>;
5069
+ };
5070
+ };
5071
+ }, {
5072
+ permissionGroup: Ref<PermissionGroup, PermissionGroup>;
5073
+ }>, Validation<{
5074
+ permissionGroup: {
5075
+ title: {
5076
+ required: ValidationRuleWithoutParams<any>;
5077
+ minLength: ValidationRuleWithParams<{
5078
+ min: number;
5079
+ }, any>;
5080
+ maxLength: ValidationRuleWithParams<{
5081
+ max: number;
5082
+ }, any>;
5083
+ };
5084
+ description: {
5085
+ maxLength: ValidationRuleWithParams<{
5086
+ max: number;
5087
+ }, any>;
5088
+ };
5089
+ };
5090
+ }, {
5091
+ permissionGroup: Ref<PermissionGroup, PermissionGroup>;
5092
+ }>>;
5093
+ };
5094
+
5095
+ /**
5096
+ * The six fields the cross-system view compares.
5097
+ *
5098
+ * `email` is in the list and is also the reason the e-mail search runs twice: if a person is
5099
+ * `jozko@sme.sk` in weather and `j.mrkvicka@sme.sk` in blog, a search by e-mail finds weather and
5100
+ * blog answers nothing -- which looks exactly like "no account here". The second round, by the id
5101
+ * the first round found, is what turns that silence into the inconsistency it actually is.
5102
+ */
5103
+ export declare const USER_METADATA_FIELDS: readonly ["email", "person.firstName", "person.lastName", "person.fullName", "avatar.color", "avatar.text"];
5104
+
5105
+ /**
5106
+ * What the probe calls itself in the error context.
5107
+ *
5108
+ * A 404 here is an answer, not a failure -- it is how a system says "no account of yours". It still
5109
+ * reaches the api error logger like any other, so an app filters on this together with the status
5110
+ * rather than on the url, which would also silence a real detail read of the same path. The
5111
+ * validation scope stays the user's, so a field error would still name a real label.
5112
+ */
5113
+ export declare const USER_PROBE_ENTITY = "anzuUserProbe";
5114
+
3231
5115
  export declare interface UserAdminConfig<TData = UserAdminConfigDataFilterBookmark | UserAdminConfigDataPinnedWidgets> extends AnzuUserAndTimeTrackingAware, SortableItemDataAware {
3232
5116
  id: IntegerId;
3233
5117
  user: IntegerId;
@@ -3271,6 +5155,215 @@ export declare const UserAdminConfigTypeDefault: "pinnedWidgets";
3271
5155
 
3272
5156
  export declare type UserAdminConfigTypeType = (typeof UserAdminConfigType)[keyof typeof UserAdminConfigType];
3273
5157
 
5158
+ export declare type UserMetadataField = (typeof USER_METADATA_FIELDS)[number];
5159
+
5160
+ export declare interface UserMetadataValidationOptions {
5161
+ /**
5162
+ * The system's profile (`requiredMetadata` on its descriptor). `false` requires only the
5163
+ * e-mail; `true` also requires first name, last name, full name, avatar text and avatar colour.
5164
+ * It applies the same way to creating and to editing -- within a system it is one rule.
5165
+ */
5166
+ required: MaybeRefOrGetter<boolean>;
5167
+ /** Whether the id is a field at all. When it is, and this is a create, it is required. */
5168
+ idInput: MaybeRefOrGetter<boolean>;
5169
+ isEdit: MaybeRefOrGetter<boolean>;
5170
+ /** Scope key, so an owning form can validate its own fields alongside the app's system fields. */
5171
+ scope?: string | symbol | false;
5172
+ }
5173
+
5174
+ export declare const UserSystemAccess: {
5175
+ readonly Ok: "ok";
5176
+ readonly Forbidden: "forbidden";
5177
+ readonly Unauthenticated: "unauthenticated";
5178
+ readonly Unavailable: "unavailable";
5179
+ readonly ConfigDisabled: "configDisabled";
5180
+ };
5181
+
5182
+ export declare type UserSystemAccessType = (typeof UserSystemAccess)[keyof typeof UserSystemAccess];
5183
+
5184
+ /**
5185
+ * `enabled` is one of the axes and not a detail: without it the two states the cross-system view
5186
+ * shows most often -- "the account is here and on" versus "here and off" -- cannot be told apart.
5187
+ *
5188
+ * Ownership is deliberately *not* an axis. None of the six visual states below distinguishes it;
5189
+ * it decides which button is drawn, and that is the descriptor's `manage` union.
5190
+ */
5191
+ export declare interface UserSystemAxes {
5192
+ load: UserSystemLoadType;
5193
+ presence: UserSystemPresenceType;
5194
+ access: UserSystemAccessType;
5195
+ enabled: boolean | 'unknown';
5196
+ }
5197
+
5198
+ export declare interface UserSystemDescriptor<TSystem extends string = string, TUser extends AnzuUser = AnzuUser> {
5199
+ system: TSystem;
5200
+ client: AxiosClientFn;
5201
+ /** Reaches every `useApiRequest` built for this system; see `permissionGroupApi`. */
5202
+ entity: string;
5203
+ /**
5204
+ * Whether the system is switched on in this admin's configuration. Mandatory, not optional: the
5205
+ * "disabled in configuration" state has to be *shown*, so leaving the system out of the array is
5206
+ * not the same thing. The value is app-specific (`envConfig[system].enabled`) and the library has
5207
+ * no way to read it.
5208
+ */
5209
+ isEnabled: () => boolean;
5210
+ /**
5211
+ * Which validation profile this system's form uses. `false` means only the e-mail is required;
5212
+ * `true` adds first name, last name, full name, avatar text and avatar colour. It is a property
5213
+ * of the system, and it is the same for creating and for editing.
5214
+ */
5215
+ requiredMetadata: boolean;
5216
+ /**
5217
+ * Whether the id is typed in. False only in cms, where the backend looks it up in SSO from the
5218
+ * e-mail. On an edit the field is read-only regardless.
5219
+ */
5220
+ idInput: boolean;
5221
+ extraState?: (user: TUser) => UserSystemExtraState | null;
5222
+ /** Above the `enabled` switch and in the row of a bulk action. */
5223
+ enabledNote?: string;
5224
+ /** In the metadata repair dialog and in the owning form. */
5225
+ metadataNote?: string;
5226
+ /** In the confirmation dialog when an account is created here. */
5227
+ createNote?: string;
5228
+ endpoints: UserSystemEndpoints;
5229
+ /** Added in task 2: the system's name as the app translates it. */
5230
+ label?: string;
5231
+ /** Added in task 2. */
5232
+ manage?: (user: TUser) => UserSystemManageTarget;
5233
+ }
5234
+
5235
+ /**
5236
+ * Paired GET + write paths, never loose urls.
5237
+ *
5238
+ * This is what makes the write invariant expressible: a write body is always the whole object the
5239
+ * preceding GET on the *same path* returned. The two paths return different DTOs -- `/adm/users`
5240
+ * in cms answers `CmsUserDto` and its PUT runs `updateRelations()` over seven scalars and twelve
5241
+ * collections -- so a GET from one path and a PUT to the other silently drops whatever the other
5242
+ * DTO carries.
5243
+ */
5244
+ export declare interface UserSystemEndpoints {
5245
+ anzuUser: AnzuUserEndpointPair | null;
5246
+ base: BaseUserEndpointPair | null;
5247
+ permissionGroup: string;
5248
+ /**
5249
+ * Per system, not one constant. contentHub's is `/adm/users/current`, and the admins had this
5250
+ * hard-coded as a single path shared by every backend.
5251
+ */
5252
+ currentUser: string;
5253
+ list: string;
5254
+ /**
5255
+ * Which pair the probe reads through. A field rather than something derived, because in dam the
5256
+ * choice is visible to the operator: `GET /adm/v1/anzu-user/{id}` has no gating at all while
5257
+ * `GET /adm/users/{id}` sits behind `DAM_USER_READ`, so only the second can ever render "you
5258
+ * have no access". The rule is "the probe goes the way the write goes".
5259
+ */
5260
+ probe: 'anzuUser' | 'base';
5261
+ }
5262
+
5263
+ /**
5264
+ * A state a system has on top of `enabled`, shown next to it. Today only two systems have one:
5265
+ * blog's `status` (guest / waiting_approval / active / ban / gdpr_deleted) and forum's
5266
+ * `settings.banned`. Both arrive with the record -- they are `#[Serialize]` on the entity -- so
5267
+ * rendering one costs no extra call.
5268
+ */
5269
+ export declare interface UserSystemExtraState {
5270
+ /** "blogger", "commenter" -- the app translates it; the library only prints it. */
5271
+ label: string;
5272
+ /** "active", "banned". */
5273
+ value: string;
5274
+ tone: 'ok' | 'warn' | 'error';
5275
+ }
5276
+
5277
+ /**
5278
+ * Four independent axes inside, one derived state outside.
5279
+ *
5280
+ * The axes are kept apart because they answer different questions and can move independently: a
5281
+ * system can be loaded and forbidden, or absent and still enabled in configuration. Collapsing
5282
+ * them into one enum early is what made the per-admin prototypes conflate "no access" with "no
5283
+ * account here" -- admin-cms's panel leaves `userExists` at null on any non-404 and offers
5284
+ * "Create" in a system the operator cannot even read.
5285
+ */
5286
+ export declare const UserSystemLoad: {
5287
+ readonly Idle: "idle";
5288
+ readonly Loading: "loading";
5289
+ readonly Loaded: "loaded";
5290
+ readonly Error: "error";
5291
+ };
5292
+
5293
+ export declare type UserSystemLoadType = (typeof UserSystemLoad)[keyof typeof UserSystemLoad];
5294
+
5295
+ /**
5296
+ * Where "manage in X" leads. A callback over the user rather than a static value: a global
5297
+ * descriptor does not know which row is being drawn.
5298
+ *
5299
+ * The return type is a discriminated union so the two cannot be confused in code either -- an
5300
+ * internal target is pushed through the router, an external one is an `<a href>` opened in a new
5301
+ * tab, and `href: null` is a configured-but-missing url, which renders disabled with a reason
5302
+ * rather than as a dead button.
5303
+ */
5304
+ export declare type UserSystemManageTarget = {
5305
+ kind: 'internal';
5306
+ to: RouteLocationRaw;
5307
+ } | {
5308
+ kind: 'external';
5309
+ href: string | null;
5310
+ };
5311
+
5312
+ export declare const UserSystemPresence: {
5313
+ readonly Present: "present";
5314
+ readonly Absent: "absent";
5315
+ readonly Unknown: "unknown";
5316
+ };
5317
+
5318
+ export declare type UserSystemPresenceType = (typeof UserSystemPresence)[keyof typeof UserSystemPresence];
5319
+
5320
+ export declare interface UserSystemProbeParams {
5321
+ descriptor: AnyUserSystemDescriptor;
5322
+ /** Usually injected once per page; passing it explicitly is for tests and one-off panels. */
5323
+ refreshHook?: UserSystemRefreshHook | undefined;
5324
+ }
5325
+
5326
+ export declare interface UserSystemProbeResult {
5327
+ axes: Ref<UserSystemAxes>;
5328
+ user: Ref<AnzuUser | null>;
5329
+ probe: (id: IntegerId) => Promise<void>;
5330
+ reset: () => void;
5331
+ cancel: () => void;
5332
+ }
5333
+
5334
+ /**
5335
+ * How an app refreshes a session for one system, and retries.
5336
+ *
5337
+ * The library cannot do this itself: a first 401 is ambiguous -- expired session or no account --
5338
+ * and the only way to tell them apart is to refresh and ask again. Every admin has its own
5339
+ * mechanism (`refreshSession.ts` in inhouse, an interceptor in cms, `requestRefreshToken.ts` in
5340
+ * blog) and none of them lives in `common-admin`. Without this hook a panel would show an expired
5341
+ * token as "no account here", which is exactly the confusion decision 16 forbids.
5342
+ *
5343
+ * Returns true when the refresh succeeded and the call is worth repeating.
5344
+ */
5345
+ export declare type UserSystemRefreshHook = (system: string) => Promise<boolean>;
5346
+
5347
+ export declare const UserSystemRefreshHookKey: InjectionKey<UserSystemRefreshHook>;
5348
+
5349
+ export declare interface UserSystemResult {
5350
+ axes: UserSystemAxes;
5351
+ user: AnzuUser | null;
5352
+ }
5353
+
5354
+ export declare const UserSystemState: {
5355
+ /** Nothing has been asked yet, or the answer is still on its way. */
5356
+ readonly Loading: "loading";
5357
+ readonly Enabled: "enabled";
5358
+ readonly Disabled: "disabled";
5359
+ readonly Absent: "absent";
5360
+ readonly Forbidden: "forbidden";
5361
+ readonly Unavailable: "unavailable";
5362
+ readonly ConfigDisabled: "configDisabled";
5363
+ };
5364
+
5365
+ export declare type UserSystemStateType = (typeof UserSystemState)[keyof typeof UserSystemState];
5366
+
3274
5367
  export declare function useSubjectSelect<TItem>(datatableConfig: any, datatableHiddenColumns: any, system: string, subject: string, execute: (pagination: Ref<Pagination>, filterData: FilterData<any>, filterConfig: FilterConfig<any>, params?: FetchListParams) => Promise<TItem[]>, filterData: FilterData<any>, filterConfig: FilterConfig<any>, filterSortBy?: DatatableSortBy | null, fetchParams?: FetchListParams | undefined, enableActions?: boolean): {
3275
5368
  items: Ref<TItem[], TItem[]>;
3276
5369
  selected: Ref<TItem[], TItem[]>;
@@ -3399,6 +5492,352 @@ export declare function useUserAdminConfigFactory(): {
3399
5492
  createDefaultUserAdminConfig: (system: string) => UserAdminConfig;
3400
5493
  };
3401
5494
 
5495
+ /**
5496
+ * The cross-system fan-out.
5497
+ *
5498
+ * No calls to the current-user endpoints go out at all: the buttons in a row are decided by the
5499
+ * probe's answer rather than by `<Acl>`, so there is nothing to load nine current users for. The
5500
+ * budget is nine calls when searching by id, eighteen when searching by e-mail.
5501
+ */
5502
+ export declare const useUserCrossSystemSearch: (params: CrossSystemSearchParams) => {
5503
+ search: (term: string) => Promise<boolean>;
5504
+ searchById: (id: IntegerId) => Promise<void>;
5505
+ searchByEmail: (email: string) => Promise<void>;
5506
+ refreshSystem: (system: string) => Promise<void>;
5507
+ resultFor: (system: string) => UserSystemResult | undefined;
5508
+ unresolvedSystems: ComputedRef<string[]>;
5509
+ cancel: () => void;
5510
+ };
5511
+
5512
+ /**
5513
+ * Search results and the bulk run live here, not inside the dialog's component.
5514
+ *
5515
+ * The dialog can be closed while the calls are still going -- one dead backend running into its
5516
+ * timeout must not lock the screen -- and state owned by the component would be thrown away with
5517
+ * it. The results stay on the page either way.
5518
+ */
5519
+ export declare const useUserCrossSystemStore: SetupStoreDefinition<"labsUserCrossSystemStore", {
5520
+ searchTerm: Ref<string, string>;
5521
+ resolvedId: Ref<IntegerIdNullable, IntegerIdNullable>;
5522
+ phase: Ref<CrossSystemPhaseType, CrossSystemPhaseType>;
5523
+ results: Ref<Map<string, {
5524
+ axes: {
5525
+ load: UserSystemLoadType;
5526
+ presence: UserSystemPresenceType;
5527
+ access: UserSystemAccessType;
5528
+ enabled: boolean | "unknown";
5529
+ };
5530
+ user: {
5531
+ enabled: boolean;
5532
+ locale: LanguageCode | null;
5533
+ roles: string[];
5534
+ permissionGroups: IntegerId[];
5535
+ permissions: Permissions_2;
5536
+ resolvedPermissions: Permissions_2;
5537
+ _resourceName: string;
5538
+ _system: string;
5539
+ createdAt: DatetimeUTC;
5540
+ modifiedAt: DatetimeUTC;
5541
+ modifiedBy: IntegerIdNullable;
5542
+ createdBy: IntegerIdNullable;
5543
+ id?: IntegerIdNullable | undefined;
5544
+ email: string;
5545
+ person: {
5546
+ firstName: string;
5547
+ lastName: string;
5548
+ fullName: string;
5549
+ };
5550
+ avatar: {
5551
+ color: string;
5552
+ text: string;
5553
+ };
5554
+ } | null;
5555
+ }> & Omit<Map<string, UserSystemResult>, keyof Map<any, any>>, Map<string, UserSystemResult> | (Map<string, {
5556
+ axes: {
5557
+ load: UserSystemLoadType;
5558
+ presence: UserSystemPresenceType;
5559
+ access: UserSystemAccessType;
5560
+ enabled: boolean | "unknown";
5561
+ };
5562
+ user: {
5563
+ enabled: boolean;
5564
+ locale: LanguageCode | null;
5565
+ roles: string[];
5566
+ permissionGroups: IntegerId[];
5567
+ permissions: Permissions_2;
5568
+ resolvedPermissions: Permissions_2;
5569
+ _resourceName: string;
5570
+ _system: string;
5571
+ createdAt: DatetimeUTC;
5572
+ modifiedAt: DatetimeUTC;
5573
+ modifiedBy: IntegerIdNullable;
5574
+ createdBy: IntegerIdNullable;
5575
+ id?: IntegerIdNullable | undefined;
5576
+ email: string;
5577
+ person: {
5578
+ firstName: string;
5579
+ lastName: string;
5580
+ fullName: string;
5581
+ };
5582
+ avatar: {
5583
+ color: string;
5584
+ text: string;
5585
+ };
5586
+ } | null;
5587
+ }> & Omit<Map<string, UserSystemResult>, keyof Map<any, any>>)>;
5588
+ identityConflict: Ref<(Map<string, number> & Omit<Map<string, number>, keyof Map<any, any>>) | null, Map<string, number> | (Map<string, number> & Omit<Map<string, number>, keyof Map<any, any>>) | null>;
5589
+ bulkRunning: Ref<boolean, boolean>;
5590
+ bulkAction: Ref<BulkActionType | null, BulkActionType | null>;
5591
+ bulkSubjectId: Ref<IntegerIdNullable, IntegerIdNullable>;
5592
+ bulkLog: Ref<{
5593
+ system: string;
5594
+ outcome: BulkOutcomeType;
5595
+ action: BulkActionType;
5596
+ subjectId: IntegerIdNullable;
5597
+ detail?: string | undefined;
5598
+ }[], BulkLogEntry[] | {
5599
+ system: string;
5600
+ outcome: BulkOutcomeType;
5601
+ action: BulkActionType;
5602
+ subjectId: IntegerIdNullable;
5603
+ detail?: string | undefined;
5604
+ }[]>;
5605
+ termRejected: Ref<boolean, boolean>;
5606
+ resetResults: () => void;
5607
+ setResult: (system: string, result: UserSystemResult) => void;
5608
+ patchAxes: (system: string, axes: UserSystemAxes) => void;
5609
+ setUser: (system: string, user: AnzuUser | null) => void;
5610
+ startBulk: (action: BulkActionType, systems: string[], subjectId: IntegerIdNullable) => void;
5611
+ setBulkEntry: (system: string, outcome: BulkOutcomeType, detail?: string) => void;
5612
+ finishBulk: () => void;
5613
+ reset: () => void;
5614
+ }>;
5615
+
5616
+ export declare const useUserCrossSystemWrites: () => {
5617
+ setEnabled: (descriptor: AnyUserSystemDescriptor, id: IntegerId, enabled: boolean) => Promise<WriteResult>;
5618
+ writeMetadata: (descriptor: AnyUserSystemDescriptor, id: IntegerId, target: BaseUser, fields?: readonly UserMetadataField[], seen?: BaseUser | null) => Promise<WriteResult & {
5619
+ changed: boolean;
5620
+ }>;
5621
+ createInSystem: (descriptor: AnyUserSystemDescriptor, body: AnzuUser) => Promise<WriteResult>;
5622
+ readSourceUser: (descriptor: AnyUserSystemDescriptor, id: IntegerId) => Promise<AnzuUser | null>;
5623
+ };
5624
+
5625
+ /**
5626
+ * The `BaseUserDto` rules, per profile.
5627
+ *
5628
+ * The lengths come from the backend constraints (`email` 256, first/last 120, full 242, avatar
5629
+ * text 2-3). The backend requires only the e-mail; the front end is deliberately stricter, and
5630
+ * `requiredMetadata` is what says by how much.
5631
+ */
5632
+ export declare function useUserMetadataValidation(user: Ref<BaseUser>, options: UserMetadataValidationOptions): {
5633
+ v$: Ref< Validation<{
5634
+ user: {
5635
+ id: {
5636
+ required: ValidationRuleWithoutParams<any>;
5637
+ } | {
5638
+ required?: undefined;
5639
+ };
5640
+ email: {
5641
+ required: ValidationRuleWithoutParams<any>;
5642
+ email: ValidationRuleWithoutParams<any>;
5643
+ maxLength: ValidationRuleWithParams<{
5644
+ max: number;
5645
+ }, any>;
5646
+ };
5647
+ person: {
5648
+ firstName: {
5649
+ minLength: ValidationRuleWithParams<{
5650
+ min: number;
5651
+ }, any>;
5652
+ maxLength: ValidationRuleWithParams<{
5653
+ max: number;
5654
+ }, any>;
5655
+ required: ValidationRuleWithoutParams<any>;
5656
+ } | {
5657
+ minLength: ValidationRuleWithParams<{
5658
+ min: number;
5659
+ }, any>;
5660
+ maxLength: ValidationRuleWithParams<{
5661
+ max: number;
5662
+ }, any>;
5663
+ required?: undefined;
5664
+ };
5665
+ lastName: {
5666
+ minLength: ValidationRuleWithParams<{
5667
+ min: number;
5668
+ }, any>;
5669
+ maxLength: ValidationRuleWithParams<{
5670
+ max: number;
5671
+ }, any>;
5672
+ required: ValidationRuleWithoutParams<any>;
5673
+ } | {
5674
+ minLength: ValidationRuleWithParams<{
5675
+ min: number;
5676
+ }, any>;
5677
+ maxLength: ValidationRuleWithParams<{
5678
+ max: number;
5679
+ }, any>;
5680
+ required?: undefined;
5681
+ };
5682
+ fullName: {
5683
+ minLength: ValidationRuleWithParams<{
5684
+ min: number;
5685
+ }, any>;
5686
+ maxLength: ValidationRuleWithParams<{
5687
+ max: number;
5688
+ }, any>;
5689
+ required: ValidationRuleWithoutParams<any>;
5690
+ } | {
5691
+ minLength: ValidationRuleWithParams<{
5692
+ min: number;
5693
+ }, any>;
5694
+ maxLength: ValidationRuleWithParams<{
5695
+ max: number;
5696
+ }, any>;
5697
+ required?: undefined;
5698
+ };
5699
+ };
5700
+ avatar: {
5701
+ color: {
5702
+ hexColor: any;
5703
+ required: ValidationRuleWithoutParams<any>;
5704
+ } | {
5705
+ hexColor: any;
5706
+ required?: undefined;
5707
+ };
5708
+ text: {
5709
+ minLength: ValidationRuleWithParams<{
5710
+ min: number;
5711
+ }, any>;
5712
+ maxLength: ValidationRuleWithParams<{
5713
+ max: number;
5714
+ }, any>;
5715
+ required: ValidationRuleWithoutParams<any>;
5716
+ } | {
5717
+ minLength: ValidationRuleWithParams<{
5718
+ min: number;
5719
+ }, any>;
5720
+ maxLength: ValidationRuleWithParams<{
5721
+ max: number;
5722
+ }, any>;
5723
+ required?: undefined;
5724
+ };
5725
+ };
5726
+ };
5727
+ }, {
5728
+ user: Ref<BaseUser, BaseUser>;
5729
+ }>, Validation<{
5730
+ user: {
5731
+ id: {
5732
+ required: ValidationRuleWithoutParams<any>;
5733
+ } | {
5734
+ required?: undefined;
5735
+ };
5736
+ email: {
5737
+ required: ValidationRuleWithoutParams<any>;
5738
+ email: ValidationRuleWithoutParams<any>;
5739
+ maxLength: ValidationRuleWithParams<{
5740
+ max: number;
5741
+ }, any>;
5742
+ };
5743
+ person: {
5744
+ firstName: {
5745
+ minLength: ValidationRuleWithParams<{
5746
+ min: number;
5747
+ }, any>;
5748
+ maxLength: ValidationRuleWithParams<{
5749
+ max: number;
5750
+ }, any>;
5751
+ required: ValidationRuleWithoutParams<any>;
5752
+ } | {
5753
+ minLength: ValidationRuleWithParams<{
5754
+ min: number;
5755
+ }, any>;
5756
+ maxLength: ValidationRuleWithParams<{
5757
+ max: number;
5758
+ }, any>;
5759
+ required?: undefined;
5760
+ };
5761
+ lastName: {
5762
+ minLength: ValidationRuleWithParams<{
5763
+ min: number;
5764
+ }, any>;
5765
+ maxLength: ValidationRuleWithParams<{
5766
+ max: number;
5767
+ }, any>;
5768
+ required: ValidationRuleWithoutParams<any>;
5769
+ } | {
5770
+ minLength: ValidationRuleWithParams<{
5771
+ min: number;
5772
+ }, any>;
5773
+ maxLength: ValidationRuleWithParams<{
5774
+ max: number;
5775
+ }, any>;
5776
+ required?: undefined;
5777
+ };
5778
+ fullName: {
5779
+ minLength: ValidationRuleWithParams<{
5780
+ min: number;
5781
+ }, any>;
5782
+ maxLength: ValidationRuleWithParams<{
5783
+ max: number;
5784
+ }, any>;
5785
+ required: ValidationRuleWithoutParams<any>;
5786
+ } | {
5787
+ minLength: ValidationRuleWithParams<{
5788
+ min: number;
5789
+ }, any>;
5790
+ maxLength: ValidationRuleWithParams<{
5791
+ max: number;
5792
+ }, any>;
5793
+ required?: undefined;
5794
+ };
5795
+ };
5796
+ avatar: {
5797
+ color: {
5798
+ hexColor: any;
5799
+ required: ValidationRuleWithoutParams<any>;
5800
+ } | {
5801
+ hexColor: any;
5802
+ required?: undefined;
5803
+ };
5804
+ text: {
5805
+ minLength: ValidationRuleWithParams<{
5806
+ min: number;
5807
+ }, any>;
5808
+ maxLength: ValidationRuleWithParams<{
5809
+ max: number;
5810
+ }, any>;
5811
+ required: ValidationRuleWithoutParams<any>;
5812
+ } | {
5813
+ minLength: ValidationRuleWithParams<{
5814
+ min: number;
5815
+ }, any>;
5816
+ maxLength: ValidationRuleWithParams<{
5817
+ max: number;
5818
+ }, any>;
5819
+ required?: undefined;
5820
+ };
5821
+ };
5822
+ };
5823
+ }, {
5824
+ user: Ref<BaseUser, BaseUser>;
5825
+ }>>;
5826
+ };
5827
+
5828
+ /**
5829
+ * One system's answer about one user.
5830
+ *
5831
+ * Reads through `endpoints[probe].get`, never a hard-coded path: in dam the choice is visible to
5832
+ * the operator, because `/adm/v1/anzu-user/{id}` has no gating there while `/adm/users/{id}` sits
5833
+ * behind `DAM_USER_READ` -- only the second can ever render "you have no access".
5834
+ *
5835
+ * Note for the app: a probe answering 404 is an expected result here, not a failure, but it still
5836
+ * reaches the api error logger. Filter on `status === 404 && entity === USER_PROBE_ENTITY`, or
5837
+ * every absent account writes a line into the log.
5838
+ */
5839
+ export declare const useUserSystemProbe: (params: UserSystemProbeParams) => UserSystemProbeResult;
5840
+
3402
5841
  declare interface ValueObjectOption<T> {
3403
5842
  value: T;
3404
5843
  title: string;
@@ -3415,6 +5854,22 @@ declare interface ViewBodySlotProps<TItem extends Record<string, any>> {
3415
5854
  };
3416
5855
  }
3417
5856
 
5857
+ export declare const writeMetadataField: (user: BaseUser, field: UserMetadataField, value: string) => void;
5858
+
5859
+ export declare interface WriteResult {
5860
+ outcome: BulkOutcomeType;
5861
+ /** What the server holds afterwards, when it answered with the record. */
5862
+ user?: AnzuUser;
5863
+ /**
5864
+ * Fields whose stored value had moved away from both the target and what the search saw.
5865
+ *
5866
+ * The write still goes through -- decision 24 says the operator's value wins -- but somebody
5867
+ * edited the record in between, and the log line says so rather than letting it pass unnoticed.
5868
+ */
5869
+ concurrentFields?: UserMetadataField[];
5870
+ detail?: string;
5871
+ }
5872
+
3418
5873
  export { }
3419
5874
 
3420
5875