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

eurobate-sms

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eurobate-sms - npm Package Compare versions

Comparing version 0.0.2 to 0.1.0

8

es6/enonic.d.ts

@@ -1,5 +0,5 @@

import { Either } from "fp-ts/lib/Either";
import { Error } from 'enonic-fp/lib/common';
import { IOEither } from "fp-ts/lib/IOEither";
import { EnonicError } from 'enonic-fp/lib/common';
import { EurobateParams, EurobateResponse } from "./index";
export declare function json(str: string): Either<Error, any>;
export declare function sendSMS(params: EurobateParams): Either<Error, EurobateResponse>;
export declare function json(str: string): IOEither<EnonicError, any>;
export declare function sendSMS(params: EurobateParams): IOEither<EnonicError, EurobateResponse>;

@@ -1,6 +0,10 @@

import { parseJSON, chain, filterOrElse } from "fp-ts/lib/Either";
import { parseJSON } from "fp-ts/lib/Either";
import { fromEither, chain, filterOrElse } from "fp-ts/lib/IOEither";
import { pipe } from "fp-ts/lib/pipeable";
import { request } from 'enonic-fp/lib/http';
export function json(str) {
return parseJSON(str, function (reason) { return ({ errorKey: "BadRequestError", cause: String(reason) }); });
return fromEither(parseJSON(str, function (reason) { return ({
errorKey: "BadGatewayError",
cause: String(reason)
}); }));
}

@@ -16,3 +20,6 @@ export function sendSMS(params) {

};
return pipe(request(requestParams), chain(function (res) { return json(res.body); }), filterOrElse(function (res) { return res.STATUS !== 'ERROR'; }, function (e) { return ({ errorKey: "BadGatewayError", cause: String(e) }); }));
return pipe(request(requestParams), chain(function (res) { return json(res.body); }), filterOrElse(function (res) { return res.STATUS !== 'ERROR'; }, function (e) { return ({
errorKey: "BadGatewayError",
cause: String(e)
}); }));
}

@@ -1,5 +0,5 @@

import { Either } from "fp-ts/lib/Either";
import { Error } from 'enonic-fp/lib/common';
import { IOEither } from "fp-ts/lib/IOEither";
import { EnonicError } from 'enonic-fp/lib/common';
import { EurobateParams, EurobateResponse } from "./index";
export declare function json(str: string): Either<Error, any>;
export declare function sendSMS(params: EurobateParams): Either<Error, EurobateResponse>;
export declare function json(str: string): IOEither<EnonicError, any>;
export declare function sendSMS(params: EurobateParams): IOEither<EnonicError, EurobateResponse>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Either_1 = require("fp-ts/lib/Either");
var IOEither_1 = require("fp-ts/lib/IOEither");
var pipeable_1 = require("fp-ts/lib/pipeable");
var http_1 = require("enonic-fp/lib/http");
function json(str) {
return Either_1.parseJSON(str, function (reason) { return ({ errorKey: "BadRequestError", cause: String(reason) }); });
return IOEither_1.fromEither(Either_1.parseJSON(str, function (reason) { return ({
errorKey: "BadGatewayError",
cause: String(reason)
}); }));
}

@@ -19,4 +23,7 @@ exports.json = json;

};
return pipeable_1.pipe(http_1.request(requestParams), Either_1.chain(function (res) { return json(res.body); }), Either_1.filterOrElse(function (res) { return res.STATUS !== 'ERROR'; }, function (e) { return ({ errorKey: "BadGatewayError", cause: String(e) }); }));
return pipeable_1.pipe(http_1.request(requestParams), IOEither_1.chain(function (res) { return json(res.body); }), IOEither_1.filterOrElse(function (res) { return res.STATUS !== 'ERROR'; }, function (e) { return ({
errorKey: "BadGatewayError",
cause: String(e)
}); }));
}
exports.sendSMS = sendSMS;
{
"name": "eurobate-sms",
"version": "0.0.2",
"version": "0.1.0",
"description": "Wrapper around the Eurobate APIs for JavaScript and TypeScript",

@@ -20,9 +20,9 @@ "main": "lib/index.js",

"axios": "^0.19.0",
"enonic-fp": "^0.0.5",
"fp-ts": "^2.0.5"
"enonic-fp": "^0.1.8",
"fp-ts": "^2.1.1"
},
"devDependencies": {
"rimraf": "^3.0.0",
"typescript": "^3.5.3"
"typescript": "^3.6.4"
}
}
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