@enonic-types/lib-auth 7.11.0-B4 → 7.11.0-RC3
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/auth.d.ts +6 -4
- package/package.json +2 -2
package/auth.d.ts
CHANGED
|
@@ -109,7 +109,9 @@ export declare function changePassword(params: ChangePasswordParams): void;
|
|
|
109
109
|
* @param {string} principalKey Principal key to look for.
|
|
110
110
|
* @returns {User | Group | Role} the principal specified, or null if it doesn't exist.
|
|
111
111
|
*/
|
|
112
|
-
export declare function getPrincipal(
|
|
112
|
+
export declare function getPrincipal(userKey: UserKey): User | null;
|
|
113
|
+
export declare function getPrincipal(groupKey: GroupKey): Group | null;
|
|
114
|
+
export declare function getPrincipal(roleKey: RoleKey): Role | null;
|
|
113
115
|
/**
|
|
114
116
|
* Returns a list of principals the specified principal is a member of.
|
|
115
117
|
*
|
|
@@ -274,10 +276,10 @@ export interface GetProfileParams {
|
|
|
274
276
|
* @returns {object} The extra data as JSON
|
|
275
277
|
*/
|
|
276
278
|
export declare function getProfile<Profile extends Record<string, unknown> = Record<string, unknown>>(params: GetProfileParams): Profile | null;
|
|
277
|
-
export interface ModifyProfileParams {
|
|
279
|
+
export interface ModifyProfileParams<Profile extends Record<string, unknown>> {
|
|
278
280
|
key: UserKey;
|
|
279
281
|
scope?: string | null;
|
|
280
|
-
editor: (
|
|
282
|
+
editor: (profile: Profile) => Profile;
|
|
281
283
|
}
|
|
282
284
|
/**
|
|
283
285
|
* This function retrieves the profile of a user and updates it.
|
|
@@ -290,7 +292,7 @@ export interface ModifyProfileParams {
|
|
|
290
292
|
* @param {function} params.editor Profile editor function to apply.
|
|
291
293
|
* @returns {object} The extra data as JSON
|
|
292
294
|
*/
|
|
293
|
-
export declare function modifyProfile<Profile extends Record<string, unknown> = Record<string, unknown>>(params: ModifyProfileParams): Profile | null;
|
|
295
|
+
export declare function modifyProfile<Profile extends Record<string, unknown> = Record<string, unknown>>(params: ModifyProfileParams<Profile>): Profile | null;
|
|
294
296
|
export interface FindUsersParams {
|
|
295
297
|
start?: number;
|
|
296
298
|
count?: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enonic-types/lib-auth",
|
|
3
|
-
"version": "7.11.0-
|
|
3
|
+
"version": "7.11.0-RC3",
|
|
4
4
|
"description": "Type definitions for lib-auth.",
|
|
5
5
|
"types": "auth.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"homepage": "https://github.com/enonic/xp/tree/master#readme",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@enonic-types/core": "7.11.0-
|
|
30
|
+
"@enonic-types/core": "7.11.0-RC3"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|