@friggframework/api-module-pipedrive 0.8.5 → 0.8.6
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.
- package/models/credential.js +3 -1
- package/models/entity.js +5 -22
- package/package.json +1 -1
package/models/credential.js
CHANGED
|
@@ -15,5 +15,7 @@ const schema = new mongoose.Schema({
|
|
|
15
15
|
companyDomain: { type: String },
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const name = 'PipedriveCredential';
|
|
19
|
+
const Credential =
|
|
20
|
+
Parent.discriminators?.[name] || Parent.discriminator(name, schema);
|
|
19
21
|
module.exports = { Credential };
|
package/models/entity.js
CHANGED
|
@@ -1,26 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
const mongoose = require('mongoose');
|
|
3
|
-
const
|
|
4
|
-
const Parent = require('../../../base/models/Entity');
|
|
5
|
-
|
|
6
|
-
const collectionName = 'PipedriveEntity';
|
|
7
|
-
const parentModelObject = new Parent();
|
|
8
|
-
|
|
9
|
-
const _schema = new mongoose.Schema({});
|
|
10
|
-
|
|
11
|
-
const _model = MongooseUtil.createModel(
|
|
12
|
-
collectionName,
|
|
13
|
-
_schema,
|
|
14
|
-
parentModelObject
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
class Entity extends Parent {
|
|
18
|
-
static Schema = _schema;
|
|
19
|
-
static Model = _model;
|
|
20
|
-
|
|
21
|
-
constructor(model = _model) {
|
|
22
|
-
super(model);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
3
|
+
const { Entity: Parent } = require('@friggframework/module-plugin');
|
|
25
4
|
|
|
5
|
+
const schema = new mongoose.Schema({});
|
|
6
|
+
const name = 'PipedriveEntity';
|
|
7
|
+
const Entity =
|
|
8
|
+
Parent.discriminators?.[name] || Parent.discriminator(name, schema);
|
|
26
9
|
module.exports = { Entity };
|
package/package.json
CHANGED