@plunk/node
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -0,1 +1,2 @@ | ||
import { PublishParams } from "../types/events"; | ||
export declare class Plunk { | ||
@@ -12,10 +13,9 @@ private readonly key; | ||
/** | ||
* Publishes an event | ||
* @param {string} event The event you want to publish | ||
* @param {string} email The email associated with this event | ||
* Publishes an event to Plunk | ||
* @param {Object} event | ||
* @param {string} event.event - The event you want to publish | ||
* @param {string} event.email - The email associated with this event | ||
* @param {Object=} event.data - The user data associated with this event | ||
*/ | ||
publish: ({ event, email }: { | ||
event: string; | ||
email: string; | ||
}) => Promise<{ | ||
publish: ({ event, email, data }: PublishParams) => Promise<{ | ||
success: true; | ||
@@ -22,0 +22,0 @@ }>; |
@@ -14,11 +14,13 @@ "use strict"; | ||
/** | ||
* Publishes an event | ||
* @param {string} event The event you want to publish | ||
* @param {string} email The email associated with this event | ||
* Publishes an event to Plunk | ||
* @param {Object} event | ||
* @param {string} event.event - The event you want to publish | ||
* @param {string} event.email - The email associated with this event | ||
* @param {Object=} event.data - The user data associated with this event | ||
*/ | ||
publish: ({ event, email }) => tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
publish: ({ event, email, data }) => tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
return yield (0, request_1.request)(this.client, { | ||
method: "POST", | ||
url: "/", | ||
body: { event, email }, | ||
body: { event, email, data }, | ||
}); | ||
@@ -30,3 +32,3 @@ }), | ||
baseURL: (options === null || options === void 0 ? void 0 : options.debug) | ||
? "http://localhost:8080" | ||
? "http://localhost:8080/v1" | ||
: "https://api.useplunk.com/v1", | ||
@@ -33,0 +35,0 @@ headers: { |
{ | ||
"name": "@plunk/node", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Official Node.js library for useplunk.com", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
7832
20
177