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

postmark

Package Overview
Dependencies
Maintainers
2
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postmark - npm Package Compare versions

Comparing version 2.3.2 to 2.3.4

3

dist/client/models/bounces/BounceFilteringParameters.d.ts

@@ -38,3 +38,4 @@ import { FilteringParameters } from "../client/FilteringParameters";

toDate?: string;
constructor(count?: number, offset?: number, type?: BounceType, inactive?: boolean, emailFilter?: string, tag?: string, messageID?: string, fromDate?: string, toDate?: string);
messageStream?: string;
constructor(count?: number, offset?: number, type?: BounceType, inactive?: boolean, emailFilter?: string, tag?: string, messageID?: string, fromDate?: string, toDate?: string, messageStream?: string);
}

@@ -45,3 +45,3 @@ "use strict";

__extends(BounceFilteringParameters, _super);
function BounceFilteringParameters(count, offset, type, inactive, emailFilter, tag, messageID, fromDate, toDate) {
function BounceFilteringParameters(count, offset, type, inactive, emailFilter, tag, messageID, fromDate, toDate, messageStream) {
if (count === void 0) { count = 100; }

@@ -57,2 +57,3 @@ if (offset === void 0) { offset = 0; }

_this.toDate = toDate;
_this.messageStream = messageStream;
return _this;

@@ -59,0 +60,0 @@ }

@@ -22,7 +22,5 @@ export * from "./client/ClientOptions";

export * from "./stats/StatsFilteringParameters";
export * from "./triggers/Tag";
export * from "./triggers/InboundRule";
export * from "./triggers/TriggerFilteringParameters";
export * from "./webhooks/Webhooks";
export * from "./webhooks/Webhook";
export * from "./webhooks/WebhookFilteringParameters";

@@ -18,7 +18,5 @@ "use strict";

__export(require("./stats/StatsFilteringParameters"));
__export(require("./triggers/Tag"));
__export(require("./triggers/InboundRule"));
__export(require("./triggers/TriggerFilteringParameters"));
__export(require("./webhooks/Webhook"));
__export(require("./webhooks/WebhookFilteringParameters"));
//# sourceMappingURL=index.js.map

@@ -28,3 +28,3 @@ import { FilteringParameters } from "../client/FilteringParameters";

messageStream?: string;
constructor(count?: number, offset?: number, recipient?: string, fromEmail?: string, tag?: string, status?: OutboundMessageStatus, fromDate?: string, toDate?: string, subject?: string);
constructor(count?: number, offset?: number, recipient?: string, fromEmail?: string, tag?: string, status?: OutboundMessageStatus, fromDate?: string, toDate?: string, subject?: string, messageStream?: string);
}

