Comparing version 0.3.5 to 0.3.6
import { IOEither } from "fp-ts/IOEither"; | ||
import { Option } from "fp-ts/Option"; | ||
import { AuthLibrary, ChangePasswordParams, CreateGroupParams, CreateRoleParams, CreateUserParams, FindPrincipalsParams, FindPrincipalsResult, FindUsersParams, GetProfileParams, Group, LoginParams, LoginResult, ModifyGroupParams, ModifyProfileParams, ModifyRoleParams, ModifyUserParams, Principal, Role, User, UserQueryResult } from "enonic-types/auth"; | ||
import { AuthLibrary, ChangePasswordParams, CreateGroupParams, CreateRoleParams, CreateUserParams, FindPrincipalsParams, FindPrincipalsResult, FindUsersParams, GetProfileParams, Group, LoginParams, LoginResult, ModifyGroupParams, ModifyProfileParams, ModifyRoleParams, ModifyUserParams, Principal, Role, User, UserQueryResult, UserWithProfile } from "enonic-types/auth"; | ||
import { EnonicError } from "./errors"; | ||
@@ -44,3 +44,8 @@ /** | ||
*/ | ||
export declare function findUsers<A>(params: FindUsersParams): IOEither<EnonicError, UserQueryResult<A>>; | ||
export declare function findUsers<A>(params: FindUsersParams & { | ||
includeProfile: true; | ||
}): IOEither<EnonicError, UserQueryResult<UserWithProfile<A>>>; | ||
export declare function findUsers(params: FindUsersParams & { | ||
includeProfile?: false; | ||
}): IOEither<EnonicError, UserQueryResult<User>>; | ||
/** | ||
@@ -47,0 +52,0 @@ * Retrieves the user specified and updates it with the changes applied through the editor. |
@@ -70,7 +70,6 @@ "use strict"; | ||
exports.getIdProviderConfig = getIdProviderConfig; | ||
/** | ||
* Search for users matching the specified query. | ||
*/ | ||
function findUsers(params) { | ||
return errors_1.catchEnonicError(function () { return authLib.findUsers(params); }); | ||
return errors_1.catchEnonicError(function () { return params.includeProfile | ||
? authLib.findUsers(params) | ||
: authLib.findUsers(params); }); | ||
} | ||
@@ -77,0 +76,0 @@ exports.findUsers = findUsers; |
@@ -1,2 +0,2 @@ | ||
import { Request, Response, ResponseType } from "enonic-types/controller"; | ||
import { HttpResponse, Request, Response, ResponseType } from "enonic-types/controller"; | ||
import { IO } from "fp-ts/IO"; | ||
@@ -38,3 +38,3 @@ import { ResourceKey } from "enonic-types/thymeleaf"; | ||
*/ | ||
export declare function status(httpStatus: number, body?: ResponseType, extras?: Partial<Response>): IO<Response>; | ||
export declare function status(error: EnonicError, body?: ResponseType, extras?: Partial<Response>): IO<Response>; | ||
export declare function status(httpStatus: number, body?: ResponseType, extras?: Partial<HttpResponse>): IO<Response>; | ||
export declare function status(error: EnonicError, body?: ResponseType, extras?: Partial<HttpResponse>): IO<Response>; |
@@ -24,7 +24,8 @@ "use strict"; | ||
exports.created = asResponseFromStatus(201); | ||
exports.noContent = function (body, extras) { | ||
var noContent = function (body, extras) { | ||
if (extras === void 0) { extras = {}; } | ||
return IO_1.io.of(__assign(__assign({}, extras), { status: 204, body: '' })); | ||
}; | ||
exports.redirect = function (redirect) { return IO_1.io.of({ | ||
exports.noContent = noContent; | ||
var redirect = function (redirect) { return IO_1.io.of({ | ||
applyFilters: false, | ||
@@ -36,2 +37,3 @@ postProcess: false, | ||
}); }; | ||
exports.redirect = redirect; | ||
exports.badRequest = asResponseFromStatus(400); | ||
@@ -38,0 +40,0 @@ exports.unauthorized = asResponseFromStatus(401); |
@@ -1,2 +0,2 @@ | ||
import { BreadcrumbMenu, GetBreadcrumbMenuParams, MenuItem, MenuLibrary } from "enonic-types/menu"; | ||
import { BreadcrumbMenu, GetBreadcrumbMenuParams, GetMenuParams, GetMenuTreeParams, MenuItem, MenuLibrary, MenuTree } from "enonic-types/menu"; | ||
import { Content } from "enonic-types/content"; | ||
@@ -10,3 +10,3 @@ import { IOEither } from "fp-ts/IOEither"; | ||
export declare function getBreadcrumbMenu(params: GetBreadcrumbMenuParams): IOEither<EnonicError, BreadcrumbMenu>; | ||
export declare function getMenuTree(levels: number): IOEither<EnonicError, ReadonlyArray<MenuItem>>; | ||
export declare function getSubMenus(levels: number): (parentContent: Content) => IOEither<EnonicError, ReadonlyArray<MenuItem>>; | ||
export declare function getMenuTree(levels: number, params?: GetMenuTreeParams): IOEither<EnonicError, MenuTree>; | ||
export declare function getSubMenus(levels?: number, params?: GetMenuParams): (parentContent: Content) => IOEither<EnonicError, ReadonlyArray<MenuItem>>; |
@@ -17,9 +17,9 @@ "use strict"; | ||
exports.getBreadcrumbMenu = getBreadcrumbMenu; | ||
function getMenuTree(levels) { | ||
return errors_1.catchEnonicError(function () { return menuLib.getMenuTree(levels); }); | ||
function getMenuTree(levels, params) { | ||
return errors_1.catchEnonicError(function () { return menuLib.getMenuTree(levels, params); }); | ||
} | ||
exports.getMenuTree = getMenuTree; | ||
function getSubMenus(levels) { | ||
return function (parentContent) { return errors_1.catchEnonicError(function () { return menuLib.getSubMenus(parentContent, levels); }); }; | ||
function getSubMenus(levels, params) { | ||
return function (parentContent) { return errors_1.catchEnonicError(function () { return menuLib.getSubMenus(parentContent, levels, params); }); }; | ||
} | ||
exports.getSubMenus = getSubMenus; |
{ | ||
"name": "enonic-fp", | ||
"version": "0.3.5", | ||
"version": "0.3.6", | ||
"sideEffects": false, | ||
@@ -27,12 +27,12 @@ "description": "Functional programming helpers for Enonic XP", | ||
"dependencies": { | ||
"enonic-types": "^0.1.4", | ||
"fp-ts": "^2.8.6" | ||
"enonic-types": "^0.1.10", | ||
"fp-ts": "^2.9.1" | ||
}, | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "^4.8.1", | ||
"@typescript-eslint/parser": "^4.8.1", | ||
"eslint": "^7.13.0", | ||
"@typescript-eslint/eslint-plugin": "^4.11.0", | ||
"@typescript-eslint/parser": "^4.11.0", | ||
"eslint": "^7.16.0", | ||
"rimraf": "^3.0.2", | ||
"typescript": "^4.0.5" | ||
"typescript": "^4.1.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
109861
52
2167
Updatedenonic-types@^0.1.10
Updatedfp-ts@^2.9.1