Comparing version 0.3.14 to 0.3.16
/// <reference types="enonic-types" /> | ||
import { IOEither } from "fp-ts/IOEither"; | ||
import { Option } from "fp-ts/Option"; | ||
import type { ChangePasswordParams, CreateGroupParams, CreateRoleParams, CreateUserParams, FindPrincipalsParams, FindPrincipalsResult, FindUsersParams, GetProfileParams, Group, LoginParams, LoginResult, ModifyGroupParams, ModifyProfileParams, ModifyRoleParams, ModifyUserParams, Principal, Role, User, UserQueryResult, UserWithProfile } from "/lib/xp/auth"; | ||
import type { ChangePasswordParams, CreateGroupParams, CreateRoleParams, CreateUserParams, FindPrincipalsParams, FindPrincipalsResult, FindUsersParams, GetProfileParams, Group, LoginParams, LoginResult, ModifyGroupParams, ModifyProfileParams, ModifyRoleParams, ModifyUserParams, Principal, PrincipalKey, PrincipalKeyGroup, PrincipalKeyRole, PrincipalKeyUser, Role, User, UserQueryResult, UserWithProfile } from "/lib/xp/auth"; | ||
import { EnonicError } from "./errors"; | ||
@@ -58,11 +58,11 @@ /** | ||
*/ | ||
export declare function addMembers(principalKey: string, members: Array<string>): IOEither<EnonicError, void>; | ||
export declare function addMembers(principalKey: PrincipalKeyRole | PrincipalKeyGroup, members: Array<PrincipalKeyGroup | PrincipalKeyUser>): IOEither<EnonicError, void>; | ||
/** | ||
* Removes members from a principal (group or role). | ||
*/ | ||
export declare function removeMembers(principalKey: string, members: Array<string>): IOEither<EnonicError, void>; | ||
export declare function removeMembers(principalKey: PrincipalKeyRole | PrincipalKeyGroup, members: Array<PrincipalKeyGroup | PrincipalKeyUser>): IOEither<EnonicError, void>; | ||
/** | ||
* Deletes the principal with the specifkey. | ||
*/ | ||
export declare function deletePrincipal(principalKey: string): IOEither<EnonicError, boolean>; | ||
export declare function deletePrincipal(principalKey: PrincipalKey): IOEither<EnonicError, boolean>; | ||
/** | ||
@@ -75,3 +75,3 @@ * Search for principals matching the specified criteria. | ||
*/ | ||
export declare function getPrincipal(principalKey: string): Option<User>; | ||
export declare function getPrincipal(principalKey: PrincipalKey): Option<Principal>; | ||
/** | ||
@@ -100,6 +100,6 @@ * Creates a role. | ||
*/ | ||
export declare function getMembers(principalKey: string): IOEither<EnonicError, ReadonlyArray<User>>; | ||
export declare function getMembers(principalKey: PrincipalKeyRole | PrincipalKeyGroup): IOEither<EnonicError, ReadonlyArray<User | Group>>; | ||
/** | ||
* Returns the list of principals which the specified principal is a member of. | ||
*/ | ||
export declare function getMemberships(principalKey: string, transitive?: boolean): IOEither<EnonicError, ReadonlyArray<Principal>>; | ||
export declare function getMemberships(principalKey: PrincipalKeyUser | PrincipalKeyGroup, transitive?: boolean): IOEither<EnonicError, ReadonlyArray<Principal>>; |
@@ -6,4 +6,5 @@ /// <reference types="enonic-types" /> | ||
import { EnonicError } from "./errors"; | ||
export declare function get(): IOEither<EnonicError, Context>; | ||
export declare function runUnsafe<A>(runContext: RunContext, f: () => A): A; | ||
export declare function run(runContext: RunContext): <A>(a: IO<A>) => IO<A>; | ||
import { ContextAttributes } from "*/lib/xp/context"; | ||
export declare function get<Attributes extends ContextAttributes>(): IOEither<EnonicError, Context<Attributes>>; | ||
export declare function runUnsafe<A, Attributes extends ContextAttributes>(runContext: RunContext<Attributes>, f: () => A): A; | ||
export declare function run<Attributes extends ContextAttributes>(runContext: RunContext<Attributes>): <A>(a: IO<A>) => IO<A>; |
@@ -75,10 +75,10 @@ "use strict"; | ||
var titleKeys = [ | ||
i18nPrefix + "." + fieldName + "." + typeString, | ||
i18nPrefix + "." + fieldName + "." + err.status, | ||
i18nPrefix + "." + typeString, | ||
i18nPrefix + "." + err.status, | ||
"errors." + fieldName + "." + typeString, | ||
"errors." + fieldName + "." + err.status, | ||
"errors." + typeString, | ||
"errors." + err.status, | ||
"".concat(i18nPrefix, ".").concat(fieldName, ".").concat(typeString), | ||
"".concat(i18nPrefix, ".").concat(fieldName, ".").concat(err.status), | ||
"".concat(i18nPrefix, ".").concat(typeString), | ||
"".concat(i18nPrefix, ".").concat(err.status), | ||
"errors.".concat(fieldName, ".").concat(typeString), | ||
"errors.".concat(fieldName, ".").concat(err.status), | ||
"errors.".concat(typeString), | ||
"errors.".concat(err.status), | ||
]; | ||
@@ -85,0 +85,0 @@ return (0, function_1.pipe)(titleKeys.map(function (key) { return (__assign(__assign({}, params === null || params === void 0 ? void 0 : params.localizeParams), { key: key })); }), i18n_1.localizeFirst, (0, Option_1.getOrElse)(function () { return err[fieldName]; })); |
{ | ||
"name": "enonic-fp", | ||
"version": "0.3.14", | ||
"version": "0.3.16", | ||
"sideEffects": false, | ||
@@ -27,15 +27,15 @@ "description": "Functional programming helpers for Enonic XP", | ||
"dependencies": { | ||
"enonic-types": "^0.3.0", | ||
"fp-ts": "^2.11.4" | ||
"enonic-types": "^0.3.9", | ||
"fp-ts": "^2.11.5" | ||
}, | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "^4.32.0", | ||
"@typescript-eslint/parser": "^4.32.0", | ||
"eslint": "^7.32.0", | ||
"@typescript-eslint/eslint-plugin": "^5.6.0", | ||
"@typescript-eslint/parser": "^5.6.0", | ||
"eslint": "^8.4.1", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"prettier": "^2.4.1", | ||
"prettier": "^2.5.1", | ||
"rimraf": "^3.0.2", | ||
"typescript": "^4.4.3" | ||
"typescript": "^4.5.3" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
112192
2110
Updatedenonic-types@^0.3.9
Updatedfp-ts@^2.11.5