@@ -64,3 +64,3 @@ /**

messageStream?: string;
constructor(count?: number, offset?: number, recipient?: string, tag?: string, client_name?: string, client_company?: string, client_family?: string, os_name?: string, os_family?: string, os_company?: string, platform?: string, country?: string, region?: string, city?: string);
constructor(count?: number, offset?: number, recipient?: string, tag?: string, client_name?: string, client_company?: string, client_family?: string, os_name?: string, os_family?: string, os_company?: string, platform?: string, country?: string, region?: string, city?: string, messageStream?: string);
}

@@ -67,0 +67,0 @@ export declare class OutboundMessageOpensFilteringParameters extends OutboundMessageTrackingFilteringParameters {

@@ -35,3 +35,3 @@ "use strict";

__extends(OutboundMessagesFilteringParameters, _super);
function OutboundMessagesFilteringParameters(count, offset, recipient, fromEmail, tag, status, fromDate, toDate, subject) {
function OutboundMessagesFilteringParameters(count, offset, recipient, fromEmail, tag, status, fromDate, toDate, subject, messageStream) {
if (count === void 0) { count = 100; }

@@ -47,2 +47,3 @@ if (offset === void 0) { offset = 0; }

_this.subject = subject;
_this.messageStream = messageStream;
return _this;

@@ -82,3 +83,3 @@ }

__extends(OutboundMessageTrackingFilteringParameters, _super);
function OutboundMessageTrackingFilteringParameters(count, offset, recipient, tag, client_name, client_company, client_family, os_name, os_family, os_company, platform, country, region, city) {
function OutboundMessageTrackingFilteringParameters(count, offset, recipient, tag, client_name, client_company, client_family, os_name, os_family, os_company, platform, country, region, city, messageStream) {
if (count === void 0) { count = 100; }

@@ -99,2 +100,3 @@ if (offset === void 0) { offset = 0; }

_this.city = city;
_this.messageStream = messageStream;
return _this;

@@ -101,0 +103,0 @@ }

import BaseClient from "./BaseClient";
import { Callback, ClientOptions, DefaultResponse, FilteringParameters } from "./models/index";
import { Bounce, BounceActivationResponse, BounceCounts, BounceDump, BounceFilteringParameters, Bounces, BrowserUsageCounts, ClickCounts, ClickLocationCounts, ClickPlaformUsageCounts, CreateInboundRuleRequest, CreateTagTriggerRequest, CreateTemplateRequest, CreateWebhookRequest, DeliveryStatistics, EmailClientUsageCounts, EmailPlaformUsageCounts, EmailReadTimesCounts, InboundMessageDetails, InboundMessages, InboundMessagesFilteringParameters, InboundRule, InboundRules, Message, MessageSendingResponse, OpenCounts, OutboundMessageClicks, OutboundMessageClicksFilteringParameters, OutboundMessageDetails, OutboundMessageDump, OutboundMessageOpens, OutboundMessageOpensFilteringParameters, OutboundMessages, OutboundMessagesFilteringParameters, OutboundStatistics, SentCounts, Server, SpamCounts, StatisticsFilteringParameters, TagTrigger, TagTriggerFilteringParameters, TagTriggers, Template, TemplatedMessage, TemplateFilteringParameters, Templates, TemplateValidation, TemplateValidationOptions, TrackedEmailCounts, UpdateServerRequest, UpdateTagTriggerRequest, UpdateTemplateRequest, UpdateWebhookRequest, Webhook, WebhookFilteringParameters, Webhooks } from "./models/index";
import { Bounce, BounceActivationResponse, BounceCounts, BounceDump, BounceFilteringParameters, Bounces, BrowserUsageCounts, ClickCounts, ClickLocationCounts, ClickPlaformUsageCounts, CreateInboundRuleRequest, CreateTemplateRequest, CreateWebhookRequest, DeliveryStatistics, EmailClientUsageCounts, EmailPlaformUsageCounts, EmailReadTimesCounts, InboundMessageDetails, InboundMessages, InboundMessagesFilteringParameters, InboundRule, InboundRules, Message, MessageSendingResponse, OpenCounts, OutboundMessageClicks, OutboundMessageClicksFilteringParameters, OutboundMessageDetails, OutboundMessageDump, OutboundMessageOpens, OutboundMessageOpensFilteringParameters, OutboundMessages, OutboundMessagesFilteringParameters, OutboundStatistics, SentCounts, Server, SpamCounts, StatisticsFilteringParameters, Template, TemplatedMessage, TemplateFilteringParameters, Templates, TemplateValidation, TemplateValidationOptions, TrackedEmailCounts, UpdateServerRequest, UpdateTemplateRequest, UpdateWebhookRequest, Webhook, WebhookFilteringParameters, Webhooks } from "./models/index";
/**

@@ -343,43 +343,2 @@ * Server client class that can be used to interact with an individual Postmark Server.

/**
* Create a new Tag Trigger.
*
* @param options - Configuration options to be used to create the trigger.
* @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
* @returns A promise that will complete when the API responds (or an error occurs).
*/
createTagTrigger(options: CreateTagTriggerRequest, callback?: Callback<TagTrigger>): Promise<TagTrigger>;
/**
* Modify an existing Tag Trigger.
*
* @param id - The ID of the Tag Trigger you wish to modify.
* @param options - Tag trigger options
* @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
* @returns A promise that will complete when the API responds (or an error occurs).
*/
editTagTrigger(id: number, options: UpdateTagTriggerRequest, callback?: Callback<TagTrigger>): Promise<TagTrigger>;
/**
* Delete an existing Tag Trigger.
*
* @param id - The ID of the Tag Trigger you wish to delete.
* @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
* @returns A promise that will complete when the API responds (or an error occurs).
*/
deleteTagTrigger(id: number, callback?: Callback<DefaultResponse>): Promise<DefaultResponse>;
/**
* Get a specific Tag Trigger.
*
* @param id - The ID of the Tag Trigger you wish to retrieve.
* @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
* @returns A promise that will complete when the API responds (or an error occurs).
*/
getTagTrigger(id: number, callback?: Callback<TagTrigger>): Promise<TagTrigger>;
/**
* Get a list of Tag Trigger.
*
* @param filter - Optional filtering parameters.
* @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
* @returns A promise that will complete when the API responds (or an error occurs).
*/
getTagTriggers(filter?: TagTriggerFilteringParameters, callback?: Callback<TagTriggers>): Promise<TagTriggers>;
/**
* Create an Inbound Rule Trigger.

@@ -386,0 +345,0 @@ *

@@ -469,55 +469,2 @@ "use strict";

/**
* Create a new Tag Trigger.
*
* @param options - Configuration options to be used to create the trigger.
* @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
* @returns A promise that will complete when the API responds (or an error occurs).
*/
ServerClient.prototype.createTagTrigger = function (options, callback) {
return this.processRequestWithBody(index_1.ClientOptions.HttpMethod.POST, "/triggers/tags", options, callback);
};
/**
* Modify an existing Tag Trigger.
*
* @param id - The ID of the Tag Trigger you wish to modify.
* @param options - Tag trigger options
* @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
* @returns A promise that will complete when the API responds (or an error occurs).
*/
ServerClient.prototype.editTagTrigger = function (id, options, callback) {
return this.processRequestWithBody(index_1.ClientOptions.HttpMethod.PUT, "/triggers/tags/" + id, options, callback);
};
/**
* Delete an existing Tag Trigger.
*
* @param id - The ID of the Tag Trigger you wish to delete.
* @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
* @returns A promise that will complete when the API responds (or an error occurs).
*/
ServerClient.prototype.deleteTagTrigger = function (id, callback) {
return this.processRequestWithoutBody(index_1.ClientOptions.HttpMethod.DELETE, "/triggers/tags/" + id, {}, callback);
};
/**
* Get a specific Tag Trigger.
*
* @param id - The ID of the Tag Trigger you wish to retrieve.
* @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
* @returns A promise that will complete when the API responds (or an error occurs).
*/
ServerClient.prototype.getTagTrigger = function (id, callback) {
return this.processRequestWithoutBody(index_1.ClientOptions.HttpMethod.GET, "/triggers/tags/" + id, {}, callback);
};
/**
* Get a list of Tag Trigger.
*
* @param filter - Optional filtering parameters.
* @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
* @returns A promise that will complete when the API responds (or an error occurs).
*/
ServerClient.prototype.getTagTriggers = function (filter, callback) {
if (filter === void 0) { filter = new index_2.TagTriggerFilteringParameters(); }
this.setDefaultPaginationValues(filter);
return this.processRequestWithoutBody(index_1.ClientOptions.HttpMethod.GET, "/triggers/tags/", filter, callback);
};
/**
* Create an Inbound Rule Trigger.

@@ -524,0 +471,0 @@ *

@@ -12,3 +12,3 @@ {

],
"version": "2.3.2",
"version": "2.3.4",
"author": "Igor Balos",

@@ -15,0 +15,0 @@ "contributors": [

import { expect } from "chai";
import "mocha";
import { CreateInboundRuleRequest, CreateTagTriggerRequest } from "../../src/client/models";
import { CreateInboundRuleRequest } from "../../src/client/models";
import * as postmark from "../../src/index";

@@ -14,6 +14,2 @@

function tagTriggerToTest() {
return new CreateTagTriggerRequest(`${triggerName}_${Date.now()}`, true);
}
function inboundRuleTriggerToTest() {

@@ -23,12 +19,2 @@ return new CreateInboundRuleRequest(`${triggerName}-${Date.now()}.com`);

async function cleanupTagTriggers() {
const tagTriggers = await client.getTagTriggers();
for (const tagTrigger of tagTriggers.Tags) {
if (tagTrigger.MatchName.includes(triggerName)) {
await client.deleteTagTrigger(tagTrigger.ID);
}
}
}
async function cleanupInboundRuleTriggers() {

@@ -45,3 +31,2 @@ const inboundRuleTriggers = await client.getInboundRuleTriggers();

async function cleanup() {
await cleanupTagTriggers();
await cleanupInboundRuleTriggers();

@@ -52,43 +37,3 @@ }

after(cleanup);
it("createTagTrigger", async () => {
const tagTriggerOptions = tagTriggerToTest();
const result = await client.createTagTrigger(tagTriggerOptions);
expect(result.MatchName).to.equal(tagTriggerOptions.MatchName);
});
it("editTagTrigger", async () => {
const tagTriggerOptions = tagTriggerToTest();
const editMatchName: string = `${tagTriggerOptions.MatchName}-updated`;
const tagTrigger = await client.createTagTrigger(tagTriggerOptions);
const tagTriggerDetails = await client.editTagTrigger(tagTrigger.ID, { MatchName: editMatchName });
expect(tagTriggerDetails.MatchName).to.equal(editMatchName);
});
it("deleteTagTrigger", async () => {
const tagTriggerOptions = tagTriggerToTest();
const tagTrigger = await client.createTagTrigger(tagTriggerOptions);
const response = await client.deleteTagTrigger(tagTrigger.ID);
expect(response.Message.length).to.above(0);
});
it("getTagTriggers", async () => {
const tagTriggerOptions = tagTriggerToTest();
await client.createTagTrigger(tagTriggerOptions);
const tagTriggers = await client.getTagTriggers();
expect(tagTriggers.Tags.length).to.above(0);
});
it("getTagTrigger", async () => {
const tagTriggerOptions = tagTriggerToTest();
await client.createTagTrigger(tagTriggerOptions);
const tagTriggers = await client.getTagTriggers();
const tagTrigger = await client.getTagTrigger(tagTriggers.Tags[0].ID);
expect(tagTrigger.ID).to.above(0);
});
it("createInboundRuleTrigger", async () => {

@@ -95,0 +40,0 @@ const inboundRuleTriggerOptions = inboundRuleTriggerToTest();

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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