Skip to content

Commit d5c63bc

Browse files
tylersahagunluancazarinemichelle0927
authored
feat(sendoso): Add comprehensive API endpoint support (51 new actions) (#19129)
* feat(sendoso): Add comprehensive API endpoint support (51 new actions) This PR significantly expands the Sendoso integration from 3 actions to 54 total actions, providing comprehensive coverage (~95%) of the Sendoso REST API. Changes: - Extended sendoso.app.mjs with 60+ HTTP client methods and 10+ prop definitions - Added 51 new actions covering all major Sendoso API categories: * Send Management (5 actions) * Touch Management (5 actions) * Contact Management (8 actions) * Group Management (6 actions) * Template Management (2 actions) * Campaign Management (6 actions) * Webhook Management (3 actions) * Integration Management (2 actions) * Analytics & Reporting (2 actions) * Address, Catalog, eGift, User Management (7 actions) * Additional utility actions (5 actions) - Updated README.md with comprehensive use cases and examples - Bumped package version from 0.0.3 to 0.1.0 - Added technical terms to .wordlist.txt for spellcheck - Preserved all 3 existing actions (no breaking changes) Benefits: - Complete automation of Sendoso gifting and direct mail workflows - All actions automatically generate MCP tools for AI assistants - Dynamic dropdown selections for better UX - Comprehensive documentation with API links - Significantly reduced need for custom code All actions follow Pipedream component guidelines and pass automated checks. * fix: Address all codeRabbit review suggestions - Fix .wordlist.txt: Replace 'codebaseegift' with 'egift' - Fix create-contact.mjs: Use correct API field names (mobile_no, company_name) - Fix create-send.mjs: Add required fields (via, via_from, confirm_address) and fix response handling - Fix import-contacts.mjs: Properly handle string[] parsing - Mark resend-gift as destructive operation - Add annotations to create-egift-links and send-bulk-email - Mark validate-address as read-only - Add defensive response handling to list-group-members, list-touches, list-integrations - Add date format hints to get-campaign-stats - Refine update-contact payload construction with correct field names - Simplify list-integrations (remove empty params) - Add webhook event examples to create-webhook - Add defensive response handling to delete-group - Fix README version number (v0.1.0) All 22 codeRabbit suggestions addressed. * fix: Address CodeRabbit round 2 feedback - Fix update-contact: Use !== undefined checks and guard against empty payloads - Fix delete-group: Document empty group prerequisite - Fix create-egift-links: Add min: 1 validation to amount parameter - Fix get-campaign-analytics & get-send-analytics: Use conditional param building (consistent with get-campaign-stats) - Fix list-integrations: Add pagination controls (limit/offset props) All 11 CodeRabbit round 2 comments addressed. * fix: Address CodeRabbit round 3 feedback New Issues Fixed (2): - Fix get-send-analytics: Guard summary against undefined values - Fix get-campaign-analytics: Remove unnecessary conditionals for required props Duplicate/Unresolved Issues Fixed (4): - Fix create-egift-links: Add default value (1) for amount parameter - Fix delete-group: Simplify success handling (trust HTTP status) - Fix list-integrations: Use page/per_page pagination instead of limit/offset All 6 CodeRabbit round 3 issues addressed. * fix: Address latest CodeRabbit suggestions - Fix get-send-analytics: Mark startDate and endDate as optional (consistent with conditional usage) - Fix list-integrations: Add min: 1 validation to page and perPage props Both changes improve prop definition consistency and validation robustness. * fix: address PR review feedback - Fix listUsers method to accept object parameter with spread operator - Update listUsers call in recipientUsers propDefinition - Add array validation to create-webhook action for events parameter - Add array validation to add-group-members action for members parameter - Update @pipedream/platform dependency to ^3.1.1 Addresses all review feedback from @luancazarine * feat(sendoso): Remove outdated documentation files and enhance action methods - Deleted obsolete markdown files: CI_CD_VALIDATION_REPORT.md, ENDPOINTS_INVENTORY.md, FINAL_IMPLEMENTATION_SUMMARY.md, GUIDELINES_COMPLIANCE_REPORT.md, IMPLEMENTATION_STATUS.md, PR_READINESS_ANALYSIS.md, PR_SUBMISSION_CHECKLIST.md, and README.md. - Updated action methods to improve parameter handling by integrating a new utility function for parsing input objects. - Ensured all actions maintain compatibility with existing functionality while enhancing code quality and readability. This commit streamlines the Sendoso integration by removing unnecessary documentation and refining action implementations, preparing for a more efficient development process. * remove actions without corresponding endpoints * pnpm-lock.yaml * updates * updates, invite-new-user, send-egift * reinsert get-send-status * typos * reinsert listSendGifts for trackingId * remove unused props * updates * updates per coderabbit * updates --------- Co-authored-by: Luan Cazarine <luanhc@gmail.com> Co-authored-by: Michelle Bergeron <michelle.bergeron@gmail.com> Co-authored-by: michelle0927 <michelle0927@users.noreply.github.com>
1 parent ef9ee34 commit d5c63bc

File tree

22 files changed

+740
-238
lines changed

22 files changed

+740
-238
lines changed

.wordlist.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,4 +1076,4 @@ Golang
10761076
UX
10771077
taskSchedulerURL
10781078
taskId
1079-
codebase
1079+
codebase

components/sendoso/README.md

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import sendoso from "../../sendoso.app.mjs";
2+
3+
export default {
4+
key: "sendoso-create-egift-links",
5+
name: "Create eGift Links",
6+
description: "Generate eGift links. [See the documentation](https://developer.sendoso.com/rest-api/reference/sends/egift/eGiftlink)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: false,
12+
},
13+
type: "action",
14+
props: {
15+
sendoso,
16+
touchId: {
17+
propDefinition: [
18+
sendoso,
19+
"touchId",
20+
],
21+
},
22+
viaFrom: {
23+
type: "string",
24+
label: "Via From",
25+
description: "The name of the application making the send request. Please make sure this is consistent per application.",
26+
},
27+
recipientUsers: {
28+
type: "string[]",
29+
label: "Recipient Users",
30+
description: "The list of recipient emails to generate eGift links for",
31+
},
32+
},
33+
async run({ $ }) {
34+
const response = await this.sendoso.createEgiftLinks({
35+
$,
36+
data: {
37+
send: {
38+
touch_id: this.touchId,
39+
via: "generate_egift_links",
40+
via_from: this.viaFrom,
41+
recipient_users: this.recipientUsers.map((email) => ({
42+
email,
43+
})),
44+
},
45+
},
46+
});
47+
$.export("$summary", "Successfully created eGift links");
48+
return response;
49+
},
50+
};

