@pipedream/bloomerang 0.0.1 → 0.1.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.
@@ -0,0 +1,63 @@
1
+ import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform";
2
+ import app from "../../bloomerang.app.mjs";
3
+
4
+ export default {
5
+ props: {
6
+ app,
7
+ db: "$.service.db",
8
+ timer: {
9
+ type: "$.interface.timer",
10
+ default: {
11
+ intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
12
+ },
13
+ },
14
+ },
15
+ methods: {
16
+ _getLastId() {
17
+ return this.db.get("lastId") || 0;
18
+ },
19
+ _setLastId(lastId) {
20
+ this.db.set("lastId", lastId);
21
+ },
22
+ async emitEvent(maxResults = false) {
23
+ const lastId = this._getLastId();
24
+
25
+ const response = this.app.paginate({
26
+ fn: this.getFunction(),
27
+ params: {
28
+ orderBy: "CreatedDate",
29
+ orderDirection: "Desc",
30
+ },
31
+ });
32
+
33
+ let responseArray = [];
34
+ for await (const item of response) {
35
+ if (item.Id <= lastId) break;
36
+ responseArray.push(item);
37
+ }
38
+
39
+ if (responseArray.length) {
40
+ if (maxResults && (responseArray.length > maxResults)) {
41
+ responseArray.length = maxResults;
42
+ }
43
+ this._setLastId(responseArray[0].Id);
44
+ }
45
+
46
+ for (const item of responseArray.reverse()) {
47
+ this.$emit(item, {
48
+ id: item.Id,
49
+ summary: this.getSummary(item),
50
+ ts: Date.parse(item.AuditTrail.CreatedDate || new Date()),
51
+ });
52
+ }
53
+ },
54
+ },
55
+ hooks: {
56
+ async deploy() {
57
+ await this.emitEvent(25);
58
+ },
59
+ },
60
+ async run() {
61
+ await this.emitEvent();
62
+ },
63
+ };
@@ -0,0 +1,22 @@
1
+ import common from "../common/base.mjs";
2
+ import sampleEmit from "./test-event.mjs";
3
+
4
+ export default {
5
+ ...common,
6
+ key: "bloomerang-new-constituent",
7
+ name: "New Constituent Created",
8
+ description: "Emit new event when a new constituent profile is created in Bloomerang.",
9
+ version: "0.0.1",
10
+ type: "source",
11
+ dedupe: "unique",
12
+ methods: {
13
+ ...common.methods,
14
+ getFunction() {
15
+ return this.app.listConstituents;
16
+ },
17
+ getSummary(item) {
18
+ return `New Constituent: ${item.FullName}`;
19
+ },
20
+ },
21
+ sampleEmit,
22
+ };
@@ -0,0 +1,152 @@
1
+ export default {
2
+ "Id": 0,
3
+ "AccountNumber": 0,
4
+ "IsInHousehold": true,
5
+ "IsHeadOfHousehold": true,
6
+ "IsFavorite": true,
7
+ "FullCustomProfileImageId": 0,
8
+ "FullCustomProfileImageUrl": "string",
9
+ "CroppedCustomProfileImageId": 0,
10
+ "CroppedCustomProfileImageUrl": "string",
11
+ "Type": "Individual",
12
+ "Status": "Active",
13
+ "FirstName": "string",
14
+ "LastName": "string",
15
+ "MiddleName": "string",
16
+ "Prefix": "string",
17
+ "Suffix": "string",
18
+ "FullName": "string",
19
+ "InformalName": "string",
20
+ "FormalName": "string",
21
+ "EnvelopeName": "string",
22
+ "RecognitionName": "string",
23
+ "JobTitle": "string",
24
+ "Employer": "string",
25
+ "Website": "string",
26
+ "FacebookId": "string",
27
+ "TwitterId": "string",
28
+ "LinkedInId": "string",
29
+ "Gender": "Male",
30
+ "Birthdate": "2025-04-02",
31
+ "ProfilePictureType": "None",
32
+ "PrimaryPhone": {
33
+ "Id": 0,
34
+ "AccountId": 0,
35
+ "Type": "Home",
36
+ "Extension": "string",
37
+ "Number": "string",
38
+ "IsPrimary": true
39
+ },
40
+ "HouseholdId": 0,
41
+ "PreferredCommunicationChannel": "Email",
42
+ "CommunicationRestrictions": [
43
+ "DoNotCall"
44
+ ],
45
+ "CommunicationRestrictionsUpdateReason": "string",
46
+ "EmailInterestType": "All",
47
+ "CustomEmailInterests": [
48
+ {
49
+ "Id": 0,
50
+ "Name": "string"
51
+ }
52
+ ],
53
+ "EmailInterestsUpdateReason": "string",
54
+ "PrimaryAddress": {
55
+ "Id": 0,
56
+ "AccountId": 0,
57
+ "Type": "Home",
58
+ "Street": "string",
59
+ "City": "string",
60
+ "State": "string",
61
+ "PostalCode": "string",
62
+ "Country": "string",
63
+ "IsPrimary": true,
64
+ "IsBad": true,
65
+ "AuditTrail": {
66
+ "CreatedDate": "2025-04-02T14:26:18.373Z",
67
+ "CreatedName": "string",
68
+ "LastModifiedDate": "2025-04-02T14:26:18.373Z",
69
+ "LastModifiedName": "string"
70
+ },
71
+ "StateAbbreviation": "string",
72
+ "CountryCode": "string"
73
+ },
74
+ "PrimaryEmail": {
75
+ "Id": 0,
76
+ "AccountId": 0,
77
+ "Type": "Home",
78
+ "Value": "user@example.com",
79
+ "IsPrimary": true,
80
+ "IsBad": true,
81
+ "AuditTrail": {
82
+ "CreatedDate": "2025-04-02T14:26:18.373Z",
83
+ "CreatedName": "string",
84
+ "LastModifiedDate": "2025-04-02T14:26:18.373Z",
85
+ "LastModifiedName": "string"
86
+ }
87
+ },
88
+ "EngagementScore": "Low",
89
+ "DonorSearchInfo": {
90
+ "Id": 0,
91
+ "GenerosityScore": "Low",
92
+ "AnnualFundLikelihood": "Low",
93
+ "MajorGiftLikelihood": "Low",
94
+ "Quality": "Low",
95
+ "LargestGiftMin": 0,
96
+ "LargestGiftMax": 0,
97
+ "WealthAskMin": 0,
98
+ "WealthAskMax": 0,
99
+ "BusinessExecutive": true,
100
+ "NamesScreened": "string",
101
+ "DateTimeScreenedUtc": "string"
102
+ },
103
+ "AddressIds": [
104
+ 0
105
+ ],
106
+ "EmailIds": [
107
+ 0
108
+ ],
109
+ "PhoneIds": [
110
+ 0
111
+ ],
112
+ "CustomValues": [
113
+ {
114
+ "FieldId": 0,
115
+ "Value": {
116
+ "Id": 0,
117
+ "Value": "string"
118
+ }
119
+ },
120
+ {
121
+ "FieldId": 0,
122
+ "Values": [
123
+ {
124
+ "Id": 0,
125
+ "Value": "string"
126
+ }
127
+ ]
128
+ }
129
+ ],
130
+ "GroupsDetails": [
131
+ {
132
+ "Id": 0,
133
+ "Name": "string",
134
+ "Description": "string"
135
+ }
136
+ ],
137
+ "AuditTrail": {
138
+ "CreatedDate": "2025-04-02T14:26:18.373Z",
139
+ "CreatedName": "string",
140
+ "LastModifiedDate": "2025-04-02T14:26:18.373Z",
141
+ "LastModifiedName": "string"
142
+ },
143
+ "Membership": [
144
+ {
145
+ "MembershipScheduleId": 0,
146
+ "MembershipProgramName": "string",
147
+ "MembershipLevelName": "string",
148
+ "MembershipStatus": "string",
149
+ "MembershipRenewalDate": "string"
150
+ }
151
+ ]
152
+ }
@@ -0,0 +1,22 @@
1
+ import common from "../common/base.mjs";
2
+ import sampleEmit from "./test-event.mjs";
3
+
4
+ export default {
5
+ ...common,
6
+ key: "bloomerang-new-donation",
7
+ name: "New Donation",
8
+ description: "Emit new event when a donation is received in Bloomerang.",
9
+ version: "0.0.1",
10
+ type: "source",
11
+ dedupe: "unique",
12
+ methods: {
13
+ ...common.methods,
14
+ getFunction() {
15
+ return this.app.listTransactions;
16
+ },
17
+ getSummary(item) {
18
+ return `New Donation from ${item.AccountId}`;
19
+ },
20
+ },
21
+ sampleEmit,
22
+ };
@@ -0,0 +1,402 @@
1
+ export default {
2
+ "Id": 0,
3
+ "TransactionNumber": 0,
4
+ "NonDeductibleAmount": 0,
5
+ "AccountId": 0,
6
+ "Date": "2025-04-02",
7
+ "Amount": 0,
8
+ "Method": "None",
9
+ "EntryMethod": "Tap",
10
+ "MethodOrigin": "Forms",
11
+ "CheckNumber": "string",
12
+ "CheckDate": "2025-04-02",
13
+ "CreditCardType": "Visa",
14
+ "CreditCardLastFourDigits": "string",
15
+ "CreditCardExpMonth": 0,
16
+ "CreditCardExpYear": 0,
17
+ "EftAccountType": "Checking",
18
+ "EftLastFourDigits": "string",
19
+ "EftRoutingNumber": "string",
20
+ "InKindDescription": "string",
21
+ "InKindType": "Goods",
22
+ "InKindMarketValue": 0,
23
+ "IntegrationUrl": "string",
24
+ "Designations": [
25
+ {
26
+ "Id": 0,
27
+ "DesignationNumber": 0,
28
+ "TransactionId": 0,
29
+ "Amount": 0,
30
+ "NonDeductibleAmount": 0,
31
+ "Note": "string",
32
+ "AcknowledgementStatus": "Yes",
33
+ "AcknowledgementInteractionIds": [
34
+ 0
35
+ ],
36
+ "Fund": {
37
+ "Id": 0,
38
+ "Name": "string"
39
+ },
40
+ "QuickbooksAccount": {
41
+ "Id": 0,
42
+ "Name": "string"
43
+ },
44
+ "Campaign": {
45
+ "Id": 0,
46
+ "Name": "string"
47
+ },
48
+ "Appeal": {
49
+ "Id": 0,
50
+ "Name": "string"
51
+ },
52
+ "Tribute": {
53
+ "Id": 0,
54
+ "Name": "string"
55
+ },
56
+ "TributeType": "InHonorOf",
57
+ "SoftCreditIds": [
58
+ 0
59
+ ],
60
+ "AttachmentIds": [
61
+ 0
62
+ ],
63
+ "CustomValues": [
64
+ {
65
+ "FieldId": 0,
66
+ "Value": {
67
+ "Id": 0,
68
+ "Value": "string"
69
+ }
70
+ },
71
+ {
72
+ "FieldId": 0,
73
+ "Values": [
74
+ {
75
+ "Id": 0,
76
+ "Value": "string"
77
+ }
78
+ ]
79
+ }
80
+ ],
81
+ "QuickBooksOnlineStatus": "string",
82
+ "AuditTrail": {
83
+ "CreatedDate": "2025-04-02T14:25:37.376Z",
84
+ "CreatedName": "string",
85
+ "LastModifiedDate": "2025-04-02T14:25:37.376Z",
86
+ "LastModifiedName": "string"
87
+ },
88
+ "Type": "Donation"
89
+ },
90
+ {
91
+ "Id": 0,
92
+ "DesignationNumber": 0,
93
+ "TransactionId": 0,
94
+ "Amount": 0,
95
+ "NonDeductibleAmount": 0,
96
+ "Note": "string",
97
+ "AcknowledgementStatus": "Yes",
98
+ "AcknowledgementInteractionIds": [
99
+ 0
100
+ ],
101
+ "Fund": {
102
+ "Id": 0,
103
+ "Name": "string"
104
+ },
105
+ "QuickbooksAccount": {
106
+ "Id": 0,
107
+ "Name": "string"
108
+ },
109
+ "Campaign": {
110
+ "Id": 0,
111
+ "Name": "string"
112
+ },
113
+ "Appeal": {
114
+ "Id": 0,
115
+ "Name": "string"
116
+ },
117
+ "Tribute": {
118
+ "Id": 0,
119
+ "Name": "string"
120
+ },
121
+ "TributeType": "InHonorOf",
122
+ "SoftCreditIds": [
123
+ 0
124
+ ],
125
+ "AttachmentIds": [
126
+ 0
127
+ ],
128
+ "CustomValues": [
129
+ {
130
+ "FieldId": 0,
131
+ "Value": {
132
+ "Id": 0,
133
+ "Value": "string"
134
+ }
135
+ },
136
+ {
137
+ "FieldId": 0,
138
+ "Values": [
139
+ {
140
+ "Id": 0,
141
+ "Value": "string"
142
+ }
143
+ ]
144
+ }
145
+ ],
146
+ "QuickBooksOnlineStatus": "string",
147
+ "AuditTrail": {
148
+ "CreatedDate": "2025-04-02T14:25:37.376Z",
149
+ "CreatedName": "string",
150
+ "LastModifiedDate": "2025-04-02T14:25:37.376Z",
151
+ "LastModifiedName": "string"
152
+ },
153
+ "Type": "Pledge",
154
+ "PledgePaymentIds": [
155
+ 0
156
+ ],
157
+ "PledgeInstallments": [
158
+ {
159
+ "Id": 0,
160
+ "PledgeId": 0,
161
+ "Date": "2025-04-02",
162
+ "Amount": 0
163
+ }
164
+ ],
165
+ "PledgeBalance": 0,
166
+ "LastPaymentStatus": "AtRisk",
167
+ "PledgeStatus": "InGoodStanding",
168
+ "PledgeWriteOffs": [
169
+ {
170
+ "Id": 0,
171
+ "PledgeId": 0,
172
+ "Date": "2025-04-02",
173
+ "Amount": 0
174
+ }
175
+ ],
176
+ "PledgeAmountInArrears": 0,
177
+ "PledgeNextInstallmentDate": "2025-04-02",
178
+ "PledgeFrequencyIsEditable": true
179
+ },
180
+ {
181
+ "Id": 0,
182
+ "DesignationNumber": 0,
183
+ "TransactionId": 0,
184
+ "Amount": 0,
185
+ "NonDeductibleAmount": 0,
186
+ "Note": "string",
187
+ "AcknowledgementStatus": "Yes",
188
+ "AcknowledgementInteractionIds": [
189
+ 0
190
+ ],
191
+ "Fund": {
192
+ "Id": 0,
193
+ "Name": "string"
194
+ },
195
+ "QuickbooksAccount": {
196
+ "Id": 0,
197
+ "Name": "string"
198
+ },
199
+ "Campaign": {
200
+ "Id": 0,
201
+ "Name": "string"
202
+ },
203
+ "Appeal": {
204
+ "Id": 0,
205
+ "Name": "string"
206
+ },
207
+ "Tribute": {
208
+ "Id": 0,
209
+ "Name": "string"
210
+ },
211
+ "TributeType": "InHonorOf",
212
+ "SoftCreditIds": [
213
+ 0
214
+ ],
215
+ "AttachmentIds": [
216
+ 0
217
+ ],
218
+ "CustomValues": [
219
+ {
220
+ "FieldId": 0,
221
+ "Value": {
222
+ "Id": 0,
223
+ "Value": "string"
224
+ }
225
+ },
226
+ {
227
+ "FieldId": 0,
228
+ "Values": [
229
+ {
230
+ "Id": 0,
231
+ "Value": "string"
232
+ }
233
+ ]
234
+ }
235
+ ],
236
+ "QuickBooksOnlineStatus": "string",
237
+ "AuditTrail": {
238
+ "CreatedDate": "2025-04-02T14:25:37.376Z",
239
+ "CreatedName": "string",
240
+ "LastModifiedDate": "2025-04-02T14:25:37.376Z",
241
+ "LastModifiedName": "string"
242
+ },
243
+ "Type": "PledgePayment",
244
+ "PledgeId": 0
245
+ },
246
+ {
247
+ "Id": 0,
248
+ "DesignationNumber": 0,
249
+ "TransactionId": 0,
250
+ "Amount": 0,
251
+ "NonDeductibleAmount": 0,
252
+ "Note": "string",
253
+ "AcknowledgementStatus": "Yes",
254
+ "AcknowledgementInteractionIds": [
255
+ 0
256
+ ],
257
+ "Fund": {
258
+ "Id": 0,
259
+ "Name": "string"
260
+ },
261
+ "QuickbooksAccount": {
262
+ "Id": 0,
263
+ "Name": "string"
264
+ },
265
+ "Campaign": {
266
+ "Id": 0,
267
+ "Name": "string"
268
+ },
269
+ "Appeal": {
270
+ "Id": 0,
271
+ "Name": "string"
272
+ },
273
+ "Tribute": {
274
+ "Id": 0,
275
+ "Name": "string"
276
+ },
277
+ "TributeType": "InHonorOf",
278
+ "SoftCreditIds": [
279
+ 0
280
+ ],
281
+ "AttachmentIds": [
282
+ 0
283
+ ],
284
+ "CustomValues": [
285
+ {
286
+ "FieldId": 0,
287
+ "Value": {
288
+ "Id": 0,
289
+ "Value": "string"
290
+ }
291
+ },
292
+ {
293
+ "FieldId": 0,
294
+ "Values": [
295
+ {
296
+ "Id": 0,
297
+ "Value": "string"
298
+ }
299
+ ]
300
+ }
301
+ ],
302
+ "QuickBooksOnlineStatus": "string",
303
+ "AuditTrail": {
304
+ "CreatedDate": "2025-04-02T14:25:37.377Z",
305
+ "CreatedName": "string",
306
+ "LastModifiedDate": "2025-04-02T14:25:37.377Z",
307
+ "LastModifiedName": "string"
308
+ },
309
+ "RecurringDonationEndDate": "2025-04-02",
310
+ "RecurringDonationFrequency": "Weekly",
311
+ "RecurringDonationDay1": 0,
312
+ "RecurringDonationDay2": 0,
313
+ "RecurringDonationStartDate": "2025-04-02",
314
+ "Type": "RecurringDonation",
315
+ "RecurringDonationPaymentIds": [
316
+ 0
317
+ ],
318
+ "RecurringDonationNextInstallmentDate": "2025-04-02",
319
+ "RecurringDonationLastPaymentStatus": "AtRisk",
320
+ "RecurringDonationStatus": "Active"
321
+ },
322
+ {
323
+ "Id": 0,
324
+ "DesignationNumber": 0,
325
+ "TransactionId": 0,
326
+ "Amount": 0,
327
+ "NonDeductibleAmount": 0,
328
+ "Note": "string",
329
+ "AcknowledgementStatus": "Yes",
330
+ "AcknowledgementInteractionIds": [
331
+ 0
332
+ ],
333
+ "Fund": {
334
+ "Id": 0,
335
+ "Name": "string"
336
+ },
337
+ "QuickbooksAccount": {
338
+ "Id": 0,
339
+ "Name": "string"
340
+ },
341
+ "Campaign": {
342
+ "Id": 0,
343
+ "Name": "string"
344
+ },
345
+ "Appeal": {
346
+ "Id": 0,
347
+ "Name": "string"
348
+ },
349
+ "Tribute": {
350
+ "Id": 0,
351
+ "Name": "string"
352
+ },
353
+ "TributeType": "InHonorOf",
354
+ "SoftCreditIds": [
355
+ 0
356
+ ],
357
+ "AttachmentIds": [
358
+ 0
359
+ ],
360
+ "CustomValues": [
361
+ {
362
+ "FieldId": 0,
363
+ "Value": {
364
+ "Id": 0,
365
+ "Value": "string"
366
+ }
367
+ },
368
+ {
369
+ "FieldId": 0,
370
+ "Values": [
371
+ {
372
+ "Id": 0,
373
+ "Value": "string"
374
+ }
375
+ ]
376
+ }
377
+ ],
378
+ "QuickBooksOnlineStatus": "string",
379
+ "AuditTrail": {
380
+ "CreatedDate": "2025-04-02T14:25:37.377Z",
381
+ "CreatedName": "string",
382
+ "LastModifiedDate": "2025-04-02T14:25:37.377Z",
383
+ "LastModifiedName": "string"
384
+ },
385
+ "Type": "RecurringDonationPayment",
386
+ "RecurringDonationId": 0
387
+ }
388
+ ],
389
+ "AttachmentIds": [
390
+ 0
391
+ ],
392
+ "IsRefunded": "Yes",
393
+ "RefundIds": [
394
+ 0
395
+ ],
396
+ "AuditTrail": {
397
+ "CreatedDate": "2025-04-02T14:25:37.377Z",
398
+ "CreatedName": "string",
399
+ "LastModifiedDate": "2025-04-02T14:25:37.377Z",
400
+ "LastModifiedName": "string"
401
+ }
402
+ }
@@ -0,0 +1,22 @@
1
+ import common from "../common/base.mjs";
2
+ import sampleEmit from "./test-event.mjs";
3
+
4
+ export default {
5
+ ...common,
6
+ key: "bloomerang-new-interaction",
7
+ name: "New Interaction",
8
+ description: "Emit new event when a new interaction is logged for a constituent.",
9
+ version: "0.0.1",
10
+ type: "source",
11
+ dedupe: "unique",
12
+ methods: {
13
+ ...common.methods,
14
+ getFunction() {
15
+ return this.app.listInteractions;
16
+ },
17
+ getSummary(item) {
18
+ return `New Interaction: ${item.Channel}`;
19
+ },
20
+ },
21
+ sampleEmit,
22
+ };