-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Delete Contact * List Mailing Lists * List Custom Fields * Version bumps * pnpm * syntax adjustment * Update components/loops_so/actions/send-transactional-email/send-transactional-email.mjs Co-authored-by: michelle0927 <[email protected]> --------- Co-authored-by: michelle0927 <[email protected]>
- Loading branch information
1 parent
447c2b1
commit d0c0ff6
Showing
11 changed files
with
118 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
components/loops_so/actions/delete-contact/delete-contact.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { ConfigurationError } from "@pipedream/platform"; | ||
import loops from "../../loops_so.app.mjs"; | ||
|
||
export default { | ||
key: "loops_so-delete-contact", | ||
name: "Delete Contact", | ||
description: "Delete an existing contact. [See the documentation](https://loops.so/docs/api-reference/delete-contact)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
loops, | ||
infoAlert: { | ||
type: "alert", | ||
alertType: "info", | ||
content: "You can provide either the contact's email address or user ID.", | ||
}, | ||
email: { | ||
propDefinition: [ | ||
loops, | ||
"email", | ||
], | ||
optional: true, | ||
}, | ||
userId: { | ||
type: "string", | ||
label: "User ID", | ||
description: "User ID of the contact", | ||
optional: true, | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const { | ||
loops, email, userId, | ||
} = this; | ||
if (!email && !userId) { | ||
throw new ConfigurationError("You must provide either the contact's email address or user ID."); | ||
} | ||
const response = await loops.deleteContact({ | ||
$, | ||
data: { | ||
email, | ||
userId, | ||
}, | ||
}); | ||
|
||
const summary = response?.success | ||
? "Successfully deleted contact" | ||
: "Failed to delete contact"; | ||
|
||
$.export("$summary", summary); | ||
|
||
return response; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
components/loops_so/actions/list-custom-fields/list-custom-fields.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import loops from "../../loops_so.app.mjs"; | ||
|
||
export default { | ||
key: "loops_so-list-custom-fields", | ||
name: "List Custom Fields", | ||
description: "List your account's custom contact properties. [See the documentation](https://loops.so/docs/api-reference/list-custom-fields)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
loops, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.loops.listCustomFields({ | ||
$, | ||
}); | ||
|
||
$.export("$summary", `Successfully retrieved ${response.length} custom fields`); | ||
|
||
return response; | ||
}, | ||
}; |
21 changes: 21 additions & 0 deletions
21
components/loops_so/actions/list-mailing-lists/list-mailing-lists.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import loops from "../../loops_so.app.mjs"; | ||
|
||
export default { | ||
key: "loops_so-list-mailing-lists", | ||
name: "List Mailing Lists", | ||
description: "List your account's mailing lists. [See the documentation](https://loops.so/docs/api-reference/list-mailing-lists)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
loops, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.loops.listMailingLists({ | ||
$, | ||
}); | ||
|
||
$.export("$summary", `Successfully retrieved ${response.length} mailing lists`); | ||
|
||
return response; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.