blastengine
Advanced tools
+1
-1
| { | ||
| "name": "blastengine", | ||
| "version": "2.3.6", | ||
| "version": "2.3.7", | ||
| "description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
+16
-1
@@ -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 @@ * |
+3
-16
@@ -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 { |
+1
-1
@@ -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 @@ } |
+19
-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; | ||
| .setFrom(config.from.email, config.from.name) | ||
| .setSubject('Unsubscribed email test'); | ||
| .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'); | ||
| }); | ||
| }); |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Embedded URLs or IPs
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Embedded URLs or IPs
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
222204
0.23%6432
0.31%