Comparing version 0.2.31 to 0.2.32
import { IOEither } from "fp-ts/lib/IOEither"; | ||
import { EnonicError } from "./errors"; | ||
import { Attachments, AttachmentStreamParams, ByteSource, Content, ContentType, CreateContentParams, CreateMediaParams, DeleteContentParams, GetChildrenParams, GetContentParams, GetPermissionsParams, GetPermissionsResult, GetSiteConfigParams, GetSiteParams, ModifyContentParams, MoveParams, PublishContentParams, PublishResponse, QueryContentParams, QueryResponse, RemoveAttachmentParams, SetPermissionsParams, Site, UnpublishContentParams } from "enonic-types/lib/content"; | ||
import { AddAttachmentParams, Attachments, AttachmentStreamParams, ByteSource, Content, ContentType, CreateContentParams, CreateMediaParams, DeleteContentParams, ExistsParams, GetChildrenParams, GetContentParams, GetOutboundDependenciesParams, GetPermissionsParams, GetPermissionsResult, GetSiteConfigParams, GetSiteParams, ModifyContentParams, MoveParams, PublishContentParams, PublishResponse, QueryContentParams, QueryResponse, RemoveAttachmentParams, SetPermissionsParams, Site, UnpublishContentParams } from "enonic-types/lib/content"; | ||
export declare function get<A extends object>(params: GetContentParams): IOEither<EnonicError, Content<A>>; | ||
@@ -9,5 +9,7 @@ export declare function query<A extends object>(params: QueryContentParams): IOEither<EnonicError, QueryResponse<A>>; | ||
export declare function remove(params: DeleteContentParams): IOEither<EnonicError, void>; | ||
export declare function exists(params: ExistsParams): IOEither<EnonicError, boolean>; | ||
export declare function publish(params: PublishContentParams): IOEither<EnonicError, PublishResponse>; | ||
export declare function unpublish(params: UnpublishContentParams): IOEither<EnonicError, ReadonlyArray<string>>; | ||
export declare function getChildren<A extends object>(params: GetChildrenParams): IOEither<EnonicError, QueryResponse<A>>; | ||
export declare function getOutboundDependencies(params: GetOutboundDependenciesParams): IOEither<EnonicError, ReadonlyArray<string>>; | ||
export declare function move<A extends object>(params: MoveParams): IOEither<EnonicError, Content<A>>; | ||
@@ -17,2 +19,3 @@ export declare function getSite<A extends object, PageConfig extends object = never>(params: GetSiteParams): IOEither<EnonicError, Site<A, PageConfig>>; | ||
export declare function createMedia<A extends object>(params: CreateMediaParams): IOEither<EnonicError, Content<A>>; | ||
export declare function addAttachment(params: AddAttachmentParams): IOEither<EnonicError, void>; | ||
export declare function getAttachments(key: string): IOEither<EnonicError, Attachments>; | ||
@@ -19,0 +22,0 @@ export declare function getAttachmentStream(params: AttachmentStreamParams): IOEither<EnonicError, ByteSource>; |
@@ -6,22 +6,21 @@ "use strict"; | ||
var utils_1 = require("./utils"); | ||
var utils_2 = require("./utils"); | ||
var contentLib = __non_webpack_require__("/lib/xp/content"); | ||
function get(params) { | ||
return pipeable_1.pipe(utils_2.catchEnonicError(function () { return contentLib.get(params); }), IOEither_1.chain(utils_1.fromNullable({ errorKey: "NotFoundError" }))); | ||
return pipeable_1.pipe(utils_1.catchEnonicError(function () { return contentLib.get(params); }), IOEither_1.chain(utils_1.fromNullable({ errorKey: "NotFoundError" }))); | ||
} | ||
exports.get = get; | ||
function query(params) { | ||
return utils_2.catchEnonicError(function () { return contentLib.query(params); }); | ||
return utils_1.catchEnonicError(function () { return contentLib.query(params); }); | ||
} | ||
exports.query = query; | ||
function create(params) { | ||
return utils_2.catchEnonicError(function () { return contentLib.create(params); }); | ||
return utils_1.catchEnonicError(function () { return contentLib.create(params); }); | ||
} | ||
exports.create = create; | ||
function modify(params) { | ||
return utils_2.catchEnonicError(function () { return contentLib.modify(params); }); | ||
return utils_1.catchEnonicError(function () { return contentLib.modify(params); }); | ||
} | ||
exports.modify = modify; | ||
function remove(params) { | ||
return pipeable_1.pipe(utils_2.catchEnonicError(function () { return contentLib.delete(params); }), IOEither_1.chain(function (success) { | ||
return pipeable_1.pipe(utils_1.catchEnonicError(function () { return contentLib.delete(params); }), IOEither_1.chain(function (success) { | ||
return success | ||
@@ -35,57 +34,69 @@ ? IOEither_1.right(undefined) | ||
exports.remove = remove; | ||
function exists(params) { | ||
return utils_1.catchEnonicError(function () { return contentLib.exists(params); }, "InternalServerError"); | ||
} | ||
exports.exists = exists; | ||
function publish(params) { | ||
return utils_2.catchEnonicError(function () { return contentLib.publish(params); }, "PublishError"); | ||
return utils_1.catchEnonicError(function () { return contentLib.publish(params); }, "PublishError"); | ||
} | ||
exports.publish = publish; | ||
function unpublish(params) { | ||
return utils_2.catchEnonicError(function () { return contentLib.unpublish(params); }, "PublishError"); | ||
return utils_1.catchEnonicError(function () { return contentLib.unpublish(params); }, "PublishError"); | ||
} | ||
exports.unpublish = unpublish; | ||
function getChildren(params) { | ||
return utils_2.catchEnonicError(function () { return contentLib.getChildren(params); }); | ||
return utils_1.catchEnonicError(function () { return contentLib.getChildren(params); }); | ||
} | ||
exports.getChildren = getChildren; | ||
function getOutboundDependencies(params) { | ||
return utils_1.catchEnonicError(function () { return contentLib.getOutboundDependencies(params); }); | ||
} | ||
exports.getOutboundDependencies = getOutboundDependencies; | ||
function move(params) { | ||
return utils_2.catchEnonicError(function () { return contentLib.move(params); }); | ||
return utils_1.catchEnonicError(function () { return contentLib.move(params); }); | ||
} | ||
exports.move = move; | ||
function getSite(params) { | ||
return utils_2.catchEnonicError(function () { return contentLib.getSite(params); }); | ||
return utils_1.catchEnonicError(function () { return contentLib.getSite(params); }); | ||
} | ||
exports.getSite = getSite; | ||
function getSiteConfig(params) { | ||
return utils_2.catchEnonicError(function () { return contentLib.getSiteConfig(params); }); | ||
return utils_1.catchEnonicError(function () { return contentLib.getSiteConfig(params); }); | ||
} | ||
exports.getSiteConfig = getSiteConfig; | ||
function createMedia(params) { | ||
return utils_2.catchEnonicError(function () { return contentLib.createMedia(params); }); | ||
return utils_1.catchEnonicError(function () { return contentLib.createMedia(params); }); | ||
} | ||
exports.createMedia = createMedia; | ||
function addAttachment(params) { | ||
return utils_1.catchEnonicError(function () { return contentLib.addAttachment(params); }); | ||
} | ||
exports.addAttachment = addAttachment; | ||
function getAttachments(key) { | ||
return pipeable_1.pipe(utils_2.catchEnonicError(function () { return contentLib.getAttachments(key); }), IOEither_1.chain(utils_1.fromNullable({ errorKey: "NotFoundError" }))); | ||
return pipeable_1.pipe(utils_1.catchEnonicError(function () { return contentLib.getAttachments(key); }), IOEither_1.chain(utils_1.fromNullable({ errorKey: "NotFoundError" }))); | ||
} | ||
exports.getAttachments = getAttachments; | ||
function getAttachmentStream(params) { | ||
return pipeable_1.pipe(utils_2.catchEnonicError(function () { return contentLib.getAttachmentStream(params); }), IOEither_1.chain(utils_1.fromNullable({ errorKey: "NotFoundError" }))); | ||
return pipeable_1.pipe(utils_1.catchEnonicError(function () { return contentLib.getAttachmentStream(params); }), IOEither_1.chain(utils_1.fromNullable({ errorKey: "NotFoundError" }))); | ||
} | ||
exports.getAttachmentStream = getAttachmentStream; | ||
function removeAttachment(params) { | ||
return utils_2.catchEnonicError(function () { return contentLib.removeAttachment(params); }); | ||
return utils_1.catchEnonicError(function () { return contentLib.removeAttachment(params); }); | ||
} | ||
exports.removeAttachment = removeAttachment; | ||
function getPermissions(params) { | ||
return utils_2.catchEnonicError(function () { return contentLib.getPermissions(params); }); | ||
return utils_1.catchEnonicError(function () { return contentLib.getPermissions(params); }); | ||
} | ||
exports.getPermissions = getPermissions; | ||
function setPermissions(params) { | ||
return utils_2.catchEnonicError(function () { return contentLib.setPermissions(params); }); | ||
return utils_1.catchEnonicError(function () { return contentLib.setPermissions(params); }); | ||
} | ||
exports.setPermissions = setPermissions; | ||
function getType(name) { | ||
return pipeable_1.pipe(utils_2.catchEnonicError(function () { return contentLib.getType(name); }), IOEither_1.chain(utils_1.fromNullable({ errorKey: "NotFoundError" }))); | ||
return pipeable_1.pipe(utils_1.catchEnonicError(function () { return contentLib.getType(name); }), IOEither_1.chain(utils_1.fromNullable({ errorKey: "NotFoundError" }))); | ||
} | ||
exports.getType = getType; | ||
function getTypes() { | ||
return utils_2.catchEnonicError(function () { return contentLib.getTypes(); }); | ||
return utils_1.catchEnonicError(function () { return contentLib.getTypes(); }); | ||
} | ||
exports.getTypes = getTypes; |
{ | ||
"name": "enonic-fp", | ||
"version": "0.2.31", | ||
"version": "0.2.32", | ||
"description": "Functional programming helpers for Enonic XP", | ||
@@ -28,3 +28,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"enonic-types": "^0.0.40", | ||
"enonic-types": "^0.0.41", | ||
"fp-ts": "^2.5.2" | ||
@@ -31,0 +31,0 @@ }, |
47231
761
+ Addedenonic-types@0.0.41(transitive)
- Removedenonic-types@0.0.40(transitive)
Updatedenonic-types@^0.0.41