@friggframework/api-module-attentive
Advanced tools
Comparing version 0.8.0 to 0.8.1
const mongoose = require('mongoose'); | ||
const MongooseUtil = require('../../../utils/MongooseUtil'); | ||
const Parent = require('../../../base/models/Credential'); | ||
const { Credential: Parent } = require('@friggframework/module-plugin'); | ||
const collectionName = 'AttentiveCredentials'; | ||
const parentModelObject = new Parent(); | ||
const _schema = new mongoose.Schema({ | ||
access_token: { type: String, trim: true, lhEncrypt: true }, | ||
id_token: { type: String, trim: true, lhEncrypt: true }, | ||
token_type: { type: String, default: 'Bearer' }, | ||
expires_in: { type: Number }, | ||
const schema = new mongoose.Schema({ | ||
access_token: { type: String, trim: true, lhEncrypt: true }, | ||
id_token: { type: String, trim: true, lhEncrypt: true }, | ||
token_type: { type: String, default: 'Bearer' }, | ||
expires_in: { type: Number }, | ||
}); | ||
const _model = MongooseUtil.createModel(collectionName, _schema, parentModelObject); | ||
class Credential extends Parent { | ||
static Schema = _schema; | ||
static Model = _model; | ||
constructor(model = _model) { | ||
super(model); | ||
} | ||
} | ||
module.exports = Credential; | ||
const Credential = Parent.discriminator('AttentiveCredentials', schema); | ||
module.exports = { Credential }; |
@@ -1,27 +0,7 @@ | ||
'use strict'; | ||
const mongoose = require('mongoose'); | ||
const MongooseUtil = require('../../../utils/MongooseUtil'); | ||
const Parent = require('../../../base/models/Entity'); | ||
const { Entity: Parent } = require('@friggframework/module-plugin'); | ||
const collectionName = 'AttentiveEntity'; | ||
const parentModelObject = new Parent(); | ||
const schema = new mongoose.Schema({}); | ||
const _schema = new mongoose.Schema({}); | ||
const _model = MongooseUtil.createModel( | ||
collectionName, | ||
_schema, | ||
parentModelObject | ||
); | ||
class Entity extends Parent { | ||
static Schema = _schema; | ||
static Model = _model; | ||
constructor(model = _model) { | ||
super(model); | ||
} | ||
} | ||
module.exports = Entity; | ||
const Entity = Parent.discriminator('AttentiveEntity', schema); | ||
module.exports = { Entity }; |
{ | ||
"name": "@friggframework/api-module-attentive", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"prettier": "@friggframework/prettier-config", | ||
@@ -5,0 +5,0 @@ "description": "", |
21493
557