UNPKG

pushy-me

Version:

pushy-me is a simple push notification service for Node.js

31 lines (30 loc) 1.49 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const apiKey_1 = require("./value-objects/apiKey"); const pushy_me_service_1 = require("./services/pushy-me.service"); class PushyMe { constructor(pushyMeInterface, apiKey) { this.pushyMeInterface = pushyMeInterface; this.apiKey = apiKey; this.pushyMeInterface.setApiKey(apiKey); } static initialize(apiKey) { const value = new apiKey_1.ApiKey(apiKey); return new PushyMe(new pushy_me_service_1.PushyMeService(), value.get()); } sendPushNotification(data, recipient, options) { return __awaiter(this, void 0, void 0, function* () { return this.pushyMeInterface.sendPushNotification(data, recipient, options); }); } } exports.default = PushyMe;