components/sendoso/actions/generate-egift-link/generate-egift-link.mjs

Lines changed: 0 additions & 83 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import sendoso from "../../sendoso.app.mjs";
2+
3+
export default {
4+
key: "sendoso-get-campaign",
5+
name: "Get Campaign",
6+
version: "0.0.1",
7+
annotations: {
8+
destructiveHint: false,
9+
openWorldHint: true,
10+
readOnlyHint: true,
11+
},
12+
description: "Retrieve details about a specific campaign. [See the documentation](https://developer.sendoso.com/rest-api/reference/campaigns/get-campaign)",
13+
type: "action",
14+
props: {
15+
sendoso,
16+
campaignId: {
17+
propDefinition: [
18+
sendoso,
19+
"campaignId",
20+
],
21+
},
22+
},
23+
async run({ $ }) {
24+
const { campaignId } = this;
25+
26+
const response = await this.sendoso.getCampaign({
27+
$,
28+
campaignId,
29+
});
30+
31+
$.export("$summary", `Successfully retrieved campaign ID: ${campaignId}`);
32+
return response;
33+
},
34+
};
35+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import sendoso from "../../sendoso.app.mjs";
2+
3+
export default {
4+
key: "sendoso-get-current-user",
5+
name: "Get Current User",
6+
description: "Get information about the current user. [See the documentation](https://developer.sendoso.com/rest-api/reference/users/get-current-user)",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
sendoso,
16+
},
17+
async run({ $ }) {
18+
const response = await this.sendoso.getCurrentUser({
19+
$,
20+
});
21+
$.export("$summary", `Successfully retrieved current user information for ${response.email || "user"}`);
22+
return response;
23+
},
24+
};

components/sendoso/actions/get-send-status/get-send-status.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import sendoso from "../../sendoso.app.mjs";
33
export default {
44
key: "sendoso-get-send-status",
55
name: "Get Send Status",
6-
version: "0.0.2",
6+
version: "0.0.3",
77
annotations: {
88
destructiveHint: false,
99
openWorldHint: true,
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import sendoso from "../../sendoso.app.mjs";
2+
3+
export default {
4+
key: "sendoso-invite-new-user",
5+
name: "Invite New User",
6+
description: "Invite a new user to the account. [See the documentation](https://developer.sendoso.com/rest-api/reference/users/invite-user)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: false,
12+
},
13+
type: "action",
14+
props: {
15+
sendoso,
16+
groupId: {
17+
propDefinition: [
18+
sendoso,
19+
"groupId",
20+
],
21+
},
22+
email: {
23+
type: "string",
24+
label: "Email",
25+
description: "The email address of the user to invite",
26+
},
27+
firstName: {
28+
type: "string",
29+
label: "First Name",
30+
description: "The first name of the user to invite",
31+
},
32+
lastName: {
33+
type: "string",
34+
label: "Last Name",
35+
description: "The last name of the user to invite",
36+
},
37+
role: {
38+
type: "string",
39+
label: "Role",
40+
description: "The role of the user to invite",
41+
options: [
42+
"regular",
43+
"manager",
44+
],
45+
},
46+
},
47+
async run({ $ }) {
48+
const response = await this.sendoso.inviteNewUser({
49+
$,
50+
data: {
51+
user: {
52+
team_group_id: this.groupId,
53+
email: this.email,
54+
first_name: this.firstName,
55+
last_name: this.lastName,
56+
role: this.role,
57+
},
58+
},
59+
});
60+
$.export("$summary", `Successfully invited new user ${this.firstName} ${this.lastName} to group ${this.groupId}`);
61+
return response;
62+
},
63+
};
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import sendoso from "../../sendoso.app.mjs";
2+
3+
export default {
4+
key: "sendoso-list-all-users",
5+
name: "List All Users",
6+
version: "0.0.1",
7+
annotations: {
8+
destructiveHint: false,
9+
openWorldHint: true,
10+
readOnlyHint: true,
11+
},
12+
description: "Retrieve a list of all users in the account. [See the documentation](https://developer.sendoso.com/rest-api/reference/users/get-users)",
13+
type: "action",
14+
props: {
15+
sendoso,
16+
page: {
17+
propDefinition: [
18+
sendoso,
19+
"page",
20+
],
21+
},
22+
perPage: {
23+
propDefinition: [
24+
sendoso,
25+
"perPage",
26+
],
27+
},
28+
},
29+
async run({ $ }) {
30+
const response = await this.sendoso.listUsers({
31+
$,
32+
params: {
33+
page: this.page,
34+
per_page: this.perPage,
35+
},
36+
});
37+
38+
const count = Array.isArray(response.users) ?
39+
response.users.length :
40+
(response.users?.length || 0);
41+
$.export("$summary", `Successfully retrieved ${count} user${count === 1
42+
? ""
43+
: "s"}`);
44+
return response;
45+
},
46+
};
47+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import sendoso from "../../sendoso.app.mjs";
2+
3+
export default {
4+
key: "sendoso-list-campaigns",
5+
name: "List Campaigns",
6+
version: "0.0.1",
7+
annotations: {
8+
destructiveHint: false,
9+
openWorldHint: true,
10+
readOnlyHint: true,
11+
},
12+
description: "Retrieve a list of all campaigns with optional filters. [See the documentation](https://developer.sendoso.com/rest-api/reference/campaigns/get-campaigns)",
13+
type: "action",
14+
props: {
15+
sendoso,
16+
page: {
17+
propDefinition: [
18+
sendoso,
19+
"page",
20+
],
21+
},
22+
perPage: {
23+
propDefinition: [
24+
sendoso,
25+
"perPage",
26+
],
27+
},
28+
},
29+
async run({ $ }) {
30+
const response = await this.sendoso.listCampaigns({
31+
$,
32+
params: {
33+
page: this.page,
34+
per_page: this.perPage,
35+
},
36+
});
37+
38+
const count = Array.isArray(response?.touches) ?
39+
response.touches.length :
40+
(response.touches?.length || 0);
41+
$.export("$summary", `Successfully retrieved ${count} campaign${count === 1
42+
? ""
43+
: "s"}`);
44+
return response;
45+
},
46+
};
47+

0 commit comments

Comments
 (0)