UNPKG

@teamsight/flight

Version:

Lambda life cycles

31 lines 1.36 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const inversify_1 = require("inversify"); inversify_1.injectable(); class PublishSns { constructor(sns) { this.sns = sns; } publish(msg, topic) { return __awaiter(this, void 0, void 0, function* () { const params = { Message: JSON.stringify(msg), TopicArn: `arn:aws:sns:us-east-1:944684780256:${topic}` }; console.log(`topic ${topic}`, params); const result = yield this.sns.publish(params).promise(); console.log(result); console.log("done with publish"); }); } } exports.PublishSns = PublishSns; //# sourceMappingURL=publish-sns.js.map