@dhyasama/totem-models 9.100.0 → 9.102.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.
@@ -137,6 +137,16 @@ module.exports = function(mongoose, config) {
137
137
 
138
138
  };
139
139
 
140
+ LimitedPartnerCommunication.statics.getByPostmarkMessageId = function getByPostmarkMessageId(postmarkMessageId, cb) {
141
+
142
+ const self = this;
143
+
144
+ const query = self.findOne({ postmarkMessageId: postmarkMessageId });
145
+
146
+ query.exec(cb);
147
+
148
+ };
149
+
140
150
  LimitedPartnerCommunication.statics.getUnsentByCampaigns = function getUnsentByCampaigns(campaignIds, options, cb) {
141
151
 
142
152
  const self = this;
@@ -166,6 +176,20 @@ module.exports = function(mongoose, config) {
166
176
 
167
177
  };
168
178
 
179
+ LimitedPartnerCommunication.statics.modifyOne = function modifyOne(conditions, update, options, cb) {
180
+
181
+ const self = this;
182
+
183
+ if (!cb) throw new Error('cb is required');
184
+ if (!query) { return cb(new Error('query is required'), null); }
185
+ if (!update) { return cb(new Error('update is required'), null); }
186
+
187
+ const query = self.findOneAndUpdate(conditions, update, { upsert: false, new: true });
188
+
189
+ query.exec(cb);
190
+
191
+ };
192
+
169
193
  // Remove all the docs associated with a campaign
170
194
  LimitedPartnerCommunication.statics.removeByCampaign = function removeByCampaign(campaignId, options, cb) {
171
195
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "9.100.0",
3
+ "version": "9.102.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",