From d9f205fd62d1888cd0b7cca678e25134c1ad2cec Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Tue, 1 Apr 2025 10:00:52 -0300 Subject: [PATCH 1/7] bloomerang init --- .../add-interaction/add-interaction.mjs | 57 ++++ .../create-constituent/create-constituent.mjs | 73 ++++++ .../create-donation/create-donation.mjs | 72 +++++ components/bloomerang/bloomerang.app.mjs | 245 +++++++++++++++++- components/bloomerang/package.json | 2 +- .../new-constituent/new-constituent.mjs | 77 ++++++ .../sources/new-donation/new-donation.mjs | 97 +++++++ .../new-interaction/new-interaction.mjs | 94 +++++++ 8 files changed, 711 insertions(+), 6 deletions(-) create mode 100644 components/bloomerang/actions/add-interaction/add-interaction.mjs create mode 100644 components/bloomerang/actions/create-constituent/create-constituent.mjs create mode 100644 components/bloomerang/actions/create-donation/create-donation.mjs create mode 100644 components/bloomerang/sources/new-constituent/new-constituent.mjs create mode 100644 components/bloomerang/sources/new-donation/new-donation.mjs create mode 100644 components/bloomerang/sources/new-interaction/new-interaction.mjs diff --git a/components/bloomerang/actions/add-interaction/add-interaction.mjs b/components/bloomerang/actions/add-interaction/add-interaction.mjs new file mode 100644 index 0000000000000..27d1b400e60fe --- /dev/null +++ b/components/bloomerang/actions/add-interaction/add-interaction.mjs @@ -0,0 +1,57 @@ +import bloomerang from "../../bloomerang.app.mjs"; +import { axios } from "@pipedream/platform"; + +export default { + key: "bloomerang-add-interaction", + name: "Add Interaction", + description: "Adds an interaction to an existing constituent in Bloomerang. [See the documentation](https://bloomerang.co/product/integrations-data-management/api/rest-api/)", + version: "0.0.1", + type: "action", + props: { + bloomerang, + constituentId: { + propDefinition: [ + bloomerang, + "constituentId", + ], + }, + interactionType: { + propDefinition: [ + bloomerang, + "interactionType", + ], + }, + interactionDate: { + propDefinition: [ + bloomerang, + "interactionDate", + ], + }, + notes: { + propDefinition: [ + bloomerang, + "notes", + ], + optional: true, + }, + campaignId: { + propDefinition: [ + bloomerang, + "campaignId", + ], + optional: true, + }, + }, + async run({ $ }) { + const response = await this.bloomerang.createInteraction({ + constituentId: this.constituentId, + interactionType: this.interactionType, + interactionDate: this.interactionDate, + notes: this.notes, + campaignId: this.campaignId, + }); + + $.export("$summary", `Successfully added interaction with ID ${response.id}`); + return response; + }, +}; diff --git a/components/bloomerang/actions/create-constituent/create-constituent.mjs b/components/bloomerang/actions/create-constituent/create-constituent.mjs new file mode 100644 index 0000000000000..0b38085d8eb38 --- /dev/null +++ b/components/bloomerang/actions/create-constituent/create-constituent.mjs @@ -0,0 +1,73 @@ +import bloomerang from "../../bloomerang.app.mjs"; +import { axios } from "@pipedream/platform"; + +export default { + key: "bloomerang-create-constituent", + name: "Create Constituent", + description: "Creates a new constituent in Bloomerang. [See the documentation](https://bloomerang.co/product/integrations-data-management/api/rest-api/)", + version: "0.0.{{ts}}", + type: "action", + props: { + bloomerang, + constituentType: { + propDefinition: [ + bloomerang, + "constituentType", + ], + }, + name: { + type: "string", + label: "Name", + description: "The name of the constituent", + }, + contactDetails: { + type: "string", + label: "Contact Details", + description: "Contact details of the constituent in JSON format", + }, + address: { + type: "string", + label: "Address", + description: "Address of the constituent", + optional: true, + }, + tags: { + type: "string[]", + label: "Tags", + description: "Tags for the constituent", + optional: true, + }, + customFields: { + type: "string[]", + label: "Custom Fields", + description: "Custom fields for the constituent in JSON format", + optional: true, + }, + }, + async run({ $ }) { + const data = { + constituentType: this.constituentType, + name: this.name, + contactDetails: JSON.parse(this.contactDetails), + address: this.address + ? JSON.parse(this.address) + : undefined, + tags: this.tags, + customFields: this.customFields + ? this.customFields.map(JSON.parse) + : undefined, + }; + + const response = await axios($, { + method: "POST", + url: `${this.bloomerang._baseUrl()}/constituents`, + headers: { + Authorization: `Bearer ${this.bloomerang.$auth.api_key}`, + }, + data, + }); + + $.export("$summary", `Successfully created constituent with ID ${response.id}`); + return response; + }, +}; diff --git a/components/bloomerang/actions/create-donation/create-donation.mjs b/components/bloomerang/actions/create-donation/create-donation.mjs new file mode 100644 index 0000000000000..d030f6cac8f59 --- /dev/null +++ b/components/bloomerang/actions/create-donation/create-donation.mjs @@ -0,0 +1,72 @@ +import bloomerang from "../../bloomerang.app.mjs"; +import { axios } from "@pipedream/platform"; + +export default { + key: "bloomerang-create-donation", + name: "Create Donation", + description: "Creates a new donation record in Bloomerang. [See the documentation](https://bloomerang.co/product/integrations-data-management/api/rest-api/)", + version: "0.0.{{ts}}", + type: "action", + props: { + bloomerang, + constituentId: { + propDefinition: [ + bloomerang, + "constituentId", + ], + }, + amount: { + propDefinition: [ + bloomerang, + "amount", + ], + }, + fundId: { + propDefinition: [ + bloomerang, + "fundId", + ], + }, + date: { + propDefinition: [ + bloomerang, + "date", + ], + }, + paymentMethod: { + propDefinition: [ + bloomerang, + "paymentMethod", + ], + optional: true, + }, + note: { + propDefinition: [ + bloomerang, + "note", + ], + optional: true, + }, + appeal: { + propDefinition: [ + bloomerang, + "appeal", + ], + optional: true, + }, + }, + async run({ $ }) { + const response = await this.bloomerang.createDonation({ + constituentId: this.constituentId, + amount: this.amount, + fundId: this.fundId, + date: this.date, + paymentMethod: this.paymentMethod, + note: this.note, + appeal: this.appeal, + }); + + $.export("$summary", `Successfully created donation with ID: ${response.id}`); + return response; + }, +}; diff --git a/components/bloomerang/bloomerang.app.mjs b/components/bloomerang/bloomerang.app.mjs index ce26e01555960..5de610ef53afb 100644 --- a/components/bloomerang/bloomerang.app.mjs +++ b/components/bloomerang/bloomerang.app.mjs @@ -1,11 +1,246 @@ +import { axios } from "@pipedream/platform"; + export default { type: "app", app: "bloomerang", - propDefinitions: {}, + propDefinitions: { + donationType: { + type: "string", + label: "Donation Type", + description: "Filter donations by type", + optional: true, + async options() { + const response = await this._makeRequest({ + path: "/donation-types", + }); + return response.map((type) => ({ + label: type.name, + value: type.id, + })); + }, + }, + fundId: { + type: "string", + label: "Fund", + description: "Filter donations by fund", + optional: true, + async options() { + const response = await this._makeRequest({ + path: "/funds", + }); + return response.map((fund) => ({ + label: fund.name, + value: fund.id, + })); + }, + }, + constituentType: { + type: "string", + label: "Constituent Type", + description: "Filter constituents by type", + optional: true, + async options() { + const response = await this._makeRequest({ + path: "/constituent-types", + }); + return response.map((type) => ({ + label: type.name, + value: type.id, + })); + }, + }, + interactionType: { + type: "string", + label: "Interaction Type", + description: "Filter interactions by type", + optional: true, + async options() { + const response = await this._makeRequest({ + path: "/interaction-types", + }); + return response.map((type) => ({ + label: type.name, + value: type.id, + })); + }, + }, + campaignId: { + type: "string", + label: "Campaign", + description: "Filter interactions by campaign", + optional: true, + async options() { + const response = await this._makeRequest({ + path: "/campaigns", + }); + return response.map((campaign) => ({ + label: campaign.name, + value: campaign.id, + })); + }, + }, + constituentId: { + type: "string", + label: "Constituent ID", + description: "The ID of the constituent", + }, + amount: { + type: "string", + label: "Amount", + description: "The amount for the donation", + }, + date: { + type: "string", + label: "Date", + description: "The date of the donation", + }, + paymentMethod: { + type: "string", + label: "Payment Method", + description: "The method of payment", + optional: true, + }, + note: { + type: "string", + label: "Note", + description: "A note for the donation", + optional: true, + }, + appeal: { + type: "string", + label: "Appeal", + description: "An appeal for the donation", + optional: true, + }, + name: { + type: "string", + label: "Name", + description: "The name of the constituent", + }, + contactDetails: { + type: "string", + label: "Contact Details", + description: "Contact details of the constituent", + }, + address: { + type: "string", + label: "Address", + description: "Address of the constituent", + optional: true, + }, + tags: { + type: "string[]", + label: "Tags", + description: "Tags for the constituent", + optional: true, + }, + customFields: { + type: "string[]", + label: "Custom Fields", + description: "Custom fields for the constituent", + optional: true, + }, + interactionDate: { + type: "string", + label: "Interaction Date", + description: "The date of the interaction", + }, + notes: { + type: "string", + label: "Notes", + description: "Notes for the interaction", + optional: true, + }, + }, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + _baseUrl() { + return "https://api.bloomerang.co/v2"; + }, + async _makeRequest(opts = {}) { + const { + $ = this, method = "GET", path = "/", headers, ...otherOpts + } = opts; + return axios($, { + ...otherOpts, + method, + url: this._baseUrl() + path, + headers: { + ...headers, + Authorization: `Bearer ${this.$auth.api_key}`, + }, + }); + }, + async listDonationTypes() { + return this._makeRequest({ + path: "/donation-types", + }); + }, + async listFunds() { + return this._makeRequest({ + path: "/funds", + }); + }, + async listConstituentTypes() { + return this._makeRequest({ + path: "/constituent-types", + }); + }, + async listInteractionTypes() { + return this._makeRequest({ + path: "/interaction-types", + }); + }, + async listCampaigns() { + return this._makeRequest({ + path: "/campaigns", + }); + }, + async createDonation({ + constituentId, amount, fundId, date, paymentMethod, note, appeal, + }) { + return this._makeRequest({ + method: "POST", + path: "/donations", + data: { + constituentId, + amount, + fundId, + date, + paymentMethod, + note, + appeal, + }, + }); + }, + async createConstituent({ + constituentType, name, contactDetails, address, tags, customFields, + }) { + return this._makeRequest({ + method: "POST", + path: "/constituents", + data: { + constituentType, + name, + contactDetails, + address, + tags, + customFields, + }, + }); + }, + async createInteraction({ + constituentId, interactionType, interactionDate, notes, campaignId, + }) { + return this._makeRequest({ + method: "POST", + path: `/constituents/${constituentId}/interactions`, + data: { + interactionType, + interactionDate, + notes, + campaignId, + }, + }); }, }, -}; \ No newline at end of file +}; diff --git a/components/bloomerang/package.json b/components/bloomerang/package.json index 37efabd11d289..c4c9da61a2551 100644 --- a/components/bloomerang/package.json +++ b/components/bloomerang/package.json @@ -12,4 +12,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/components/bloomerang/sources/new-constituent/new-constituent.mjs b/components/bloomerang/sources/new-constituent/new-constituent.mjs new file mode 100644 index 0000000000000..6096c2e9a86e4 --- /dev/null +++ b/components/bloomerang/sources/new-constituent/new-constituent.mjs @@ -0,0 +1,77 @@ +import { axios } from "@pipedream/platform"; +import bloomerang from "../../bloomerang.app.mjs"; + +export default { + key: "bloomerang-new-constituent", + name: "New Constituent Created", + description: "Emit new event when a new constituent profile is created in Bloomerang. [See the documentation](https://bloomerang.co/product/integrations-data-management/api/rest-api/)", + version: "0.0.{{ts}}", + type: "source", + dedupe: "unique", + props: { + bloomerang, + db: "$.service.db", + timer: { + type: "$.interface.timer", + default: { + intervalSeconds: 900, // Every 15 minutes + }, + }, + constituentType: { + propDefinition: [ + bloomerang, + "constituentType", + ], + }, + }, + methods: { + _getLastTimestamp() { + return this.db.get("lastTimestamp") || new Date(0).toISOString(); + }, + _setLastTimestamp(timestamp) { + this.db.set("lastTimestamp", timestamp); + }, + async _getConstituents(afterTimestamp) { + const params = { + dateCreatedOnOrAfter: afterTimestamp, + }; + if (this.constituentType) { + params.constituentType = this.constituentType; + } + + return this.bloomerang._makeRequest({ + path: "/constituents", + params, + }); + }, + }, + hooks: { + async deploy() { + const constituents = await this._getConstituents(new Date().toISOString()); + constituents.slice(-50).reverse() + .forEach(this.emitConstituent); + }, + }, + async run() { + const lastTimestamp = this._getLastTimestamp(); + const constituents = await this._getConstituents(lastTimestamp); + + for (const constituent of constituents) { + this.emitConstituent(constituent); + } + + if (constituents.length > 0) { + const newLastTimestamp = new Date( + Math.max(...constituents.map((c) => new Date(c.dateCreatedOn))), + ).toISOString(); + this._setLastTimestamp(newLastTimestamp); + } + }, + emitConstituent(constituent) { + this.$emit(constituent, { + id: constituent.id.toString(), + summary: `New Constituent: ${constituent.name}`, + ts: new Date(constituent.dateCreatedOn).getTime(), + }); + }, +}; diff --git a/components/bloomerang/sources/new-donation/new-donation.mjs b/components/bloomerang/sources/new-donation/new-donation.mjs new file mode 100644 index 0000000000000..e290293196df7 --- /dev/null +++ b/components/bloomerang/sources/new-donation/new-donation.mjs @@ -0,0 +1,97 @@ +import bloomerang from "../../bloomerang.app.mjs"; +import { axios } from "@pipedream/platform"; + +export default { + key: "bloomerang-new-donation", + name: "New Donation", + description: "Emit a new event when a donation is received in Bloomerang. [See the documentation](https://bloomerang.co/product/integrations-data-management/api/rest-api/)", + version: "0.0.{{ts}}", + type: "source", + dedupe: "unique", + props: { + bloomerang, + db: "$.service.db", + timer: { + type: "$.interface.timer", + default: { + intervalSeconds: 900, + }, + }, + donationType: { + propDefinition: [ + bloomerang, + "donationType", + ], + }, + fundId: { + propDefinition: [ + bloomerang, + "fundId", + ], + }, + }, + methods: { + _getLastDonationTimestamp() { + return this.db.get("lastDonationTimestamp") || 0; + }, + _setLastDonationTimestamp(ts) { + this.db.set("lastDonationTimestamp", ts); + }, + async _getDonations() { + const params = { + donationType: this.donationType, + fundId: this.fundId, + since: this._getLastDonationTimestamp(), + }; + return this.bloomerang._makeRequest({ + path: "/donations", + params, + }); + }, + }, + hooks: { + async deploy() { + const donations = await this._getDonations(); + const emitDonations = donations.slice(-50).reverse(); // Emit at most 50 latest donations + + for (const donation of emitDonations) { + this.$emit(donation, { + id: donation.id, + summary: `New Donation from ${donation.constituentId}`, + ts: new Date(donation.date).getTime(), + }); + } + + if (donations.length > 0) { + const latestTimestamp = new Date(donations[0].date).getTime(); + this._setLastDonationTimestamp(latestTimestamp); + } + }, + }, + async run() { + const lastTimestamp = this._getLastDonationTimestamp(); + + const params = { + donationType: this.donationType, + fundId: this.fundId, + }; + + const donations = await this._getDonations(params); + + for (const donation of donations) { + const donationTimestamp = new Date(donation.date).getTime(); + if (donationTimestamp > lastTimestamp) { + this.$emit(donation, { + id: donation.id, + summary: `New Donation: ${donation.amount}`, + ts: donationTimestamp, + }); + } + } + + if (donations.length > 0) { + const latestTimestamp = new Date(donations[0].date).getTime(); + this._setLastDonationTimestamp(latestTimestamp); + } + }, +}; diff --git a/components/bloomerang/sources/new-interaction/new-interaction.mjs b/components/bloomerang/sources/new-interaction/new-interaction.mjs new file mode 100644 index 0000000000000..37f7807cf9452 --- /dev/null +++ b/components/bloomerang/sources/new-interaction/new-interaction.mjs @@ -0,0 +1,94 @@ +import { axios } from "@pipedream/platform"; +import bloomerang from "../../bloomerang.app.mjs"; + +export default { + key: "bloomerang-new-interaction", + name: "New Interaction", + description: "Emit new event when a new interaction is logged for a constituent. [See the documentation](https://bloomerang.co/product/integrations-data-management/api/)", + version: "0.0.{{ts}}", + type: "source", + dedupe: "unique", + props: { + bloomerang, + db: "$.service.db", + timer: { + type: "$.interface.timer", + default: { + intervalSeconds: 900, // Every 15 minutes + }, + }, + interactionType: { + propDefinition: [ + bloomerang, + "interactionType", + ], + }, + campaignId: { + propDefinition: [ + bloomerang, + "campaignId", + ], + }, + }, + hooks: { + async deploy() { + const interactions = await this.getRecentInteractions(); + for (const interaction of interactions.slice(0, 50)) { + this.$emit(interaction, { + id: interaction.id, + summary: `New Interaction: ${interaction.type}`, + ts: Date.parse(interaction.date), + }); + } + }, + }, + methods: { + _getLastCheck() { + return this.db.get("lastCheck") || new Date(0).toISOString(); + }, + _setLastCheck(lastCheck) { + this.db.set("lastCheck", lastCheck); + }, + async getRecentInteractions() { + const lastCheck = this._getLastCheck(); + const params = { + filter: `createdDate>='${lastCheck}'`, + ...(this.interactionType + ? { + interactionType: this.interactionType, + } + : {}), + ...(this.campaignId + ? { + campaignId: this.campaignId, + } + : {}), + }; + + const interactions = await axios(this, { + url: `${this.bloomerang._baseUrl()}/interactions`, + headers: { + Authorization: `Bearer ${this.bloomerang.$auth.api_key}`, + }, + params, + }); + + const lastInteractionDate = interactions.length + ? interactions[0].createdDate + : new Date().toISOString(); + this._setLastCheck(lastInteractionDate); + + return interactions; + }, + }, + async run() { + const interactions = await this.getRecentInteractions(); + for (const interaction of interactions) { + this.$emit(interaction, { + id: interaction.id, + summary: `New Interaction: ${interaction.type}`, + ts: Date.parse(interaction.date), + }); + } + }, +}; From 9a2c399ab4b0af840b109f3fa061eea97df407a9 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 2 Apr 2025 11:42:02 -0300 Subject: [PATCH 2/7] [Components] bloomerang #16081 Sources - New Donation - New Constituent - New Interaction Actions - Create Donation - Create Constituent - Add Interaction --- .../add-interaction/add-interaction.mjs | 71 ++-- .../create-constituent/create-constituent.mjs | 179 ++++++-- .../create-donation/create-donation.mjs | 69 +-- components/bloomerang/bloomerang.app.mjs | 295 ++++++------- components/bloomerang/common/constants.mjs | 173 ++++++++ components/bloomerang/package.json | 5 +- components/bloomerang/sources/common/base.mjs | 63 +++ .../new-constituent/new-constituent.mjs | 77 +--- .../sources/new-constituent/test-event.mjs | 152 +++++++ .../sources/new-donation/new-donation.mjs | 97 +---- .../sources/new-donation/test-event.mjs | 402 ++++++++++++++++++ .../new-interaction/new-interaction.mjs | 94 +--- .../sources/new-interaction/test-event.mjs | 50 +++ 13 files changed, 1214 insertions(+), 513 deletions(-) create mode 100644 components/bloomerang/common/constants.mjs create mode 100644 components/bloomerang/sources/common/base.mjs create mode 100644 components/bloomerang/sources/new-constituent/test-event.mjs create mode 100644 components/bloomerang/sources/new-donation/test-event.mjs create mode 100644 components/bloomerang/sources/new-interaction/test-event.mjs diff --git a/components/bloomerang/actions/add-interaction/add-interaction.mjs b/components/bloomerang/actions/add-interaction/add-interaction.mjs index 27d1b400e60fe..b365426acbbd3 100644 --- a/components/bloomerang/actions/add-interaction/add-interaction.mjs +++ b/components/bloomerang/actions/add-interaction/add-interaction.mjs @@ -1,10 +1,12 @@ import bloomerang from "../../bloomerang.app.mjs"; -import { axios } from "@pipedream/platform"; +import { + CHANNEL_OPTIONS, PURPOSE_OPTIONS, +} from "../../common/constants.mjs"; export default { key: "bloomerang-add-interaction", name: "Add Interaction", - description: "Adds an interaction to an existing constituent in Bloomerang. [See the documentation](https://bloomerang.co/product/integrations-data-management/api/rest-api/)", + description: "Adds an interaction to an existing constituent in Bloomerang. [See the documentation](https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Interactions/post_interaction)", version: "0.0.1", type: "action", props: { @@ -15,43 +17,56 @@ export default { "constituentId", ], }, - interactionType: { - propDefinition: [ - bloomerang, - "interactionType", - ], + date: { + type: "string", + label: "Date", + description: "The date of the interaction", }, - interactionDate: { - propDefinition: [ - bloomerang, - "interactionDate", - ], + subject: { + type: "string", + label: "Subject", + description: "The subject od the interation", }, - notes: { - propDefinition: [ - bloomerang, - "notes", - ], + channel: { + type: "string", + label: "Channel", + description: "The channel of the interation", + options: CHANNEL_OPTIONS, + }, + purpose: { + type: "string", + label: "Purpose", + description: "The purpose of the interation", + options: PURPOSE_OPTIONS, + }, + note: { + type: "string", + label: "Note", + description: "Note for the interaction", optional: true, }, - campaignId: { - propDefinition: [ - bloomerang, - "campaignId", - ], + isInbound: { + type: "boolean", + label: "Is Inbound", + description: "Was the interaction initiated by constituent?", optional: true, }, }, async run({ $ }) { const response = await this.bloomerang.createInteraction({ - constituentId: this.constituentId, - interactionType: this.interactionType, - interactionDate: this.interactionDate, - notes: this.notes, - campaignId: this.campaignId, + $, + data: { + AccountId: this.constituentId, + Date: this.date, + Subject: this.subject, + Channel: this.channel, + Purpose: this.purpose, + note: this.note, + IsInbound: this.isInbound, + }, }); - $.export("$summary", `Successfully added interaction with ID ${response.id}`); + $.export("$summary", `Successfully added interaction with ID ${response.Id}`); return response; }, }; diff --git a/components/bloomerang/actions/create-constituent/create-constituent.mjs b/components/bloomerang/actions/create-constituent/create-constituent.mjs index 0b38085d8eb38..fbbc3374e567d 100644 --- a/components/bloomerang/actions/create-constituent/create-constituent.mjs +++ b/components/bloomerang/actions/create-constituent/create-constituent.mjs @@ -1,73 +1,162 @@ import bloomerang from "../../bloomerang.app.mjs"; -import { axios } from "@pipedream/platform"; +import { + COMMUNICATION_CHANNEL_OPTIONS, + CONSTITUENT_GENDER_OPTIONS, + CONSTITUENT_PREFIX_OPTIONS, + CONSTITUENT_STATUS_OPTIONS, + CONSTITUENT_SUFFIX_OPTIONS, + CONSTITUENT_TYPE_OPTIONS, +} from "../../common/constants.mjs"; export default { key: "bloomerang-create-constituent", name: "Create Constituent", - description: "Creates a new constituent in Bloomerang. [See the documentation](https://bloomerang.co/product/integrations-data-management/api/rest-api/)", - version: "0.0.{{ts}}", + description: "Creates a new constituent in Bloomerang. [See the documentation](https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Constituents/post_constituent)", + version: "0.0.1", type: "action", props: { bloomerang, - constituentType: { - propDefinition: [ - bloomerang, - "constituentType", - ], + type: { + type: "string", + label: "Constituent Type", + description: "Filter constituents by type", + options: CONSTITUENT_TYPE_OPTIONS, + reloadProps: true, + }, + status: { + type: "string", + label: "Status", + description: "The status of the constituent", + options: CONSTITUENT_STATUS_OPTIONS, + optional: true, + }, + fullName: { + type: "string", + label: "Organization Name", + description: "The organization's name of the constituent", + hidden: true, }, - name: { + firstName: { type: "string", - label: "Name", - description: "The name of the constituent", + label: "First Name", + description: "The first name of the constituent", + hidden: true, }, - contactDetails: { + lastName: { type: "string", - label: "Contact Details", - description: "Contact details of the constituent in JSON format", + label: "Last Name", + description: "The last name of the constituent", + hidden: true, }, - address: { + middleName: { type: "string", - label: "Address", - description: "Address of the constituent", + label: "Middle Name", + description: "The middle name of the constituent", optional: true, }, - tags: { - type: "string[]", - label: "Tags", - description: "Tags for the constituent", + prefix: { + type: "string", + label: "Title", + description: "The prefix of the constituent", + options: CONSTITUENT_PREFIX_OPTIONS, optional: true, }, - customFields: { - type: "string[]", - label: "Custom Fields", - description: "Custom fields for the constituent in JSON format", + suffix: { + type: "string", + label: "Suffix", + description: "The suffix of the constituent", + options: CONSTITUENT_SUFFIX_OPTIONS, + optional: true, + }, + jobTitle: { + type: "string", + label: "Job Title", + description: "The job title of the constituent", + optional: true, + }, + gender: { + type: "string", + label: "Gender", + description: "The gender of the constituent", + options: CONSTITUENT_GENDER_OPTIONS, + optional: true, + }, + birthdate: { + type: "string", + label: "Birthdate", + description: "The birth date of the constituent", + optional: true, + }, + employer: { + type: "string", + label: "Employer", + description: "The employer of the constituent", + optional: true, + }, + website: { + type: "string", + label: "Website", + description: "An website of the constituent", + optional: true, + }, + facebookId: { + type: "string", + label: "Facebook", + description: "The constituent's facebook page", + optional: true, + }, + twitterId: { + type: "string", + label: "Twitter ID", + description: "The constituent's twitter ID", + optional: true, + }, + linkedInId: { + type: "string", + label: "LinkedIn", + description: "The constituent's linkedIn page", + optional: true, + }, + preferredCommunicationChannel: { + type: "string", + label: "Preferred Communication Channel", + description: "The preferred comunication channel of the constituent", + options: COMMUNICATION_CHANNEL_OPTIONS, optional: true, }, }, + async additionalProps(props) { + const isIndividual = this.type === "Individual"; + props.firstName.hidden = !isIndividual; + props.lastName.hidden = !isIndividual; + props.fullName.hidden = isIndividual; + return {}; + }, async run({ $ }) { - const data = { - constituentType: this.constituentType, - name: this.name, - contactDetails: JSON.parse(this.contactDetails), - address: this.address - ? JSON.parse(this.address) - : undefined, - tags: this.tags, - customFields: this.customFields - ? this.customFields.map(JSON.parse) - : undefined, - }; - - const response = await axios($, { - method: "POST", - url: `${this.bloomerang._baseUrl()}/constituents`, - headers: { - Authorization: `Bearer ${this.bloomerang.$auth.api_key}`, + const response = await this.bloomerang.createConstituent({ + $, + data: { + Type: this.type, + Status: this.status, + FullName: this.fullName, + FirstName: this.firstName, + LastName: this.lastName, + MiddleName: this.middleName, + Prefix: this.prefix, + Suffix: this.suffix, + JobTitle: this.jobTitle, + Gender: this.gender, + Birthdate: this.birthdate, + Employer: this.employer, + Website: this.website, + FacebookId: this.facebookId, + TwitterId: this.twitterId, + LinkedInId: this.linkedInId, + PreferredCommunicationChannel: this.preferredCommunicationChannel, }, - data, }); - $.export("$summary", `Successfully created constituent with ID ${response.id}`); + $.export("$summary", `Successfully created constituent with ID ${response.Id}`); return response; }, }; diff --git a/components/bloomerang/actions/create-donation/create-donation.mjs b/components/bloomerang/actions/create-donation/create-donation.mjs index d030f6cac8f59..d88a6e124009d 100644 --- a/components/bloomerang/actions/create-donation/create-donation.mjs +++ b/components/bloomerang/actions/create-donation/create-donation.mjs @@ -1,11 +1,11 @@ import bloomerang from "../../bloomerang.app.mjs"; -import { axios } from "@pipedream/platform"; +import { PAYMENT_METHOD_OPTIONS } from "../../common/constants.mjs"; export default { key: "bloomerang-create-donation", name: "Create Donation", description: "Creates a new donation record in Bloomerang. [See the documentation](https://bloomerang.co/product/integrations-data-management/api/rest-api/)", - version: "0.0.{{ts}}", + version: "0.0.1", type: "action", props: { bloomerang, @@ -15,11 +15,15 @@ export default { "constituentId", ], }, + date: { + type: "string", + label: "Date", + description: "The date of the donation", + }, amount: { - propDefinition: [ - bloomerang, - "amount", - ], + type: "string", + label: "Amount", + description: "The amount for the donation", }, fundId: { propDefinition: [ @@ -27,46 +31,55 @@ export default { "fundId", ], }, - date: { - propDefinition: [ - bloomerang, - "date", - ], - }, paymentMethod: { + type: "string", + label: "Payment Method", + description: "The method of payment", + options: PAYMENT_METHOD_OPTIONS, + }, + campaignId: { propDefinition: [ bloomerang, - "paymentMethod", + "campaignId", ], optional: true, }, - note: { + appealId: { propDefinition: [ bloomerang, - "note", + "appealId", ], optional: true, }, - appeal: { - propDefinition: [ - bloomerang, - "appeal", - ], + note: { + type: "string", + label: "Note", + description: "A note for the donation", optional: true, }, }, async run({ $ }) { const response = await this.bloomerang.createDonation({ - constituentId: this.constituentId, - amount: this.amount, - fundId: this.fundId, - date: this.date, - paymentMethod: this.paymentMethod, - note: this.note, - appeal: this.appeal, + $, + data: { + AccountId: this.constituentId, + Date: this.date, + Amount: this.amount, + Method: this.paymentMethod, + Designations: [ + { + FundId: this.fundId, + Amount: this.amount, + Type: "Donation", + CampaignId: this.campaignId, + AppealId: this.appealId, + Note: this.note, + }, + ], + }, }); - $.export("$summary", `Successfully created donation with ID: ${response.id}`); + $.export("$summary", `Successfully created donation with ID: ${response.Id}`); return response; }, }; diff --git a/components/bloomerang/bloomerang.app.mjs b/components/bloomerang/bloomerang.app.mjs index 5de610ef53afb..03058b9f0693e 100644 --- a/components/bloomerang/bloomerang.app.mjs +++ b/components/bloomerang/bloomerang.app.mjs @@ -1,21 +1,26 @@ import { axios } from "@pipedream/platform"; +import { LIMIT } from "./common/constants.mjs"; export default { type: "app", app: "bloomerang", propDefinitions: { - donationType: { + constituentId: { type: "string", - label: "Donation Type", - description: "Filter donations by type", - optional: true, - async options() { - const response = await this._makeRequest({ - path: "/donation-types", + label: "Constituent ID", + description: "The ID of the constituent", + async options({ page }) { + const { Results: response } = await this.listConstituents({ + params: { + skip: LIMIT * page, + take: LIMIT, + }, }); - return response.map((type) => ({ - label: type.name, - value: type.id, + return response.map(({ + Id: value, FullName: label, + }) => ({ + label, + value, })); }, }, @@ -23,44 +28,18 @@ export default { type: "string", label: "Fund", description: "Filter donations by fund", - optional: true, - async options() { - const response = await this._makeRequest({ - path: "/funds", - }); - return response.map((fund) => ({ - label: fund.name, - value: fund.id, - })); - }, - }, - constituentType: { - type: "string", - label: "Constituent Type", - description: "Filter constituents by type", - optional: true, - async options() { - const response = await this._makeRequest({ - path: "/constituent-types", + async options({ page }) { + const { Results: response } = await this.listFunds({ + params: { + skip: LIMIT * page, + take: LIMIT, + }, }); - return response.map((type) => ({ - label: type.name, - value: type.id, - })); - }, - }, - interactionType: { - type: "string", - label: "Interaction Type", - description: "Filter interactions by type", - optional: true, - async options() { - const response = await this._makeRequest({ - path: "/interaction-types", - }); - return response.map((type) => ({ - label: type.name, - value: type.id, + return response.map(({ + Id: value, Name: label, + }) => ({ + label, + value, })); }, }, @@ -68,179 +47,143 @@ export default { type: "string", label: "Campaign", description: "Filter interactions by campaign", - optional: true, - async options() { - const response = await this._makeRequest({ - path: "/campaigns", + async options({ page }) { + const { Results: response } = await this.listCampaigns({ + params: { + skip: LIMIT * page, + take: LIMIT, + }, }); - return response.map((campaign) => ({ - label: campaign.name, - value: campaign.id, + return response.map(({ + Id: value, Name: label, + }) => ({ + label, + value, })); }, }, - constituentId: { - type: "string", - label: "Constituent ID", - description: "The ID of the constituent", - }, - amount: { - type: "string", - label: "Amount", - description: "The amount for the donation", - }, - date: { - type: "string", - label: "Date", - description: "The date of the donation", - }, - paymentMethod: { - type: "string", - label: "Payment Method", - description: "The method of payment", - optional: true, - }, - note: { - type: "string", - label: "Note", - description: "A note for the donation", - optional: true, - }, - appeal: { + appealId: { type: "string", label: "Appeal", description: "An appeal for the donation", - optional: true, - }, - name: { - type: "string", - label: "Name", - description: "The name of the constituent", - }, - contactDetails: { - type: "string", - label: "Contact Details", - description: "Contact details of the constituent", - }, - address: { - type: "string", - label: "Address", - description: "Address of the constituent", - optional: true, - }, - tags: { - type: "string[]", - label: "Tags", - description: "Tags for the constituent", - optional: true, - }, - customFields: { - type: "string[]", - label: "Custom Fields", - description: "Custom fields for the constituent", - optional: true, - }, - interactionDate: { - type: "string", - label: "Interaction Date", - description: "The date of the interaction", - }, - notes: { - type: "string", - label: "Notes", - description: "Notes for the interaction", - optional: true, + async options({ page }) { + const { Results: response } = await this.listAppeals({ + params: { + skip: LIMIT * page, + take: LIMIT, + }, + }); + return response.map(({ + Id: value, Name: label, + }) => ({ + label, + value, + })); + }, }, }, methods: { _baseUrl() { return "https://api.bloomerang.co/v2"; }, - async _makeRequest(opts = {}) { - const { - $ = this, method = "GET", path = "/", headers, ...otherOpts - } = opts; + _headers() { + return { + "accept": "application/json", + "x-api-key": `${this.$auth.api_key}`, + }; + }, + _makeRequest({ + $ = this, path, ...opts + }) { return axios($, { - ...otherOpts, - method, url: this._baseUrl() + path, - headers: { - ...headers, - Authorization: `Bearer ${this.$auth.api_key}`, - }, + headers: this._headers(), + ...opts, }); }, - async listDonationTypes() { + listConstituents(opts = {}) { return this._makeRequest({ - path: "/donation-types", + path: "/constituents", + ...opts, }); }, - async listFunds() { + listInteractions(opts = {}) { return this._makeRequest({ - path: "/funds", + path: "/interactions", + ...opts, }); }, - async listConstituentTypes() { + listTransactions(opts = {}) { return this._makeRequest({ - path: "/constituent-types", + path: "/transactions", + ...opts, }); }, - async listInteractionTypes() { + listFunds(opts = {}) { return this._makeRequest({ - path: "/interaction-types", + path: "/funds", + ...opts, }); }, - async listCampaigns() { + listCampaigns(opts = {}) { return this._makeRequest({ path: "/campaigns", + ...opts, }); }, - async createDonation({ - constituentId, amount, fundId, date, paymentMethod, note, appeal, - }) { + listAppeals(opts = {}) { + return this._makeRequest({ + path: "/appeals", + ...opts, + }); + }, + createDonation(opts = {}) { return this._makeRequest({ method: "POST", - path: "/donations", - data: { - constituentId, - amount, - fundId, - date, - paymentMethod, - note, - appeal, - }, + path: "/transaction", + ...opts, }); }, - async createConstituent({ - constituentType, name, contactDetails, address, tags, customFields, - }) { + createConstituent(opts = {}) { return this._makeRequest({ method: "POST", - path: "/constituents", - data: { - constituentType, - name, - contactDetails, - address, - tags, - customFields, - }, + path: "/constituent", + ...opts, }); }, - async createInteraction({ - constituentId, interactionType, interactionDate, notes, campaignId, - }) { + createInteraction(opts = {}) { return this._makeRequest({ method: "POST", - path: `/constituents/${constituentId}/interactions`, - data: { - interactionType, - interactionDate, - notes, - campaignId, - }, + path: "/interaction", + ...opts, }); }, + async *paginate({ + fn, params = {}, maxResults = null, ...opts + }) { + let hasMore = false; + let count = 0; + let page = 0; + + do { + params.skip = LIMIT * page; + params.take = LIMIT; + page++; + const { Results: data } = await fn({ + params, + ...opts, + }); + for (const d of data) { + yield d; + + if (maxResults && ++count === maxResults) { + return count; + } + } + + hasMore = data.length; + + } while (hasMore); + }, }, }; diff --git a/components/bloomerang/common/constants.mjs b/components/bloomerang/common/constants.mjs new file mode 100644 index 0000000000000..41e585712942c --- /dev/null +++ b/components/bloomerang/common/constants.mjs @@ -0,0 +1,173 @@ +export const LIMIT = 50; + +export const CHANNEL_OPTIONS = [ + { + label: "Email", + value: "Email", + }, + { + label: "In Person", + value: "InPerson", + }, + { + label: "Mail", + value: "Mail", + }, + { + label: "Mass Email", + value: "MassEmail", + }, + { + label: "Other", + value: "Other", + }, + { + label: "Phone", + value: "Phone", + }, + { + label: "Social Media", + value: "SocialMedia", + }, + { + label: "Text Message", + value: "TextMessage", + }, + { + label: "Video Call", + value: "VideoCall", + }, + { + label: "Webinar", + value: "Webinar", + }, + { + label: "Website", + value: "Website", + }, +]; + +export const PURPOSE_OPTIONS = [ + { + label: "Acknowledgement", + value: "Acknowledgement", + }, + { + label: "Impact/Cultivation", + value: "ImpactCultivation", + }, + { + label: "Newsletter", + value: "Newsletter", + }, + { + label: "Receipt", + value: "Receipt", + }, + { + label: "Solicitation", + value: "Solicitation", + }, + { + label: "Special Event", + value: "SpecialEvent", + }, + { + label: "Volunteer Activity", + value: "VolunteerActivity", + }, + { + label: "Pledge Reminder", + value: "PledgeReminder", + }, + { + label: "Welcome", + value: "Welcome", + }, + { + label: "Other", + value: "Other", + }, +]; + +export const CONSTITUENT_TYPE_OPTIONS = [ + "Individual", + "Organization", +]; + +export const CONSTITUENT_STATUS_OPTIONS = [ + "Active", + "Inactive", + "Deceased", +]; + +export const CONSTITUENT_PREFIX_OPTIONS = [ + "Atty.", + "Capt", + "Cmdr", + "Coach", + "Col", + "Dr.", + "Fr.", + "Gen", + "Gov.", + "Hon.", + "Lt", + "Maj", + "Master", + "Miss", + "Mr.", + "Mrs.", + "Ms.", + "Mx.", + "Pastor", + "Pres.", + "Prof.", + "Pvt", + "Rabbi", + "Rep.", + "Rev.", + "Sen.", + "Sgt", + "Sir", + "Sr.", +]; + +export const CONSTITUENT_SUFFIX_OPTIONS = [ + "DDS", + "Esq.", + "II", + "III", + "IV", + "Jr.", + "M.D.", + "Ph.D.", + "Sr.", + "V", +]; + +export const CONSTITUENT_GENDER_OPTIONS = [ + "Male", + "Female", + "Other", +]; + +export const COMMUNICATION_CHANNEL_OPTIONS = [ + "Email", + "Phone", + "Text Message", + "Mail", +]; + +export const PAYMENT_METHOD_OPTIONS = [ + "None", + "Cash", + "Check", + "CreditCard", + "Eft", + "InKind", + "ApplePay", + "GooglePay", + "PayPal", + "Venmo", +]; diff --git a/components/bloomerang/package.json b/components/bloomerang/package.json index c4c9da61a2551..01ce3fe505ab9 100644 --- a/components/bloomerang/package.json +++ b/components/bloomerang/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/bloomerang", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream Bloomerang Components", "main": "bloomerang.app.mjs", "keywords": [ @@ -11,5 +11,8 @@ "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.0.3" } } diff --git a/components/bloomerang/sources/common/base.mjs b/components/bloomerang/sources/common/base.mjs new file mode 100644 index 0000000000000..37aedeca8305b --- /dev/null +++ b/components/bloomerang/sources/common/base.mjs @@ -0,0 +1,63 @@ +import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform"; +import app from "../../bloomerang.app.mjs"; + +export default { + props: { + app, + db: "$.service.db", + timer: { + type: "$.interface.timer", + default: { + intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL, + }, + }, + }, + methods: { + _getLastId() { + return this.db.get("lastId") || 0; + }, + _setLastId(lastId) { + this.db.set("lastId", lastId); + }, + async emitEvent(maxResults = false) { + const lastId = this._getLastId(); + + const response = this.app.paginate({ + fn: this.getFunction(), + params: { + orderBy: "CreatedDate", + orderDirection: "Desc", + }, + }); + + let responseArray = []; + for await (const item of response) { + if (item.Id <= lastId) break; + responseArray.push(item); + } + + if (responseArray.length) { + if (maxResults && (responseArray.length > maxResults)) { + responseArray.length = maxResults; + } + this._setLastId(responseArray[0].Id); + } + + for (const item of responseArray.reverse()) { + this.$emit(item, { + id: item.Id, + summary: this.getSummary(item), + ts: Date.parse(item.AuditTrail.CreatedDate || new Date()), + }); + } + }, + }, + hooks: { + async deploy() { + await this.emitEvent(25); + }, + }, + async run() { + await this.emitEvent(); + }, +}; diff --git a/components/bloomerang/sources/new-constituent/new-constituent.mjs b/components/bloomerang/sources/new-constituent/new-constituent.mjs index 6096c2e9a86e4..871b14a1e6fba 100644 --- a/components/bloomerang/sources/new-constituent/new-constituent.mjs +++ b/components/bloomerang/sources/new-constituent/new-constituent.mjs @@ -1,77 +1,22 @@ -import { axios } from "@pipedream/platform"; -import bloomerang from "../../bloomerang.app.mjs"; +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; export default { + ...common, key: "bloomerang-new-constituent", name: "New Constituent Created", - description: "Emit new event when a new constituent profile is created in Bloomerang. [See the documentation](https://bloomerang.co/product/integrations-data-management/api/rest-api/)", - version: "0.0.{{ts}}", + description: "Emit new event when a new constituent profile is created in Bloomerang.", + version: "0.0.1", type: "source", dedupe: "unique", - props: { - bloomerang, - db: "$.service.db", - timer: { - type: "$.interface.timer", - default: { - intervalSeconds: 900, // Every 15 minutes - }, - }, - constituentType: { - propDefinition: [ - bloomerang, - "constituentType", - ], - }, - }, methods: { - _getLastTimestamp() { - return this.db.get("lastTimestamp") || new Date(0).toISOString(); + ...common.methods, + getFunction() { + return this.app.listConstituents; }, - _setLastTimestamp(timestamp) { - this.db.set("lastTimestamp", timestamp); + getSummary(item) { + return `New Constituent: ${item.FullName}`; }, - async _getConstituents(afterTimestamp) { - const params = { - dateCreatedOnOrAfter: afterTimestamp, - }; - if (this.constituentType) { - params.constituentType = this.constituentType; - } - - return this.bloomerang._makeRequest({ - path: "/constituents", - params, - }); - }, - }, - hooks: { - async deploy() { - const constituents = await this._getConstituents(new Date().toISOString()); - constituents.slice(-50).reverse() - .forEach(this.emitConstituent); - }, - }, - async run() { - const lastTimestamp = this._getLastTimestamp(); - const constituents = await this._getConstituents(lastTimestamp); - - for (const constituent of constituents) { - this.emitConstituent(constituent); - } - - if (constituents.length > 0) { - const newLastTimestamp = new Date( - Math.max(...constituents.map((c) => new Date(c.dateCreatedOn))), - ).toISOString(); - this._setLastTimestamp(newLastTimestamp); - } - }, - emitConstituent(constituent) { - this.$emit(constituent, { - id: constituent.id.toString(), - summary: `New Constituent: ${constituent.name}`, - ts: new Date(constituent.dateCreatedOn).getTime(), - }); }, + sampleEmit, }; diff --git a/components/bloomerang/sources/new-constituent/test-event.mjs b/components/bloomerang/sources/new-constituent/test-event.mjs new file mode 100644 index 0000000000000..5ea43cc4c3bc2 --- /dev/null +++ b/components/bloomerang/sources/new-constituent/test-event.mjs @@ -0,0 +1,152 @@ +export default { + "Id": 0, + "AccountNumber": 0, + "IsInHousehold": true, + "IsHeadOfHousehold": true, + "IsFavorite": true, + "FullCustomProfileImageId": 0, + "FullCustomProfileImageUrl": "string", + "CroppedCustomProfileImageId": 0, + "CroppedCustomProfileImageUrl": "string", + "Type": "Individual", + "Status": "Active", + "FirstName": "string", + "LastName": "string", + "MiddleName": "string", + "Prefix": "string", + "Suffix": "string", + "FullName": "string", + "InformalName": "string", + "FormalName": "string", + "EnvelopeName": "string", + "RecognitionName": "string", + "JobTitle": "string", + "Employer": "string", + "Website": "string", + "FacebookId": "string", + "TwitterId": "string", + "LinkedInId": "string", + "Gender": "Male", + "Birthdate": "2025-04-02", + "ProfilePictureType": "None", + "PrimaryPhone": { + "Id": 0, + "AccountId": 0, + "Type": "Home", + "Extension": "string", + "Number": "string", + "IsPrimary": true + }, + "HouseholdId": 0, + "PreferredCommunicationChannel": "Email", + "CommunicationRestrictions": [ + "DoNotCall" + ], + "CommunicationRestrictionsUpdateReason": "string", + "EmailInterestType": "All", + "CustomEmailInterests": [ + { + "Id": 0, + "Name": "string" + } + ], + "EmailInterestsUpdateReason": "string", + "PrimaryAddress": { + "Id": 0, + "AccountId": 0, + "Type": "Home", + "Street": "string", + "City": "string", + "State": "string", + "PostalCode": "string", + "Country": "string", + "IsPrimary": true, + "IsBad": true, + "AuditTrail": { + "CreatedDate": "2025-04-02T14:26:18.373Z", + "CreatedName": "string", + "LastModifiedDate": "2025-04-02T14:26:18.373Z", + "LastModifiedName": "string" + }, + "StateAbbreviation": "string", + "CountryCode": "string" + }, + "PrimaryEmail": { + "Id": 0, + "AccountId": 0, + "Type": "Home", + "Value": "user@example.com", + "IsPrimary": true, + "IsBad": true, + "AuditTrail": { + "CreatedDate": "2025-04-02T14:26:18.373Z", + "CreatedName": "string", + "LastModifiedDate": "2025-04-02T14:26:18.373Z", + "LastModifiedName": "string" + } + }, + "EngagementScore": "Low", + "DonorSearchInfo": { + "Id": 0, + "GenerosityScore": "Low", + "AnnualFundLikelihood": "Low", + "MajorGiftLikelihood": "Low", + "Quality": "Low", + "LargestGiftMin": 0, + "LargestGiftMax": 0, + "WealthAskMin": 0, + "WealthAskMax": 0, + "BusinessExecutive": true, + "NamesScreened": "string", + "DateTimeScreenedUtc": "string" + }, + "AddressIds": [ + 0 + ], + "EmailIds": [ + 0 + ], + "PhoneIds": [ + 0 + ], + "CustomValues": [ + { + "FieldId": 0, + "Value": { + "Id": 0, + "Value": "string" + } + }, + { + "FieldId": 0, + "Values": [ + { + "Id": 0, + "Value": "string" + } + ] + } + ], + "GroupsDetails": [ + { + "Id": 0, + "Name": "string", + "Description": "string" + } + ], + "AuditTrail": { + "CreatedDate": "2025-04-02T14:26:18.373Z", + "CreatedName": "string", + "LastModifiedDate": "2025-04-02T14:26:18.373Z", + "LastModifiedName": "string" + }, + "Membership": [ + { + "MembershipScheduleId": 0, + "MembershipProgramName": "string", + "MembershipLevelName": "string", + "MembershipStatus": "string", + "MembershipRenewalDate": "string" + } + ] +} \ No newline at end of file diff --git a/components/bloomerang/sources/new-donation/new-donation.mjs b/components/bloomerang/sources/new-donation/new-donation.mjs index e290293196df7..eb10cfb0d6543 100644 --- a/components/bloomerang/sources/new-donation/new-donation.mjs +++ b/components/bloomerang/sources/new-donation/new-donation.mjs @@ -1,97 +1,22 @@ -import bloomerang from "../../bloomerang.app.mjs"; -import { axios } from "@pipedream/platform"; +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; export default { + ...common, key: "bloomerang-new-donation", name: "New Donation", - description: "Emit a new event when a donation is received in Bloomerang. [See the documentation](https://bloomerang.co/product/integrations-data-management/api/rest-api/)", - version: "0.0.{{ts}}", + description: "Emit new event when a donation is received in Bloomerang.", + version: "0.0.1", type: "source", dedupe: "unique", - props: { - bloomerang, - db: "$.service.db", - timer: { - type: "$.interface.timer", - default: { - intervalSeconds: 900, - }, - }, - donationType: { - propDefinition: [ - bloomerang, - "donationType", - ], - }, - fundId: { - propDefinition: [ - bloomerang, - "fundId", - ], - }, - }, methods: { - _getLastDonationTimestamp() { - return this.db.get("lastDonationTimestamp") || 0; + ...common.methods, + getFunction() { + return this.app.listTransactions; }, - _setLastDonationTimestamp(ts) { - this.db.set("lastDonationTimestamp", ts); - }, - async _getDonations() { - const params = { - donationType: this.donationType, - fundId: this.fundId, - since: this._getLastDonationTimestamp(), - }; - return this.bloomerang._makeRequest({ - path: "/donations", - params, - }); - }, - }, - hooks: { - async deploy() { - const donations = await this._getDonations(); - const emitDonations = donations.slice(-50).reverse(); // Emit at most 50 latest donations - - for (const donation of emitDonations) { - this.$emit(donation, { - id: donation.id, - summary: `New Donation from ${donation.constituentId}`, - ts: new Date(donation.date).getTime(), - }); - } - - if (donations.length > 0) { - const latestTimestamp = new Date(donations[0].date).getTime(); - this._setLastDonationTimestamp(latestTimestamp); - } + getSummary(item) { + return `New Donation from ${item.AccountId}`; }, }, - async run() { - const lastTimestamp = this._getLastDonationTimestamp(); - - const params = { - donationType: this.donationType, - fundId: this.fundId, - }; - - const donations = await this._getDonations(params); - - for (const donation of donations) { - const donationTimestamp = new Date(donation.date).getTime(); - if (donationTimestamp > lastTimestamp) { - this.$emit(donation, { - id: donation.id, - summary: `New Donation: ${donation.amount}`, - ts: donationTimestamp, - }); - } - } - - if (donations.length > 0) { - const latestTimestamp = new Date(donations[0].date).getTime(); - this._setLastDonationTimestamp(latestTimestamp); - } - }, + sampleEmit, }; diff --git a/components/bloomerang/sources/new-donation/test-event.mjs b/components/bloomerang/sources/new-donation/test-event.mjs new file mode 100644 index 0000000000000..bca587c5544ca --- /dev/null +++ b/components/bloomerang/sources/new-donation/test-event.mjs @@ -0,0 +1,402 @@ +export default { + "Id": 0, + "TransactionNumber": 0, + "NonDeductibleAmount": 0, + "AccountId": 0, + "Date": "2025-04-02", + "Amount": 0, + "Method": "None", + "EntryMethod": "Tap", + "MethodOrigin": "Forms", + "CheckNumber": "string", + "CheckDate": "2025-04-02", + "CreditCardType": "Visa", + "CreditCardLastFourDigits": "string", + "CreditCardExpMonth": 0, + "CreditCardExpYear": 0, + "EftAccountType": "Checking", + "EftLastFourDigits": "string", + "EftRoutingNumber": "string", + "InKindDescription": "string", + "InKindType": "Goods", + "InKindMarketValue": 0, + "IntegrationUrl": "string", + "Designations": [ + { + "Id": 0, + "DesignationNumber": 0, + "TransactionId": 0, + "Amount": 0, + "NonDeductibleAmount": 0, + "Note": "string", + "AcknowledgementStatus": "Yes", + "AcknowledgementInteractionIds": [ + 0 + ], + "Fund": { + "Id": 0, + "Name": "string" + }, + "QuickbooksAccount": { + "Id": 0, + "Name": "string" + }, + "Campaign": { + "Id": 0, + "Name": "string" + }, + "Appeal": { + "Id": 0, + "Name": "string" + }, + "Tribute": { + "Id": 0, + "Name": "string" + }, + "TributeType": "InHonorOf", + "SoftCreditIds": [ + 0 + ], + "AttachmentIds": [ + 0 + ], + "CustomValues": [ + { + "FieldId": 0, + "Value": { + "Id": 0, + "Value": "string" + } + }, + { + "FieldId": 0, + "Values": [ + { + "Id": 0, + "Value": "string" + } + ] + } + ], + "QuickBooksOnlineStatus": "string", + "AuditTrail": { + "CreatedDate": "2025-04-02T14:25:37.376Z", + "CreatedName": "string", + "LastModifiedDate": "2025-04-02T14:25:37.376Z", + "LastModifiedName": "string" + }, + "Type": "Donation" + }, + { + "Id": 0, + "DesignationNumber": 0, + "TransactionId": 0, + "Amount": 0, + "NonDeductibleAmount": 0, + "Note": "string", + "AcknowledgementStatus": "Yes", + "AcknowledgementInteractionIds": [ + 0 + ], + "Fund": { + "Id": 0, + "Name": "string" + }, + "QuickbooksAccount": { + "Id": 0, + "Name": "string" + }, + "Campaign": { + "Id": 0, + "Name": "string" + }, + "Appeal": { + "Id": 0, + "Name": "string" + }, + "Tribute": { + "Id": 0, + "Name": "string" + }, + "TributeType": "InHonorOf", + "SoftCreditIds": [ + 0 + ], + "AttachmentIds": [ + 0 + ], + "CustomValues": [ + { + "FieldId": 0, + "Value": { + "Id": 0, + "Value": "string" + } + }, + { + "FieldId": 0, + "Values": [ + { + "Id": 0, + "Value": "string" + } + ] + } + ], + "QuickBooksOnlineStatus": "string", + "AuditTrail": { + "CreatedDate": "2025-04-02T14:25:37.376Z", + "CreatedName": "string", + "LastModifiedDate": "2025-04-02T14:25:37.376Z", + "LastModifiedName": "string" + }, + "Type": "Pledge", + "PledgePaymentIds": [ + 0 + ], + "PledgeInstallments": [ + { + "Id": 0, + "PledgeId": 0, + "Date": "2025-04-02", + "Amount": 0 + } + ], + "PledgeBalance": 0, + "LastPaymentStatus": "AtRisk", + "PledgeStatus": "InGoodStanding", + "PledgeWriteOffs": [ + { + "Id": 0, + "PledgeId": 0, + "Date": "2025-04-02", + "Amount": 0 + } + ], + "PledgeAmountInArrears": 0, + "PledgeNextInstallmentDate": "2025-04-02", + "PledgeFrequencyIsEditable": true + }, + { + "Id": 0, + "DesignationNumber": 0, + "TransactionId": 0, + "Amount": 0, + "NonDeductibleAmount": 0, + "Note": "string", + "AcknowledgementStatus": "Yes", + "AcknowledgementInteractionIds": [ + 0 + ], + "Fund": { + "Id": 0, + "Name": "string" + }, + "QuickbooksAccount": { + "Id": 0, + "Name": "string" + }, + "Campaign": { + "Id": 0, + "Name": "string" + }, + "Appeal": { + "Id": 0, + "Name": "string" + }, + "Tribute": { + "Id": 0, + "Name": "string" + }, + "TributeType": "InHonorOf", + "SoftCreditIds": [ + 0 + ], + "AttachmentIds": [ + 0 + ], + "CustomValues": [ + { + "FieldId": 0, + "Value": { + "Id": 0, + "Value": "string" + } + }, + { + "FieldId": 0, + "Values": [ + { + "Id": 0, + "Value": "string" + } + ] + } + ], + "QuickBooksOnlineStatus": "string", + "AuditTrail": { + "CreatedDate": "2025-04-02T14:25:37.376Z", + "CreatedName": "string", + "LastModifiedDate": "2025-04-02T14:25:37.376Z", + "LastModifiedName": "string" + }, + "Type": "PledgePayment", + "PledgeId": 0 + }, + { + "Id": 0, + "DesignationNumber": 0, + "TransactionId": 0, + "Amount": 0, + "NonDeductibleAmount": 0, + "Note": "string", + "AcknowledgementStatus": "Yes", + "AcknowledgementInteractionIds": [ + 0 + ], + "Fund": { + "Id": 0, + "Name": "string" + }, + "QuickbooksAccount": { + "Id": 0, + "Name": "string" + }, + "Campaign": { + "Id": 0, + "Name": "string" + }, + "Appeal": { + "Id": 0, + "Name": "string" + }, + "Tribute": { + "Id": 0, + "Name": "string" + }, + "TributeType": "InHonorOf", + "SoftCreditIds": [ + 0 + ], + "AttachmentIds": [ + 0 + ], + "CustomValues": [ + { + "FieldId": 0, + "Value": { + "Id": 0, + "Value": "string" + } + }, + { + "FieldId": 0, + "Values": [ + { + "Id": 0, + "Value": "string" + } + ] + } + ], + "QuickBooksOnlineStatus": "string", + "AuditTrail": { + "CreatedDate": "2025-04-02T14:25:37.377Z", + "CreatedName": "string", + "LastModifiedDate": "2025-04-02T14:25:37.377Z", + "LastModifiedName": "string" + }, + "RecurringDonationEndDate": "2025-04-02", + "RecurringDonationFrequency": "Weekly", + "RecurringDonationDay1": 0, + "RecurringDonationDay2": 0, + "RecurringDonationStartDate": "2025-04-02", + "Type": "RecurringDonation", + "RecurringDonationPaymentIds": [ + 0 + ], + "RecurringDonationNextInstallmentDate": "2025-04-02", + "RecurringDonationLastPaymentStatus": "AtRisk", + "RecurringDonationStatus": "Active" + }, + { + "Id": 0, + "DesignationNumber": 0, + "TransactionId": 0, + "Amount": 0, + "NonDeductibleAmount": 0, + "Note": "string", + "AcknowledgementStatus": "Yes", + "AcknowledgementInteractionIds": [ + 0 + ], + "Fund": { + "Id": 0, + "Name": "string" + }, + "QuickbooksAccount": { + "Id": 0, + "Name": "string" + }, + "Campaign": { + "Id": 0, + "Name": "string" + }, + "Appeal": { + "Id": 0, + "Name": "string" + }, + "Tribute": { + "Id": 0, + "Name": "string" + }, + "TributeType": "InHonorOf", + "SoftCreditIds": [ + 0 + ], + "AttachmentIds": [ + 0 + ], + "CustomValues": [ + { + "FieldId": 0, + "Value": { + "Id": 0, + "Value": "string" + } + }, + { + "FieldId": 0, + "Values": [ + { + "Id": 0, + "Value": "string" + } + ] + } + ], + "QuickBooksOnlineStatus": "string", + "AuditTrail": { + "CreatedDate": "2025-04-02T14:25:37.377Z", + "CreatedName": "string", + "LastModifiedDate": "2025-04-02T14:25:37.377Z", + "LastModifiedName": "string" + }, + "Type": "RecurringDonationPayment", + "RecurringDonationId": 0 + } + ], + "AttachmentIds": [ + 0 + ], + "IsRefunded": "Yes", + "RefundIds": [ + 0 + ], + "AuditTrail": { + "CreatedDate": "2025-04-02T14:25:37.377Z", + "CreatedName": "string", + "LastModifiedDate": "2025-04-02T14:25:37.377Z", + "LastModifiedName": "string" + } +} \ No newline at end of file diff --git a/components/bloomerang/sources/new-interaction/new-interaction.mjs b/components/bloomerang/sources/new-interaction/new-interaction.mjs index 37f7807cf9452..e6b723d9baa9b 100644 --- a/components/bloomerang/sources/new-interaction/new-interaction.mjs +++ b/components/bloomerang/sources/new-interaction/new-interaction.mjs @@ -1,94 +1,22 @@ -import { axios } from "@pipedream/platform"; -import bloomerang from "../../bloomerang.app.mjs"; +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; export default { + ...common, key: "bloomerang-new-interaction", name: "New Interaction", - description: "Emit new event when a new interaction is logged for a constituent. [See the documentation](https://bloomerang.co/product/integrations-data-management/api/)", - version: "0.0.{{ts}}", + description: "Emit new event when a new interaction is logged for a constituent.", + version: "0.0.1", type: "source", dedupe: "unique", - props: { - bloomerang, - db: "$.service.db", - timer: { - type: "$.interface.timer", - default: { - intervalSeconds: 900, // Every 15 minutes - }, - }, - interactionType: { - propDefinition: [ - bloomerang, - "interactionType", - ], - }, - campaignId: { - propDefinition: [ - bloomerang, - "campaignId", - ], - }, - }, - hooks: { - async deploy() { - const interactions = await this.getRecentInteractions(); - for (const interaction of interactions.slice(0, 50)) { - this.$emit(interaction, { - id: interaction.id, - summary: `New Interaction: ${interaction.type}`, - ts: Date.parse(interaction.date), - }); - } - }, - }, methods: { - _getLastCheck() { - return this.db.get("lastCheck") || new Date(0).toISOString(); + ...common.methods, + getFunction() { + return this.app.listInteractions; }, - _setLastCheck(lastCheck) { - this.db.set("lastCheck", lastCheck); + getSummary(item) { + return `New Interaction: ${item.Channel}`; }, - async getRecentInteractions() { - const lastCheck = this._getLastCheck(); - const params = { - filter: `createdDate>='${lastCheck}'`, - ...(this.interactionType - ? { - interactionType: this.interactionType, - } - : {}), - ...(this.campaignId - ? { - campaignId: this.campaignId, - } - : {}), - }; - - const interactions = await axios(this, { - url: `${this.bloomerang._baseUrl()}/interactions`, - headers: { - Authorization: `Bearer ${this.bloomerang.$auth.api_key}`, - }, - params, - }); - - const lastInteractionDate = interactions.length - ? interactions[0].createdDate - : new Date().toISOString(); - this._setLastCheck(lastInteractionDate); - - return interactions; - }, - }, - async run() { - const interactions = await this.getRecentInteractions(); - for (const interaction of interactions) { - this.$emit(interaction, { - id: interaction.id, - summary: `New Interaction: ${interaction.type}`, - ts: Date.parse(interaction.date), - }); - } }, + sampleEmit, }; diff --git a/components/bloomerang/sources/new-interaction/test-event.mjs b/components/bloomerang/sources/new-interaction/test-event.mjs new file mode 100644 index 0000000000000..febf3a4910495 --- /dev/null +++ b/components/bloomerang/sources/new-interaction/test-event.mjs @@ -0,0 +1,50 @@ +export default { + "Id": 0, + "Date": "2025-04-02", + "Note": "string", + "Channel": "Email", + "Purpose": "Acknowledgement", + "Subject": "string", + "IsInbound": true, + "AccountId": 0, + "TweetId": "string", + "IsBcc": true, + "EmailAddress": "user@example.com", + "AttachmentIds": [ + 0 + ], + "LetterAttachmentIds": [ + 0 + ], + "SurveyLapsedResponses": [ + "string" + ], + "IsEngagementSurveyResponse": true, + "SurveyEmailInteractionId": 0, + "IsEngagementSurveyEmail": true, + "SurveyResponseInteractionId": 0, + "CustomValues": [ + { + "FieldId": 0, + "Value": { + "Id": 0, + "Value": "string" + } + }, + { + "FieldId": 0, + "Values": [ + { + "Id": 0, + "Value": "string" + } + ] + } + ], + "AuditTrail": { + "CreatedDate": "2025-04-02T14:22:12.409Z", + "CreatedName": "string", + "LastModifiedDate": "2025-04-02T14:22:12.409Z", + "LastModifiedName": "string" + } +} \ No newline at end of file From cb74c02f236890eb591bccceb1c61927b4770fe0 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 2 Apr 2025 12:03:03 -0300 Subject: [PATCH 3/7] pnpm update --- pnpm-lock.yaml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 07b02f5916222..7c944951f9441 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -883,8 +883,7 @@ importers: specifier: ^1.1.1 version: 1.6.6 - components/apiverve: - specifiers: {} + components/apiverve: {} components/apollo_io: dependencies: @@ -1587,7 +1586,11 @@ importers: specifier: ^1.5.1 version: 1.6.6 - components/bloomerang: {} + components/bloomerang: + dependencies: + '@pipedream/platform': + specifier: ^3.0.3 + version: 3.0.3 components/blue: {} @@ -7466,8 +7469,7 @@ importers: specifier: ^1.6.0 version: 1.6.6 - components/lucca: - specifiers: {} + components/lucca: {} components/lucid: dependencies: @@ -9289,8 +9291,7 @@ importers: specifier: ^2.0.0 version: 2.0.0 - components/pdf4me: - specifiers: {} + components/pdf4me: {} components/pdf_api_io: {} @@ -10059,8 +10060,7 @@ importers: components/proprofs_quiz_maker: {} - components/provesource: - specifiers: {} + components/provesource: {} components/proworkflow: dependencies: @@ -14349,8 +14349,7 @@ importers: specifier: ^0.1.4 version: 0.1.6 - components/yepcode: - specifiers: {} + components/yepcode: {} components/yespo: dependencies: @@ -34427,6 +34426,8 @@ snapshots: '@putout/operator-filesystem': 5.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3)) '@putout/operator-json': 2.2.0 putout: 36.13.1(eslint@8.57.1)(typescript@5.6.3) + transitivePeerDependencies: + - supports-color '@putout/operator-regexp@1.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3))': dependencies: From 9e5561b1f958930139d2fcaae266131dc9ea49c7 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Tue, 8 Apr 2025 13:57:01 -0300 Subject: [PATCH 4/7] some adjusts --- .../create-constituent/create-constituent.mjs | 43 +++++++++++-------- components/bloomerang/bloomerang.app.mjs | 6 +++ 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/components/bloomerang/actions/create-constituent/create-constituent.mjs b/components/bloomerang/actions/create-constituent/create-constituent.mjs index fbbc3374e567d..c67280b695519 100644 --- a/components/bloomerang/actions/create-constituent/create-constituent.mjs +++ b/components/bloomerang/actions/create-constituent/create-constituent.mjs @@ -133,27 +133,32 @@ export default { return {}; }, async run({ $ }) { + const data = { + Type: this.type, + Status: this.status, + Prefix: this.prefix, + Suffix: this.suffix, + JobTitle: this.jobTitle, + Gender: this.gender, + Birthdate: this.birthdate, + Employer: this.employer, + Website: this.website, + FacebookId: this.facebookId, + TwitterId: this.twitterId, + LinkedInId: this.linkedInId, + PreferredCommunicationChannel: this.preferredCommunicationChannel, + }; + if (this.type === "Individual") { + data.FirstName = this.firstName; + data.LastName = this.lastName; + data.MiddleName = this.middleName; + } else { + data.FullName = this.fullName; + } + const response = await this.bloomerang.createConstituent({ $, - data: { - Type: this.type, - Status: this.status, - FullName: this.fullName, - FirstName: this.firstName, - LastName: this.lastName, - MiddleName: this.middleName, - Prefix: this.prefix, - Suffix: this.suffix, - JobTitle: this.jobTitle, - Gender: this.gender, - Birthdate: this.birthdate, - Employer: this.employer, - Website: this.website, - FacebookId: this.facebookId, - TwitterId: this.twitterId, - LinkedInId: this.linkedInId, - PreferredCommunicationChannel: this.preferredCommunicationChannel, - }, + data, }); $.export("$summary", `Successfully created constituent with ID ${response.Id}`); diff --git a/components/bloomerang/bloomerang.app.mjs b/components/bloomerang/bloomerang.app.mjs index 03058b9f0693e..c931b04b8e0d6 100644 --- a/components/bloomerang/bloomerang.app.mjs +++ b/components/bloomerang/bloomerang.app.mjs @@ -95,6 +95,12 @@ export default { _makeRequest({ $ = this, path, ...opts }) { + console.log("config: ", { + url: this._baseUrl() + path, + headers: this._headers(), + ...opts, + }); + return axios($, { url: this._baseUrl() + path, headers: this._headers(), From ebf4f074fe93d485e684d1fde6d9fe1f44c2cc23 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Tue, 8 Apr 2025 13:58:21 -0300 Subject: [PATCH 5/7] pnpm update --- pnpm-lock.yaml | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9a41738f98e60..6bf4e739d6798 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1401,8 +1401,7 @@ importers: components/better_uptime: {} - components/bettercontact: - specifiers: {} + components/bettercontact: {} components/bettervoice: dependencies: @@ -1934,8 +1933,7 @@ importers: specifier: ^4.2.0 version: 4.2.0 - components/bytebot: - specifiers: {} + components/bytebot: {} components/byteforms: dependencies: @@ -8080,8 +8078,7 @@ importers: specifier: ^1.4.1 version: 1.6.6 - components/mistral_ai: - specifiers: {} + components/mistral_ai: {} components/mitra: {} @@ -8616,8 +8613,7 @@ importers: specifier: ^1.3.0 version: 1.6.6 - components/notiff: - specifiers: {} + components/notiff: {} components/notion: dependencies: @@ -12787,8 +12783,7 @@ importers: specifier: ^1.6.0 version: 1.6.6 - components/teltel: - specifiers: {} + components/teltel: {} components/temi: dependencies: @@ -13700,8 +13695,7 @@ importers: specifier: 3.2.2 version: 3.2.2 - components/verifiedemail: - specifiers: {} + components/verifiedemail: {} components/verifone: {} @@ -16461,8 +16455,8 @@ packages: '@dabh/diagnostics@2.0.3': resolution: {integrity: sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==} - '@definitelytyped/header-parser@0.2.18': - resolution: {integrity: sha512-3JWGzhieGOx+zhy+qaPDoiby2TPA1PZGpEJHt0VwR1aK0R9dER5BoBvnT5zSafg9kHQTw4aBRFbt3o41FNkaLw==} + '@definitelytyped/header-parser@0.2.19': + resolution: {integrity: sha512-zu+RxQpUCgorYUQZoyyrRIn9CljL1CeM4qak3NDeMO1r7tjAkodfpAGnVzx/6JR2OUk0tAgwmZxNMSwd9LVgxw==} engines: {node: '>=18.18.0'} '@definitelytyped/typescript-versions@0.1.8': @@ -32204,7 +32198,7 @@ snapshots: enabled: 2.0.0 kuler: 2.0.0 - '@definitelytyped/header-parser@0.2.18': + '@definitelytyped/header-parser@0.2.19': dependencies: '@definitelytyped/typescript-versions': 0.1.8 '@definitelytyped/utils': 0.1.8 @@ -38844,7 +38838,7 @@ snapshots: dts-critic@3.3.11(typescript@5.7.2): dependencies: - '@definitelytyped/header-parser': 0.2.18 + '@definitelytyped/header-parser': 0.2.19 command-exists: 1.2.9 rimraf: 3.0.2 semver: 6.3.1 @@ -38854,7 +38848,7 @@ snapshots: dtslint@4.2.1(typescript@5.7.2): dependencies: - '@definitelytyped/header-parser': 0.2.18 + '@definitelytyped/header-parser': 0.2.19 '@definitelytyped/typescript-versions': 0.1.8 '@definitelytyped/utils': 0.1.8 dts-critic: 3.3.11(typescript@5.7.2) From 657e5c1896d2d9d645242c8dd17ba6e13d559077 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 9 Apr 2025 09:58:12 -0300 Subject: [PATCH 6/7] remove console.log --- components/bloomerang/bloomerang.app.mjs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/components/bloomerang/bloomerang.app.mjs b/components/bloomerang/bloomerang.app.mjs index c931b04b8e0d6..03058b9f0693e 100644 --- a/components/bloomerang/bloomerang.app.mjs +++ b/components/bloomerang/bloomerang.app.mjs @@ -95,12 +95,6 @@ export default { _makeRequest({ $ = this, path, ...opts }) { - console.log("config: ", { - url: this._baseUrl() + path, - headers: this._headers(), - ...opts, - }); - return axios($, { url: this._baseUrl() + path, headers: this._headers(), From 6a24324bff039c1a60d8d018648cc4a3133403f3 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 9 Apr 2025 14:14:32 -0300 Subject: [PATCH 7/7] pnpm update --- pnpm-lock.yaml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0c69fc9c82e2a..07c412bc45a69 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1409,7 +1409,6 @@ importers: components/better_uptime: {} - components/bettercontact: {} components/bettercontact: {} components/bettervoice: @@ -8820,8 +8819,7 @@ importers: specifier: ^3.0.0 version: 3.0.3 - components/onehash: - specifiers: {} + components/onehash: {} components/onelogin: {} @@ -10160,8 +10158,7 @@ importers: specifier: ^1.5.1 version: 1.6.6 - components/public_record: - specifiers: {} + components/public_record: {} components/publisherkit: dependencies: @@ -10211,8 +10208,7 @@ importers: specifier: ^1.5.1 version: 1.6.6 - components/pushengage: - specifiers: {} + components/pushengage: {} components/pusher: dependencies: @@ -27892,22 +27888,22 @@ packages: superagent@3.8.1: resolution: {integrity: sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==} engines: {node: '>= 4.0'} - deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@4.1.0: resolution: {integrity: sha512-FT3QLMasz0YyCd4uIi5HNe+3t/onxMyEho7C3PSqmti3Twgy2rXT4fmkTz6wRL6bTF4uzPcfkUCa8u4JWHw8Ag==} engines: {node: '>= 6.0'} - deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@5.3.1: resolution: {integrity: sha512-wjJ/MoTid2/RuGCOFtlacyGNxN9QLMgcpYLDQlWFIhhdJ93kNscFonGvrpAHSCVjRVj++DGCglocF7Aej1KHvQ==} engines: {node: '>= 7.0.0'} - deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@7.1.6: resolution: {integrity: sha512-gZkVCQR1gy/oUXr+kxJMLDjla434KmSOKbx5iGD30Ql+AkJQ/YlPKECJy2nhqOsHLjGHzoDTXNSjhnvWhzKk7g==} engines: {node: '>=6.4.0 <13 || >=14'} - deprecated: Please downgrade to v7.1.5 if you need IE/ActiveXObject support OR upgrade to v8.0.0 as we no longer support IE and published an incorrect patch version (see https://github.com/visionmedia/superagent/issues/1731) + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net supports-color@2.0.0: resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==} @@ -34500,6 +34496,8 @@ snapshots: '@putout/operator-filesystem': 5.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3)) '@putout/operator-json': 2.2.0 putout: 36.13.1(eslint@8.57.1)(typescript@5.6.3) + transitivePeerDependencies: + - supports-color '@putout/operator-regexp@1.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3))': dependencies: