@dhyasama/totem-models 10.33.1 → 10.35.0
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/lib/Deal.js +1 -1
- package/lib/Organization.js +14 -6
- package/lib/Person.js +10 -3
- package/package.json +1 -1
package/lib/Deal.js
CHANGED
|
@@ -161,7 +161,7 @@ module.exports = function(mongoose, config) {
|
|
|
161
161
|
|
|
162
162
|
query.populate({ path: 'documents', match: { customer: options.CUSTOMER_ID } });
|
|
163
163
|
query.populate({ path: 'messages', match: { customer: options.CUSTOMER_ID } });
|
|
164
|
-
query.populate('organization', 'name aliases description logoUrl website websiteAliases chairs contact social crunchbase foundedOn operating shutdown');
|
|
164
|
+
query.populate('organization', 'name aliases description logoUrl website websiteAliases chairs contact social crunchbase pitchbook foundedOn operating shutdown');
|
|
165
165
|
query.populate('referrer.person', 'name avatarUrl title');
|
|
166
166
|
query.exec(cb);
|
|
167
167
|
|
package/lib/Organization.js
CHANGED
|
@@ -168,6 +168,11 @@ module.exports = function(mongoose, config) {
|
|
|
168
168
|
url: { type: String, unique: true, partialFilterExpression : { type :"string" }, trim: true }
|
|
169
169
|
},
|
|
170
170
|
|
|
171
|
+
pitchbook: {
|
|
172
|
+
uuid: { type: String, unique: true, partialFilterExpression : { type : "string" }, trim: true },
|
|
173
|
+
url: { type: String, unique: true, partialFilterExpression : { type :"string" }, trim: true }
|
|
174
|
+
},
|
|
175
|
+
|
|
171
176
|
carta: {
|
|
172
177
|
corporationid: { type: String, unique: true, partialFilterExpression : { type :"string" }, trim: true }
|
|
173
178
|
},
|
|
@@ -241,7 +246,7 @@ module.exports = function(mongoose, config) {
|
|
|
241
246
|
type: { type: String, enum: ['Text', 'Number', 'Checkbox', 'Single Select', 'Multiple Select', 'Timestamp', 'Tags', 'Person', 'Org', 'Poll'] },
|
|
242
247
|
|
|
243
248
|
// These are the number formats
|
|
244
|
-
format: { type: String, enum: [null, 'number', 'abbreviated', 'decimal', 'financials', 'currency', 'ownership', 'multiple', 'variance', 'M/d/
|
|
249
|
+
format: { type: String, enum: [null, 'number', 'abbreviated', 'decimal', 'financials', 'currency', 'ownership', 'multiple', 'variance', 'M/d/yyyy', 'long'] },
|
|
245
250
|
|
|
246
251
|
// These will be the choices in polls, single-selects and multi-selects
|
|
247
252
|
options: [{
|
|
@@ -416,7 +421,7 @@ module.exports = function(mongoose, config) {
|
|
|
416
421
|
type: { type: String, enum: ['Text', 'Number', 'Checkbox', 'Single Select', 'Multiple Select', 'Timestamp', 'Tags', 'Person', 'Org', 'Poll'] },
|
|
417
422
|
|
|
418
423
|
// These are the number formats
|
|
419
|
-
format: { type: String, enum: [null, 'number', 'abbreviated', 'decimal', 'financials', 'currency', 'ownership', 'multiple', 'variance', 'M/d/
|
|
424
|
+
format: { type: String, enum: [null, 'number', 'abbreviated', 'decimal', 'financials', 'currency', 'ownership', 'multiple', 'variance', 'M/d/yyyy', 'long'] },
|
|
420
425
|
|
|
421
426
|
// These will be the choices in polls, single-selects and multi-selects
|
|
422
427
|
options: [{
|
|
@@ -484,7 +489,7 @@ module.exports = function(mongoose, config) {
|
|
|
484
489
|
type: { type: String, enum: ['Text', 'Number', 'Checkbox', 'Single Select', 'Multiple Select', 'Timestamp', 'Tags', 'Person', 'Org', 'Poll'] },
|
|
485
490
|
|
|
486
491
|
// These are the number formats
|
|
487
|
-
format: { type: String, enum: [null, 'number', 'abbreviated', 'decimal', 'financials', 'currency', 'ownership', 'multiple', 'variance', 'M/d/
|
|
492
|
+
format: { type: String, enum: [null, 'number', 'abbreviated', 'decimal', 'financials', 'currency', 'ownership', 'multiple', 'variance', 'M/d/yyyy', 'long'] },
|
|
488
493
|
|
|
489
494
|
// These will be the choices in polls, single-selects and multi-selects
|
|
490
495
|
options: [{
|
|
@@ -554,7 +559,7 @@ module.exports = function(mongoose, config) {
|
|
|
554
559
|
type: { type: String, enum: ['Text', 'Number', 'Checkbox', 'Single Select', 'Multiple Select', 'Timestamp', 'Tags', 'Person', 'Org', 'Poll'] },
|
|
555
560
|
|
|
556
561
|
// These are the number formats
|
|
557
|
-
format: { type: String, enum: [null, 'number', 'abbreviated', 'decimal', 'financials', 'currency', 'ownership', 'multiple', 'variance', 'M/d/
|
|
562
|
+
format: { type: String, enum: [null, 'number', 'abbreviated', 'decimal', 'financials', 'currency', 'ownership', 'multiple', 'variance', 'M/d/yyyy', 'long'] },
|
|
558
563
|
|
|
559
564
|
// These will be the choices in polls, single-selects and multi-selects
|
|
560
565
|
options: [{
|
|
@@ -1408,7 +1413,8 @@ module.exports = function(mongoose, config) {
|
|
|
1408
1413
|
{ 'social.facebook': new RegExp('facebook.com/' + username + '\/?$', 'i') },
|
|
1409
1414
|
{ 'social.linkedin': new RegExp('linkedin.com/company/' + username + '\/?$', 'i') },
|
|
1410
1415
|
{ 'social.twitter': new RegExp('twitter.com/' + username + '\/?$', 'i') },
|
|
1411
|
-
{ 'crunchbase.url': new RegExp('crunchbase.com/organization/' + username + '\/?$', 'i') }
|
|
1416
|
+
{ 'crunchbase.url': new RegExp('crunchbase.com/organization/' + username + '\/?$', 'i') },
|
|
1417
|
+
{ 'pitchbook.url': new RegExp('pitchbook.com/company/' + username + '\/?$', 'i') },
|
|
1412
1418
|
],
|
|
1413
1419
|
'deleted': { $ne: true }
|
|
1414
1420
|
})
|
|
@@ -1442,6 +1448,7 @@ module.exports = function(mongoose, config) {
|
|
|
1442
1448
|
let linkedinRegexes = _.map(values, function(value) { new RegExp('linkedin.com/company/' + utilities.getUsernameFromUrl(value) + '\/?$', 'i') });
|
|
1443
1449
|
let twitterRegexes = _.map(values, function(value) { new RegExp('twitter.com/' + utilities.getUsernameFromUrl(value) + '\/?$', 'i') });
|
|
1444
1450
|
let crunchbaseRegexes = _.map(values, function(value) { new RegExp('crunchbase.com/organization/' + utilities.getUsernameFromUrl(value) + '\/?$', 'i') });
|
|
1451
|
+
let pitchbookRegexes = _.map(values, function(value) { new RegExp('pitchbook.com/company/' + utilities.getUsernameFromUrl(value) + '\/?$', 'i') });
|
|
1445
1452
|
|
|
1446
1453
|
self
|
|
1447
1454
|
.find({ $or:
|
|
@@ -1449,7 +1456,8 @@ module.exports = function(mongoose, config) {
|
|
|
1449
1456
|
{ 'social.facebook': {$in: facebookRegexes }},
|
|
1450
1457
|
{ 'social.linkedin': {$in: linkedinRegexes }},
|
|
1451
1458
|
{ 'social.twitter': {$in: twitterRegexes }},
|
|
1452
|
-
{ 'crunchbase.url': {$in: crunchbaseRegexes }}
|
|
1459
|
+
{ 'crunchbase.url': {$in: crunchbaseRegexes }},
|
|
1460
|
+
{ 'pitchbook.url': {$in: pitchbookRegexes }}
|
|
1453
1461
|
],
|
|
1454
1462
|
'deleted': { $ne: true }
|
|
1455
1463
|
}).exec(function(err, orgs) {
|
package/lib/Person.js
CHANGED
|
@@ -72,6 +72,11 @@ module.exports = function(mongoose, config) {
|
|
|
72
72
|
url: { type: String, unique: true, partialFilterExpression : { type :"string" }, trim: true }
|
|
73
73
|
},
|
|
74
74
|
|
|
75
|
+
pitchbook: {
|
|
76
|
+
uuid: { type: String, unique: true, required: false, partialFilterExpression : { type :"string" }, trim: true },
|
|
77
|
+
url: { type: String, unique: true, partialFilterExpression : { type :"string" }, trim: true }
|
|
78
|
+
},
|
|
79
|
+
|
|
75
80
|
vCardUrl: { type: String, default: null, trim: true },
|
|
76
81
|
|
|
77
82
|
social: {
|
|
@@ -402,9 +407,10 @@ module.exports = function(mongoose, config) {
|
|
|
402
407
|
if (!values) { return cb(new Error('values is required'), null); }
|
|
403
408
|
|
|
404
409
|
let facebookRegexes = _.map(values, function(value) { new RegExp('facebook.com/' + utilities.getUsernameFromUrl(value) + '\/?$', 'i') });
|
|
405
|
-
let linkedinRegexes = _.map(values, function(value) { new RegExp('linkedin.com/
|
|
410
|
+
let linkedinRegexes = _.map(values, function(value) { new RegExp('linkedin.com/in/' + utilities.getUsernameFromUrl(value) + '\/?$', 'i') });
|
|
406
411
|
let twitterRegexes = _.map(values, function(value) { new RegExp('twitter.com/' + utilities.getUsernameFromUrl(value) + '\/?$', 'i') });
|
|
407
|
-
let crunchbaseRegexes = _.map(values, function(value) { new RegExp('crunchbase.com/
|
|
412
|
+
let crunchbaseRegexes = _.map(values, function(value) { new RegExp('crunchbase.com/person/' + utilities.getUsernameFromUrl(value) + '\/?$', 'i') });
|
|
413
|
+
let pitchbookRegexes = _.map(values, function(value) { new RegExp('pitchbook.com/profiles/person/' + utilities.getUsernameFromUrl(value) + '\/?$', 'i') });
|
|
408
414
|
|
|
409
415
|
self
|
|
410
416
|
.find({ $or:
|
|
@@ -412,7 +418,8 @@ module.exports = function(mongoose, config) {
|
|
|
412
418
|
{ 'social.facebook': {$in: facebookRegexes }},
|
|
413
419
|
{ 'social.linkedin': {$in: linkedinRegexes }},
|
|
414
420
|
{ 'social.twitter': {$in: twitterRegexes }},
|
|
415
|
-
{ 'crunchbase.url': {$in: crunchbaseRegexes }}
|
|
421
|
+
{ 'crunchbase.url': {$in: crunchbaseRegexes }},
|
|
422
|
+
{ 'pitchbook.url': {$in: pitchbookRegexes }},
|
|
416
423
|
],
|
|
417
424
|
'deleted': { $ne: true }
|
|
418
425
|
}).exec(cb);
|