New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

blastengine

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blastengine - npm Package Compare versions

Comparing version
2.3.6
to
2.3.7
+1
-1
package.json
{
"name": "blastengine",
"version": "2.3.6",
"version": "2.3.7",
"description": "",

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

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

// import Transaction from './transaction';
import BEObject from "./object";

@@ -10,2 +9,3 @@ import Report from "./report";

InsertCode,
SuccessJsonFormat,
Unsubscribed,

@@ -299,2 +299,17 @@ } from "../../types/";

/**
* Cancels the bulk delivery.
*
* @async
* @return {Promise<SuccessJsonFormat>} - The result of the cancel operation.
* @throws Will throw an error if deliveryId is not found.
*/
async cancel(): Promise<SuccessJsonFormat> {
if (!this.deliveryId) throw new Error("Delivery id is not found.");
const url = `/deliveries/${this.deliveryId!}/cancel`;
const res = await Base.request
.send("patch", url) as SuccessJsonFormat;
return res;
}
/**
* Retrieves information about the delivery, based on the deliveryId.

@@ -301,0 +316,0 @@ *

@@ -151,17 +151,2 @@ import Base from "./base";

/**
* Cancels the bulk delivery.
*
* @async
* @return {Promise<SuccessJsonFormat>} - The result of the cancel operation.
* @throws Will throw an error if deliveryId is not found.
*/
async cancel(): Promise<SuccessJsonFormat> {
if (!this.deliveryId) throw new Error("Delivery id is not found.");
const url = `/deliveries/${this.deliveryId!}/cancel`;
const res = await Bulk.request
.send("patch", url) as SuccessJsonFormat;
return res;
}
/**
* Gets an Email instance for the current bulk delivery.

@@ -258,3 +243,5 @@ *

if (!date) return {};
const reservationTime = format(date, "%FT%T%z", {timeZone: "Asia/Tokyo"})
const reservationTime = format(date, "yyyy-MM-dd'T'HH:mm:ssXXX", {
timeZone: "Asia/Tokyo",
})
.replace("+0900", "+09:00");

@@ -261,0 +248,0 @@ return {

@@ -251,3 +251,3 @@ import Base from "./base";

}
if (sendTime || this.params.to.length > 1) {
if (sendTime) {
return this.sendBulk(sendTime);

@@ -254,0 +254,0 @@ }

@@ -141,3 +141,4 @@ import fetch, {Response, RequestInit} from "node-fetch";

} else if (requestInit.method!.toUpperCase() === "POST" ||
requestInit.method!.toUpperCase() === "PUT") {
requestInit.method!.toUpperCase() === "PUT" ||
requestInit.method!.toUpperCase() === "PATCH") {
requestInit.body = JSON.stringify(params);

@@ -144,0 +145,0 @@ }

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

import exp from 'constants';
import { BlastEngine, Mail } from '../src/';

@@ -116,2 +117,20 @@ import config from './config.json';

});
test('Mail (bulk) can cancel', async () => {
const mail = new Mail;
mail
.setFrom(config.from.email, config.from.name)
.setSubject('Unsubscribed email test');
mail
.addTo(config.to)
.setText('メールの本文');
// 30 sec
await mail.send(new Date(Date.now() + 30000));
await mail.get();
expect(mail.status).toBe('RESERVE');
await mail.cancel();
await mail.get();
expect(mail.status).toBe('EDIT');
});
});