Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

enonic-wizardry

Package Overview
Dependencies
Maintainers
1
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enonic-wizardry - npm Package Compare versions

Comparing version 0.2.8 to 0.2.9

23

lib/controller.d.ts

@@ -7,3 +7,3 @@ import { EnonicError, EnonicErrorKey } from "enonic-fp/lib/errors";

};
export declare function status(statusOrError: number | EnonicError, body?: string | object): IO<Response>;
export declare function status(statusOrError: number | EnonicError, body?: string | object, other?: Partial<Response>): IO<Response>;
/**

@@ -17,13 +17,12 @@ * Creates a Json Response based on an EnonicError

export declare function unsafeRenderErrorPage(view: any): (err: EnonicError) => IO<Response>;
export declare const ok: (body: any) => IO<Response>;
export declare const created: (body: any) => IO<Response>;
export declare const noContent: () => IO<Response>;
export declare const ok: (body: any, other?: Partial<Response>) => IO<Response>;
export declare const created: (body: any, other?: Partial<Response>) => IO<Response>;
export declare const noContent: (other?: Partial<Response>) => IO<Response>;
export declare const redirect: (redirect: string) => IO<Response>;
export declare const badRequest: (body: any) => IO<Response>;
export declare const unauthorized: (body: any) => IO<Response>;
export declare const forbidden: (body: any) => IO<Response>;
export declare const notFound: (body: any) => IO<Response>;
export declare const methodNotAllowed: (body: any) => IO<Response>;
export declare const internalServerError: (body: any) => IO<Response>;
export declare const badGateway: (body: any) => IO<Response>;
export declare function setTotal(total: number, response: IO<Response>): IO<Response>;
export declare const badRequest: (body: any, other?: Partial<Response>) => IO<Response>;
export declare const unauthorized: (body: any, other?: Partial<Response>) => IO<Response>;
export declare const forbidden: (body: any, other?: Partial<Response>) => IO<Response>;
export declare const notFound: (body: any, other?: Partial<Response>) => IO<Response>;
export declare const methodNotAllowed: (body: any, other?: Partial<Response>) => IO<Response>;
export declare const internalServerError: (body: any, other?: Partial<Response>) => IO<Response>;
export declare const badGateway: (body: any, other?: Partial<Response>) => IO<Response>;

@@ -34,11 +34,10 @@ "use strict";

}
function status(statusOrError, body) {
function status(statusOrError, body, other) {
if (body === void 0) { body = ''; }
if (other === void 0) { other = {}; }
var status = (typeof statusOrError == 'number')
? statusOrError
: exports.defaultStatusNumbers[statusOrError.errorKey];
return IO_1.io.of({
status: status,
body: body,
contentType: contentType(body)
});
return IO_1.io.of(__assign(__assign({ contentType: contentType(body) }, other), { status: status,
body: body }));
}

@@ -72,5 +71,14 @@ exports.status = status;

exports.unsafeRenderErrorPage = unsafeRenderErrorPage;
exports.ok = function (body) { return status(200, body); };
exports.created = function (body) { return status(201, body); };
exports.noContent = function () { return IO_1.io.of({ status: 204, body: '' }); };
exports.ok = function (body, other) {
if (other === void 0) { other = {}; }
return status(200, body, other);
};
exports.created = function (body, other) {
if (other === void 0) { other = {}; }
return status(201, body, other);
};
exports.noContent = function (other) {
if (other === void 0) { other = {}; }
return IO_1.io.of(__assign(__assign({}, other), { status: 204, body: '' }));
};
exports.redirect = function (redirect) { return IO_1.io.of({

@@ -83,14 +91,29 @@ applyFilters: false,

}); };
exports.badRequest = function (body) { return status(400, body); };
exports.unauthorized = function (body) { return status(401, body); };
exports.forbidden = function (body) { return status(403, body); };
exports.notFound = function (body) { return status(404, body); };
exports.methodNotAllowed = function (body) { return status(405, body); };
exports.internalServerError = function (body) { return status(500, body); };
exports.badGateway = function (body) { return status(502, body); };
function setTotal(total, response) {
return IO_1.map(function (res) {
return __assign(__assign({}, res), { headers: __assign(__assign({}, res.headers), { 'X-Total-Count': String(total) }) });
})(response);
}
exports.setTotal = setTotal;
exports.badRequest = function (body, other) {
if (other === void 0) { other = {}; }
return status(400, body, other);
};
exports.unauthorized = function (body, other) {
if (other === void 0) { other = {}; }
return status(401, body, other);
};
exports.forbidden = function (body, other) {
if (other === void 0) { other = {}; }
return status(403, body, other);
};
exports.notFound = function (body, other) {
if (other === void 0) { other = {}; }
return status(404, body, other);
};
exports.methodNotAllowed = function (body, other) {
if (other === void 0) { other = {}; }
return status(405, body, other);
};
exports.internalServerError = function (body, other) {
if (other === void 0) { other = {}; }
return status(500, body, other);
};
exports.badGateway = function (body, other) {
if (other === void 0) { other = {}; }
return status(502, body, other);
};
{
"name": "enonic-wizardry",
"version": "0.2.8",
"version": "0.2.9",
"description": "Functional utility library for Enonic XP",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc