UNPKG

@becomes/cms

Version:

Simple CMS for building APIs.

16 lines 673 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.KeyFactory = void 0; var crypto = require("crypto"); var key_model_1 = require("../models/key.model"); var mongoose_1 = require("mongoose"); var KeyFactory = (function () { function KeyFactory() { } KeyFactory.instance = function (config) { return new key_model_1.Key(new mongoose_1.Types.ObjectId(), Date.now(), Date.now(), config.userId, config.name, config.desc, config.blocked, crypto.randomBytes(256).toString('base64').substring(32, 64), config.access); }; return KeyFactory; }()); exports.KeyFactory = KeyFactory; //# sourceMappingURL=key.factory.js.map