UNPKG

architect-sdk

Version:

Essentialz Architect SDK

43 lines (42 loc) 1.8 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.EmailProvider = void 0; var errors_1 = require("../../errors"); var BaseProvider_1 = require("./BaseProvider"); var types_1 = require("../types"); var EmailProvider = /** @class */ (function (_super) { __extends(EmailProvider, _super); function EmailProvider(httpClient) { return _super.call(this, types_1.ArchitectAuthProvider.Email, httpClient) || this; } EmailProvider.prototype.validateCredentials = function (credentials) { var _a = credentials, email = _a.email, password = _a.password; if (!email || !email.length // TODO: Test email regex || !password || !password.length) { throw new errors_1.ArchitectError(this.formatErrorMessage(credentials, { email: 'string', password: 'string', })); } }; return EmailProvider; }(BaseProvider_1.BaseProvider)); exports.EmailProvider = EmailProvider;