UNPKG

mongodb-stitch

Version:

[![Join the chat at https://gitter.im/mongodb/stitch](https://badges.gitter.im/mongodb/stitch.svg)](https://gitter.im/mongodb/stitch?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

119 lines 3.8 kB
(function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); if (v !== undefined) module.exports = v; } else if (typeof define === "function" && define.amd) { define(["require", "exports"], factory); } })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var ServiceConfigCodec = (function () { function ServiceConfigCodec() { } ServiceConfigCodec.prototype.decode = function (from) { var type = from.type; var config = from.config; if (type === "twilio") { config = new TwilioConfigCodec().decode(config); } return { config: config, name: from.name, type: from.type }; }; ServiceConfigCodec.prototype.encode = function (from) { return { config: from.configCodec ? from.configCodec.encode(from.config) : from.config, name: from.name, type: from.type }; }; return ServiceConfigCodec; }()); exports.ServiceConfigCodec = ServiceConfigCodec; var Http = (function () { function Http(name) { this.name = name; this.config = {}; this.type = "http"; } return Http; }()); exports.Http = Http; var Aws = (function () { function Aws(name, config) { this.name = name; this.config = config; this.type = "aws"; } return Aws; }()); exports.Aws = Aws; var AwsS3 = (function () { function AwsS3(name, config) { this.name = name; this.config = config; this.type = "aws-s3"; } return AwsS3; }()); exports.AwsS3 = AwsS3; var AwsSes = (function () { function AwsSes(name, config) { this.name = name; this.config = config; this.type = "aws-ses"; } return AwsSes; }()); exports.AwsSes = AwsSes; var TwilioConfigFields; (function (TwilioConfigFields) { TwilioConfigFields["AuthToken"] = "auth_token"; TwilioConfigFields["AccountSid"] = "sid"; })(TwilioConfigFields = exports.TwilioConfigFields || (exports.TwilioConfigFields = {})); var TwilioConfigCodec = (function () { function TwilioConfigCodec() { } TwilioConfigCodec.prototype.decode = function (from) { return { accountSid: from[TwilioConfigFields.AccountSid], authToken: from[TwilioConfigFields.AuthToken] }; }; TwilioConfigCodec.prototype.encode = function (from) { var _a; return _a = {}, _a[TwilioConfigFields.AuthToken] = from.authToken, _a[TwilioConfigFields.AccountSid] = from.accountSid, _a; }; return TwilioConfigCodec; }()); exports.TwilioConfigCodec = TwilioConfigCodec; var Twilio = (function () { function Twilio(name, config) { this.name = name; this.config = config; this.configCodec = new TwilioConfigCodec(); this.type = "twilio"; } return Twilio; }()); exports.Twilio = Twilio; var Mongo = (function () { function Mongo(name, type, config) { this.name = name; this.type = type; this.config = config; } return Mongo; }()); exports.Mongo = Mongo; }); //# sourceMappingURL=ServiceConfigs.js.map