admins-components 5.2.5 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -54,5 +54,4 @@ export * from './utils/dateManipulation';
54
54
  export * from './utils/debounce';
55
55
  export * from './utils/articleEditorService';
56
56
  export * from './utils/currentUserInfo';
57
- export * from './utils/multisiteMixingHelper';
58
57
  export * from './utils/cmsContext';
@@ -1,107 +1,22 @@
1
+ import { Ref, ComputedRef } from 'vue';
1
2
  import { UserInfoModel } from '../modells/User';
2
3
  export type UserState = "loading" | "authenticated" | "error";
3
- export declare const useCurrentUser: import('pinia').StoreDefinition<"currentUser", {
4
- user: UserInfoModel | null;
5
- state: UserState;
6
- error: string | null;
7
- _backendUrl: string | null;
8
- _isInitialized: boolean;
9
- }, {
10
- isLoading: (state: {
11
- user: {
12
- displayName: string;
13
- roles: string[];
14
- email: string;
15
- id: string;
16
- } | null;
17
- state: UserState;
18
- error: string | null;
19
- _backendUrl: string | null;
20
- _isInitialized: boolean;
21
- } & import('pinia').PiniaCustomStateProperties<{
22
- user: UserInfoModel | null;
23
- state: UserState;
24
- error: string | null;
25
- _backendUrl: string | null;
26
- _isInitialized: boolean;
27
- }>) => boolean;
28
- isAuthenticated: (state: {
29
- user: {
30
- displayName: string;
31
- roles: string[];
32
- email: string;
33
- id: string;
34
- } | null;
35
- state: UserState;
36
- error: string | null;
37
- _backendUrl: string | null;
38
- _isInitialized: boolean;
39
- } & import('pinia').PiniaCustomStateProperties<{
40
- user: UserInfoModel | null;
41
- state: UserState;
42
- error: string | null;
43
- _backendUrl: string | null;
44
- _isInitialized: boolean;
45
- }>) => boolean;
46
- displayName: (state: {
47
- user: {
48
- displayName: string;
49
- roles: string[];
50
- email: string;
51
- id: string;
52
- } | null;
53
- state: UserState;
54
- error: string | null;
55
- _backendUrl: string | null;
56
- _isInitialized: boolean;
57
- } & import('pinia').PiniaCustomStateProperties<{
58
- user: UserInfoModel | null;
59
- state: UserState;
60
- error: string | null;
61
- _backendUrl: string | null;
62
- _isInitialized: boolean;
63
- }>) => string;
64
- email: (state: {
65
- user: {
66
- displayName: string;
67
- roles: string[];
68
- email: string;
69
- id: string;
70
- } | null;
71
- state: UserState;
72
- error: string | null;
73
- _backendUrl: string | null;
74
- _isInitialized: boolean;
75
- } & import('pinia').PiniaCustomStateProperties<{
76
- user: UserInfoModel | null;
77
- state: UserState;
78
- error: string | null;
79
- _backendUrl: string | null;
80
- _isInitialized: boolean;
81
- }>) => string;
82
- roles: (state: {
83
- user: {
84
- displayName: string;
85
- roles: string[];
86
- email: string;
87
- id: string;
88
- } | null;
89
- state: UserState;
90
- error: string | null;
91
- _backendUrl: string | null;
92
- _isInitialized: boolean;
93
- } & import('pinia').PiniaCustomStateProperties<{
94
- user: UserInfoModel | null;
95
- state: UserState;
96
- error: string | null;
97
- _backendUrl: string | null;
98
- _isInitialized: boolean;
99
- }>) => string[];
100
- }, {
4
+ export interface CurrentUserStore {
5
+ user: Ref<UserInfoModel | null>;
6
+ state: Ref<UserState>;
7
+ error: Ref<string | null>;
8
+ isLoading: ComputedRef<boolean>;
9
+ isAuthenticated: ComputedRef<boolean>;
10
+ displayName: ComputedRef<string>;
11
+ email: ComputedRef<string>;
12
+ roles: ComputedRef<readonly string[]>;
101
13
  initialize(backendUrl: string): Promise<void>;
102
14
  refresh(): Promise<void>;
15
+ clear(): void;
103
16
  hasRole(role: string): boolean;
104
17
  hasAnyRole(...roles: string[]): boolean;
105
18
  hasAllRoles(...roles: string[]): boolean;
106
19
  hasPermission(siteId: string, entityName: string | "all", accessLevel: "reader" | "admin"): boolean;
107
- }>;
20
+ getMixableSiteIdsForResource(entityName: string | "all"): Promise<string[]>;
21
+ }
22
+ export declare function useCurrentUser(): CurrentUserStore;
@@ -5,5 +5,4 @@ export * from './dateManipulation';
5
5
  export * from './debounce';
6
6
  export * from './articleEditorService';
7
7
  export * from './currentUserInfo';
8
- export * from './multisiteMixingHelper';
9
8
  export * from './cmsContext';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "admins-components",
3
- "version": "5.2.5",
3
+ "version": "5.3.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -25,7 +25,6 @@
25
25
  "@vueform/vueform": "^1.13.2",
26
26
  "@vueuse/core": "^13.9.0",
27
27
  "bootstrap": "^5.3.7",
28
- "pinia": "^2.3.1",
29
28
  "rollup-plugin-typescript2": "^0.36.0",
30
29
  "vite-plugin-dts": "^4.5.3",
31
30
  "vue": "^3.5.13"
@@ -1 +0,0 @@
1
- export declare function getMixableSiteIdsForResource(articleEditorUrl: string, entityName: string | "all"): Promise<string[]>;