@enonic-types/lib-auth 7.16.2 → 8.0.0-A3
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 +8 -6
- package/package.json +2 -2
package/auth.d.ts
CHANGED
|
@@ -11,9 +11,9 @@ declare global {
|
|
|
11
11
|
'/lib/xp/auth': typeof import('./auth');
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
import type { Group, GroupKey, Principal, PrincipalKey, Role, RoleKey, User, UserKey } from '@enonic-types/core';
|
|
15
|
-
export type { PrincipalKey, UserKey, GroupKey, RoleKey, Principal, ScriptValue, User, Group, Role } from '@enonic-types/core';
|
|
16
|
-
export
|
|
14
|
+
import type { Group, GroupKey, Principal, PrincipalKey, PrincipalType, Role, RoleKey, User, UserKey } from '@enonic-types/core';
|
|
15
|
+
export type { PrincipalKey, PrincipalType, UserKey, GroupKey, RoleKey, Principal, ScriptValue, User, Group, Role } from '@enonic-types/core';
|
|
16
|
+
export type LoginScopeType = 'SESSION' | 'REQUEST' | 'NONE';
|
|
17
17
|
export interface UserWithProfile<Profile extends Record<string, unknown> = Record<string, unknown>> extends User {
|
|
18
18
|
profile?: Profile;
|
|
19
19
|
}
|
|
@@ -42,8 +42,8 @@ export interface LoginResult {
|
|
|
42
42
|
* @example-ref examples/auth/login.js
|
|
43
43
|
*
|
|
44
44
|
* @param {object} params JSON parameters.
|
|
45
|
-
* @param {string} params.user Name of user to log in.
|
|
46
|
-
* @param {string} [params.idProvider] Name of id provider where the user is stored. If not specified
|
|
45
|
+
* @param {string} params.user Name of the user to log in.
|
|
46
|
+
* @param {string} [params.idProvider] Name of id provider where the user is stored. If not specified system id provider will be used.
|
|
47
47
|
* @param {string} [params.password] Password for the user. Ignored if skipAuth is set to true, mandatory otherwise.
|
|
48
48
|
* @param {('SESSION'|'REQUEST'|'NONE')} [params.scope=SESSION] The scope of this login. Two values are valid. SESSION logs the user in and creates a session in XP for use in future requests. REQUEST logs the user in but only for this particular request and thus does not create a session.
|
|
49
49
|
* @param {boolean} [params.skipAuth=false] Skip authentication.
|
|
@@ -100,6 +100,7 @@ export declare function changePassword(params: ChangePasswordParams): void;
|
|
|
100
100
|
export declare function getPrincipal(userKey: UserKey): User | null;
|
|
101
101
|
export declare function getPrincipal(groupKey: GroupKey): Group | null;
|
|
102
102
|
export declare function getPrincipal(roleKey: RoleKey): Role | null;
|
|
103
|
+
export declare function getPrincipal(principalKey: PrincipalKey): Principal | null;
|
|
103
104
|
/**
|
|
104
105
|
* Returns a list of principals the specified principal is a member of.
|
|
105
106
|
*
|
|
@@ -204,7 +205,7 @@ export declare function addMembers(principalKey: GroupKey | RoleKey, members: (U
|
|
|
204
205
|
*/
|
|
205
206
|
export declare function removeMembers(principalKey: GroupKey | RoleKey, members: (UserKey | GroupKey)[]): void;
|
|
206
207
|
export interface FindPrincipalsParams {
|
|
207
|
-
type?:
|
|
208
|
+
type?: PrincipalType;
|
|
208
209
|
idProvider?: string;
|
|
209
210
|
start?: number;
|
|
210
211
|
count?: number;
|
|
@@ -294,6 +295,7 @@ export declare function findUsers(params: FindUsersParams & {
|
|
|
294
295
|
export declare function findUsers<Profile extends Record<string, unknown> = Record<string, unknown>>(params: FindUsersParams & {
|
|
295
296
|
includeProfile: true;
|
|
296
297
|
}): FindPrincipalsResult<UserWithProfile<Profile>>;
|
|
298
|
+
export declare function findUsers(params: FindUsersParams): FindPrincipalsResult<User | UserWithProfile>;
|
|
297
299
|
export interface CreateRoleParams {
|
|
298
300
|
name: string;
|
|
299
301
|
displayName?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enonic-types/lib-auth",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-A3",
|
|
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": "
|
|
30
|
+
"@enonic-types/core": "8.0.0-A3"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|