@friggframework/api-module-pipedrive 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,7 @@
1
1
  const mongoose = require('mongoose');
2
- const MongooseUtil = require('../../../utils/MongooseUtil');
3
- const Parent = require('../../../base/models/Credential');
2
+ const { Credential: Parent } = require('@friggframework/module-plugin');
4
3
 
5
- const collectionName = 'PipedriveCredentials';
6
- const parentModelObject = new Parent();
7
-
8
- const _schema = new mongoose.Schema({
4
+ const schema = new mongoose.Schema({
9
5
  accessToken: {
10
6
  type: String,
11
7
  trim: true,
@@ -19,20 +15,5 @@ const _schema = new mongoose.Schema({
19
15
  companyDomain: { type: String },
20
16
  });
21
17
 
22
- const _model = MongooseUtil.createModel(
23
- collectionName,
24
- _schema,
25
- parentModelObject
26
- );
27
-
28
- class Credential extends Parent {
29
- static Schema = _schema;
30
-
31
- static Model = _model;
32
-
33
- constructor(model = _model) {
34
- super(model);
35
- }
36
- }
37
-
38
- module.exports = Credential;
18
+ const Credential = Parent.discriminator('PipedriveCredentials', schema);
19
+ module.exports = { Credential };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.8.0",
2
+ "version": "0.8.1",
3
3
  "name": "@friggframework/api-module-pipedrive",
4
4
  "prettier": "@friggframework/prettier-config",
5
5
  "description": "",