Skip to content

Commit b6e8582

Browse files
committed
Adjustments
1 parent 338ca03 commit b6e8582

File tree

7 files changed

+31
-32
lines changed

7 files changed

+31
-32
lines changed

components/the_magic_drip/actions/add_lead_to_campaign/add_lead_to_campaign.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import the_magic_drip from "../../the_magic_drip.app.mjs";
1+
import app from "../../the_magic_drip.app.mjs";
22

33
export default {
44
key: "the_magic_drip-add-lead-to-campaign",
@@ -7,30 +7,30 @@ export default {
77
version: "0.0.{{ts}}",
88
type: "action",
99
props: {
10-
the_magic_drip,
10+
app,
1111
campaignId: {
1212
propDefinition: [
13-
the_magic_drip,
13+
app,
1414
"campaignId",
1515
],
1616
},
1717
company: {
1818
propDefinition: [
19-
the_magic_drip,
19+
app,
2020
"company",
2121
],
2222
optional: true,
2323
},
2424
linkedinUrl: {
2525
propDefinition: [
26-
the_magic_drip,
26+
app,
2727
"linkedinUrl",
2828
],
2929
optional: true,
3030
},
3131
},
3232
async run({ $ }) {
33-
const response = await this.the_magic_drip.addLeadToCampaign({
33+
const response = await this.app.addLeadToCampaign({
3434
campaignId: this.campaignId,
3535
company: this.company,
3636
linkedinUrl: this.linkedinUrl,
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import the_magic_drip from "../../the_magic_drip.app.mjs";
1+
import app from "../../the_magic_drip.app.mjs";
22

33
export default {
44
key: "the_magic_drip-list-campaigns",
55
name: "List Campaigns",
6-
description: "Lists all available campaigns. [See the documentation](https://docs.themagicdrip.com/api-reference/introduction)",
7-
version: "0.0.{{ts}}",
6+
description: "Retrieve all available campaigns. [See the documentation](https://docs.themagicdrip.com/api-reference/endpoint/get-v1campaign)",
7+
version: "0.0.1",
88
type: "action",
99
props: {
10-
the_magic_drip,
10+
app,
1111
},
1212
async run({ $ }) {
13-
const response = await this.the_magic_drip.listCampaigns();
14-
$.export("$summary", `Listed ${response.campaigns.length} campaigns`);
15-
return response.campaigns;
13+
const { campaigns } = await this.app.listCampaigns();
14+
$.export("$summary", `Sucessfully retrieved ${campaigns?.length ?? 0} campaigns`);
15+
return campaigns;
1616
},
1717
};
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import the_magic_drip from "../../the_magic_drip.app.mjs";
1+
import app from "../../the_magic_drip.app.mjs";
22

33
export default {
44
key: "the_magic_drip-list-templates",
55
name: "List Templates",
6-
description: "Lists all available templates. [See the documentation]()",
7-
version: "0.0.{{ts}}",
6+
description: "Retrieve all available templates. [See the documentation](https://docs.themagicdrip.com/api-reference/endpoint/get-v1templates)",
7+
version: "0.0.1",
88
type: "action",
99
props: {
10-
the_magic_drip,
10+
app,
1111
},
1212
async run({ $ }) {
13-
const templates = await this.the_magic_drip.listTemplates();
14-
$.export("$summary", `Listed ${templates.templates.length} templates`);
13+
const { templates } = await this.app.listTemplates();
14+
$.export("$summary", `Sucessfully retrieved ${templates?.length ?? 0} templates`);
1515
return templates;
1616
},
1717
};

components/the_magic_drip/actions/mark_campaign_active_or_inactive/mark_campaign_active_or_inactive.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import the_magic_drip from "../../the_magic_drip.app.mjs";
1+
import app from "../../the_magic_drip.app.mjs";
22

33
export default {
44
key: "the_magic_drip-mark-campaign-active-inactive",
@@ -7,10 +7,10 @@ export default {
77
version: "0.0.{{ts}}",
88
type: "action",
99
props: {
10-
the_magic_drip,
10+
app,
1111
campaignId: {
1212
propDefinition: [
13-
the_magic_drip,
13+
app,
1414
"campaignId",
1515
],
1616
},
@@ -21,7 +21,7 @@ export default {
2121
},
2222
},
2323
async run({ $ }) {
24-
const response = await this.the_magic_drip.markCampaignActiveInactive({
24+
const response = await this.app.markCampaignActiveInactive({
2525
campaignId: this.campaignId,
2626
desiredState: this.desiredState,
2727
});

components/the_magic_drip/sources/new campaign created/new_campaign_created.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform";
2-
import the_magic_drip from "../../the_magic_drip.app.mjs";
2+
import app from "../../the_magic_drip.app.mjs";
33

44
export default {
55
key: "the_magic_drip-new-campaign-created",
@@ -9,7 +9,7 @@ export default {
99
type: "source",
1010
dedupe: "unique",
1111
props: {
12-
the_magic_drip,
12+
app,
1313
db: "$.service.db",
1414
timer: {
1515
type: "$.interface.timer",
@@ -21,7 +21,7 @@ export default {
2121
hooks: {
2222
async deploy() {
2323
const lastRunAt = new Date(0).toISOString();
24-
const newCampaigns = await this.the_magic_drip.pollNewCampaigns(lastRunAt);
24+
const newCampaigns = await this.app.pollNewCampaigns(lastRunAt);
2525
const sortedCampaigns = newCampaigns.sort(
2626
(a, b) => new Date(b.createdAt) - new Date(a.createdAt),
2727
).slice(0, 50);
@@ -51,7 +51,7 @@ export default {
5151
},
5252
async run() {
5353
const lastRunAt = (await this.db.get("lastRunAt")) || new Date(0).toISOString();
54-
const newCampaigns = await this.the_magic_drip.pollNewCampaigns(lastRunAt);
54+
const newCampaigns = await this.app.pollNewCampaigns(lastRunAt);
5555
const sortedCampaigns = newCampaigns.sort(
5656
(a, b) => new Date(b.createdAt) - new Date(a.createdAt),
5757
);

components/the_magic_drip/sources/new template created/new_template_created.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform";
2-
import the_magic_drip from "../../the_magic_drip.app.mjs";
2+
import app from "../../the_magic_drip.app.mjs";
33

44
export default {
55
key: "the_magic_drip-new-template-created",
@@ -9,7 +9,7 @@ export default {
99
type: "source",
1010
dedupe: "unique",
1111
props: {
12-
the_magic_drip,
12+
app,
1313
db: "$.service.db",
1414
timer: {
1515
type: "$.interface.timer",
@@ -29,7 +29,7 @@ export default {
2929
hooks: {
3030
async deploy() {
3131
const lastRunAt = new Date(0).toISOString();
32-
const newTemplates = await this.the_magic_drip.pollNewTemplates(lastRunAt);
32+
const newTemplates = await this.app.pollNewTemplates(lastRunAt);
3333
const sortedTemplates = newTemplates.sort(
3434
(a, b) => new Date(b.createdAt) - new Date(a.createdAt),
3535
);
@@ -56,7 +56,7 @@ export default {
5656
},
5757
async run() {
5858
const lastRunAt = await this._getLastRunAt();
59-
const newTemplates = await this.the_magic_drip.pollNewTemplates(lastRunAt);
59+
const newTemplates = await this.app.pollNewTemplates(lastRunAt);
6060
const sortedNewTemplates = newTemplates.sort(
6161
(a, b) => new Date(a.createdAt) - new Date(b.createdAt),
6262
);

components/the_magic_drip/the_magic_drip.app.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { axios } from "@pipedream/platform";
33
export default {
44
type: "app",
55
app: "the_magic_drip",
6-
version: "0.0.{{ts}}",
76
propDefinitions: {
87
campaignId: {
98
type: "string",

0 commit comments

Comments
 (0)