@altostra/core
Version:
Core library for shared types and logic
1 lines • 2.09 kB
JavaScript
;var _SignupNotification_bossUrl,__awaiter=this&&this.__awaiter||function(e,i,t,r){return new(t||(t=Promise))((function(o,a){function n(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var i;e.done?o(e.value):(i=e.value,i instanceof t?i:new t((function(e){e(i)}))).then(n,s)}c((r=r.apply(e,i||[])).next())}))},__classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(e,i,t,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof i?e!==i||!o:!i.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,t):o?o.value=t:i.set(e,t),t},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(e,i,t,r){if("a"===t&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof i?e!==i||!r:!i.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?r:"a"===t?r.call(e):r?r.value:i.get(e)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.SignupNotification=void 0;const primitives_1=require("@altostra/type-validations/lib/primitives"),ServiceClientBase_1=require("../ServiceClientBase");class SignupNotification extends ServiceClientBase_1.ServiceClientBase{constructor({bossUrl:e,getToken:i,logger:t,axios:r}){super({serviceName:"Sign-up slack notifier",getToken:i,errorMapping:{},logger:t,axios:r}),_SignupNotification_bossUrl.set(this,void 0),__classPrivateFieldSet(this,_SignupNotification_bossUrl,e,"f")}notifySignup(e){return __awaiter(this,void 0,void 0,(function*(){yield this._request({request:i=>__awaiter(this,void 0,void 0,(function*(){return yield i.post(__classPrivateFieldGet(this,_SignupNotification_bossUrl,"f")+"/users/signup",e,{headers:yield this._getHeaders()})})),dataValidation:primitives_1.any,errorWrapping:{}})}))}}exports.SignupNotification=SignupNotification,_SignupNotification_bossUrl=new WeakMap;