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

enonic-wizardry

Package Overview
Dependencies
Maintainers
2
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.3.1 to 0.3.2

5

context.d.ts

@@ -0,2 +1,7 @@

import { IOEither } from "fp-ts/IOEither";
import { RunContext } from "enonic-types/context";
export declare function chainRun(runContext: RunContext): <E, A, B>(f: (a: A) => IOEither<E, B>) => (ma: IOEither<E, A>) => IOEither<E, B>;
export declare const runAsSuperUser: <A>(a: import("fp-ts/lib/IO").IO<A>) => import("fp-ts/lib/IO").IO<A>;
export declare const runInDraftContext: <A>(a: import("fp-ts/lib/IO").IO<A>) => import("fp-ts/lib/IO").IO<A>;
export declare const chainRunAsSuperUser: <E, A, B>(f: (a: A) => IOEither<E, B>) => (ma: IOEither<E, A>) => IOEither<E, B>;
export declare const chainRunInDraftContext: <E, A, B>(f: (a: A) => IOEither<E, B>) => (ma: IOEither<E, A>) => IOEither<E, B>;

16

context.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.runInDraftContext = exports.runAsSuperUser = void 0;
exports.chainRunInDraftContext = exports.chainRunAsSuperUser = exports.runInDraftContext = exports.runAsSuperUser = exports.chainRun = void 0;
var context_1 = require("enonic-fp/context");
var IOEither_1 = require("fp-ts/IOEither");
function chainRun(runContext) {
return function (f) { return IOEither_1.chain(function (a) { return context_1.run(runContext)(f(a)); }); };
}
exports.chainRun = chainRun;
exports.runAsSuperUser = context_1.run({

@@ -14,1 +19,10 @@ user: {

});
exports.chainRunAsSuperUser = chainRun({
user: {
login: "su",
idProvider: 'system'
}
});
exports.chainRunInDraftContext = chainRun({
branch: 'draft'
});

18

package.json
{
"name": "enonic-wizardry",
"sideEffects": false,
"version": "0.3.1",
"version": "0.3.2",
"description": "Functional utility library for Enonic XP",

@@ -29,14 +29,14 @@ "main": "lib/index.js",

"dependencies": {
"enonic-fp": "^0.3.1",
"enonic-types": "^0.1.2",
"fp-ts": "2.8.2",
"io-ts": "^2.2.10"
"enonic-fp": "^0.3.2",
"enonic-types": "^0.1.4",
"fp-ts": "^2.8.5",
"io-ts": "^2.2.12"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.1.1",
"@typescript-eslint/parser": "^4.1.1",
"eslint": "^7.9.0",
"@typescript-eslint/eslint-plugin": "^4.6.0",
"@typescript-eslint/parser": "^4.6.0",
"eslint": "^7.12.1",
"rimraf": "^3.0.2",
"typescript": "^4.0.3"
"typescript": "^4.0.5"
}
}

@@ -14,4 +14,4 @@ # Enonic Wizardry

We recommend using this library together with its sister library:
[enonic-ts-codegen](https://github.com/ItemConsulting/enonic-ts-codegen). *enonic-ts-codegen* will create TypeScript
We recommend using this library together with the
[xp-codegen-plugin](https://github.com/ItemConsulting/xp-codegen-plugin) Gradle plugin. *xp-codegen-plugin* will create TypeScript
`interfaces` for your content-types. Those interfaces will be very useful together with this library.

@@ -58,3 +58,3 @@

1. We import an `interface Article { ... }` generated by
[enonic-ts-codegen](https://github.com/ItemConsulting/enonic-ts-codegen).
[xp-codegen-plugin](https://github.com/ItemConsulting/xp-codegen-plugin).
2. We use the imported `Request` and `Response` to control the shape of our controller.

@@ -61,0 +61,0 @@ 3. We use the `pipe` function from *fp-ts* to pipe the result of one function into the next one.

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