Skip to content

Commit 5308a8d

Browse files
committed
Fixed conflicts
1 parent 97224d2 commit 5308a8d

File tree

23 files changed

+10213
-1146
lines changed

23 files changed

+10213
-1146
lines changed

components/infobip/README.md

Lines changed: 91 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,96 @@
1-
# Overview
1+
# Enhanced Infobip App
22

3-
The Infobip API is a communication platform that enables seamless integration of messaging, voice, and email functionalities into various applications. With Infobip, you can automate notifications, authenticate users via one-time passwords, engage customers across multiple channels, and track communication performance. Pipedream's serverless execution environment lets you create sophisticated workflows that harness the capabilities of Infobip by triggering actions based on events, manipulating data, and connecting with numerous other apps.
3+
Auto-generated Infobip SMS components using the official OpenAPI specification.
44

5-
# Example Use Cases
5+
## Features
66

7-
- **Customer Support Automation**: When a new ticket is created in Zendesk, use Infobip to send an SMS confirmation to the customer. Automatically escalate unresolved issues by triggering a voice call after a set period, enhancing customer experience and response times.
7+
- **Auto-Generated Methods**: All SMS API methods from OpenAPI spec
8+
- **Always Up-to-Date**: Methods stay current with latest Infobip API
9+
- **Backward Compatible**: Existing manual methods still work
10+
- **Type-Safe**: JSDoc comments from OpenAPI descriptions
811

9-
- **Multi-channel Marketing Campaigns**: Trigger an Infobip workflow from a Shopify order event. Send personalized SMS messages for order confirmations, then follow up with email campaigns for related products, feedback requests, or loyalty program invites, all orchestrated within Pipedream.
12+
## Quick Start
1013

11-
- **Two-factor Authentication (2FA)**: Implement 2FA by integrating Infobip with a custom authentication system. Generate and send one-time passwords via SMS when a user attempts to log in, and verify the tokens within Pipedream workflows to enhance security across your application.
14+
### Send SMS (v3 - Recommended)
15+
```javascript
16+
const response = await this.infobip.sendSmsMessage({
17+
data: {
18+
messages: [{
19+
sender: "TestSender",
20+
destinations: [{ to: "+1234567890" }],
21+
content: { text: "Hello World" }
22+
}]
23+
}
24+
});
25+
```
26+
27+
### Legacy Method (Still Works)
28+
```javascript
29+
const response = await this.infobip.sendSms({
30+
data: {
31+
messages: [{
32+
destinations: [{ to: "+1234567890" }],
33+
from: "TestSender",
34+
text: "Hello World"
35+
}]
36+
}
37+
});
38+
```
39+
40+
## Available Scripts
41+
42+
Run these npm scripts for development:
43+
44+
```bash
45+
# Generate enhanced app with OpenAPI methods
46+
npm run generate-infobip-enhanced-app
47+
48+
# Generate action components from OpenAPI spec
49+
npm run generate-infobip-actions
50+
```
51+
52+
## Auto-Generated Methods
53+
54+
Key methods available from OpenAPI:
55+
56+
- `sendSmsMessages` - Send SMS (v3 API)
57+
- `getSmsDeliveryReports` - Get delivery reports
58+
- `getSmsLogs` - Get SMS logs
59+
- `getScheduledSmsMessages` - Get scheduled messages
60+
- `previewSms` - Preview SMS before sending
61+
- `getInboundSmsMessages` - Get inbound messages
62+
63+
## Advanced Usage
64+
65+
### List All Methods
66+
```javascript
67+
const methods = await this.infobip.getOpenAPIMethods();
68+
console.log('Available methods:', methods);
69+
```
70+
71+
### Dynamic Method Calling
72+
```javascript
73+
const reports = await this.infobip.callOpenAPIMethod('getSmsDeliveryReports', {
74+
params: { messageId: 'your-message-id' }
75+
});
76+
```
77+
78+
### Debug OpenAPI Spec
79+
```javascript
80+
const spec = await this.infobip.debugOpenAPISpec();
81+
console.log('OpenAPI version:', spec.info.version);
82+
```
83+
84+
## Troubleshooting
85+
86+
**OpenAPI Fetch Issues**: If spec fails to load, fallback manual methods still work.
87+
88+
**Method Not Found**:
89+
```javascript
90+
const methods = await this.infobip.debugAvailableMethods();
91+
```
92+
93+
## References
94+
95+
- [Infobip OpenAPI Spec](https://api.infobip.com/platform/1/openapi/sms)
96+
- [Infobip SMS Docs](https://www.infobip.com/docs/sms)

components/infobip/actions/get-inbound-sms-messages/get-inbound-sms-messages.mjs

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,58 @@
1-
import infobip from "../../infobip-enhanced.app.mjs";
1+
import infobip from "../../infobip.app.mjs";
22

33
export default {
4-
key: "infobip-get-inbound-sms-messages",
4+
key: "get-inbound-sms-messages",
55
name: "Get Inbound SMS Messages",
66
description:
77
"Get inbound SMS messages If you are unable to receive incoming SMS to the endpoint of your choice in real-time, you can use this API call to fetch messages. Each request will return a batch of rece... [See the documentation](https://www.infobip.com/docs/api)",
88
version: "0.0.1",
99
type: "action",
1010
props: {
11-
infobip
11+
infobip,
12+
limit: {
13+
type: "integer",
14+
label: "Limit",
15+
description: "Maximum number of messages to be returned in a response. If not set, the latest 50 records are returned. Maximum limit value is `1000` and you can only access messages for the last 48h.",
16+
optional: true,
17+
},
18+
applicationId: {
19+
type: "string",
20+
label: "Application Id",
21+
description: "Application id that the message is linked to. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).",
22+
optional: true,
23+
},
24+
entityId: {
25+
type: "string",
26+
label: "Entity Id",
27+
description: "Entity id that the message is linked to. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).",
28+
optional: true,
29+
},
30+
campaignReferenceId: {
31+
type: "string",
32+
label: "Campaign Reference Id",
33+
description: "ID of a campaign that was sent in the message.",
34+
optional: true,
35+
}
1236
},
1337
async run({ $ }) {
14-
const { infobip, ...params } = this;
38+
const { infobip, limit, applicationId, entityId, campaignReferenceId, ...params } = this;
1539

16-
const response = await infobip.getInboundSmsMessages({ $ });
40+
const pathQuery = [];
41+
if (limit !== undefined && limit !== null) pathQuery.push({ name: "limit", value: limit.toString() });
42+
if (applicationId !== undefined && applicationId !== null) pathQuery.push({ name: "applicationId", value: applicationId.toString() });
43+
if (entityId !== undefined && entityId !== null) pathQuery.push({ name: "entityId", value: entityId.toString() });
44+
if (campaignReferenceId !== undefined && campaignReferenceId !== null) pathQuery.push({ name: "campaignReferenceId", value: campaignReferenceId.toString() });
45+
46+
Object.entries(params).forEach(([key, value]) => {
47+
if (value !== undefined && value !== null) {
48+
pathQuery.push({ name: key, value: value.toString() });
49+
}
50+
});
51+
52+
const response = await infobip.getInboundSmsMessages({
53+
$,
54+
pathQuery: pathQuery.length > 0 ? pathQuery : undefined,
55+
});
1756

1857
$.export(
1958
"$summary",

components/infobip/actions/get-outbound-sms-message-delivery-reports-v3/get-outbound-sms-message-delivery-reports-v3.mjs

Lines changed: 58 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,72 @@
1-
import infobip from "../../infobip-enhanced.app.mjs";
1+
import infobip from "../../infobip.app.mjs";
22

33
export default {
4-
key: "infobip-get-outbound-sms-message-delivery-reports-v3",
4+
key: "get-outbound-sms-message-delivery-reports-v3",
55
name: "Get Outbound SMS Message Delivery Reports V3",
66
description:
77
"Get outbound SMS message delivery reports If you are unable to receive real-time message delivery reports towards your endpoint for various reasons, we offer you an API method to fetch batches of m... [See the documentation](https://www.infobip.com/docs/sms)",
88
version: "0.0.1",
99
type: "action",
1010
props: {
11-
infobip
11+
infobip,
12+
bulkId: {
13+
type: "string",
14+
label: "Bulk Id",
15+
description: "The ID that uniquely identifies the request. Bulk ID will be received only when you send a message to more than one destination address.",
16+
optional: true,
17+
},
18+
messageId: {
19+
type: "string",
20+
label: "Message Id",
21+
description: "The ID that uniquely identifies the message sent.",
22+
optional: true,
23+
},
24+
limit: {
25+
type: "integer",
26+
label: "Limit",
27+
description: "Maximum number of delivery reports to be returned. If not set, the latest 50 records are returned. Maximum limit value is 1000 and you can only access reports for the last 48h",
28+
optional: true,
29+
},
30+
entityId: {
31+
type: "string",
32+
label: "Entity Id",
33+
description: "Entity id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).",
34+
optional: true,
35+
},
36+
applicationId: {
37+
type: "string",
38+
label: "Application Id",
39+
description: "Application id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).",
40+
optional: true,
41+
},
42+
campaignReferenceId: {
43+
type: "string",
44+
label: "Campaign Reference Id",
45+
description: "ID of a campaign that was sent in the message.",
46+
optional: true,
47+
}
1248
},
1349
async run({ $ }) {
14-
const { infobip, ...params } = this;
50+
const { infobip, bulkId, messageId, limit, entityId, applicationId, campaignReferenceId, ...params } = this;
1551

16-
const response = await infobip.getOutboundSmsMessageDeliveryReportsV3({ $ });
52+
const pathQuery = [];
53+
if (bulkId !== undefined && bulkId !== null) pathQuery.push({ name: "bulkId", value: bulkId.toString() });
54+
if (messageId !== undefined && messageId !== null) pathQuery.push({ name: "messageId", value: messageId.toString() });
55+
if (limit !== undefined && limit !== null) pathQuery.push({ name: "limit", value: limit.toString() });
56+
if (entityId !== undefined && entityId !== null) pathQuery.push({ name: "entityId", value: entityId.toString() });
57+
if (applicationId !== undefined && applicationId !== null) pathQuery.push({ name: "applicationId", value: applicationId.toString() });
58+
if (campaignReferenceId !== undefined && campaignReferenceId !== null) pathQuery.push({ name: "campaignReferenceId", value: campaignReferenceId.toString() });
59+
60+
Object.entries(params).forEach(([key, value]) => {
61+
if (value !== undefined && value !== null) {
62+
pathQuery.push({ name: key, value: value.toString() });
63+
}
64+
});
65+
66+
const response = await infobip.getOutboundSmsMessageDeliveryReportsV3({
67+
$,
68+
pathQuery: pathQuery.length > 0 ? pathQuery : undefined,
69+
});
1770

1871
$.export(
1972
"$summary",

components/infobip/actions/get-outbound-sms-message-delivery-reports/get-outbound-sms-message-delivery-reports.mjs

Lines changed: 58 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,72 @@
1-
import infobip from "../../infobip-enhanced.app.mjs";
1+
import infobip from "../../infobip.app.mjs";
22

33
export default {
4-
key: "infobip-get-outbound-sms-message-delivery-reports",
4+
key: "get-outbound-sms-message-delivery-reports",
55
name: "Get Outbound SMS Message Delivery Reports",
66
description:
77
"Get outbound SMS message delivery reports If you are for any reason unable to receive real-time delivery reports on your endpoint, you can use this API method to learn if and when the message has b... [See the documentation](https://www.infobip.com/docs/sms)",
88
version: "0.0.1",
99
type: "action",
1010
props: {
11-
infobip
11+
infobip,
12+
bulkId: {
13+
type: "string",
14+
label: "Bulk Id",
15+
description: "Unique ID assigned to the request if messaging multiple recipients or sending multiple messages via a single API request.",
16+
optional: true,
17+
},
18+
messageId: {
19+
type: "string",
20+
label: "Message Id",
21+
description: "Unique message ID for which a report is requested.",
22+
optional: true,
23+
},
24+
limit: {
25+
type: "integer",
26+
label: "Limit",
27+
description: "Maximum number of delivery reports to be returned. If not set, the latest 50 records are returned. Maximum limit value is `1000` and you can only access reports for the last 48h.",
28+
optional: true,
29+
},
30+
applicationId: {
31+
type: "string",
32+
label: "Application Id",
33+
description: "Application id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).",
34+
optional: true,
35+
},
36+
entityId: {
37+
type: "string",
38+
label: "Entity Id",
39+
description: "Entity id used to send the message. For more details, see our [documentation](https://www.infobip.com/docs/cpaas-x/application-and-entity-management).",
40+
optional: true,
41+
},
42+
campaignReferenceId: {
43+
type: "string",
44+
label: "Campaign Reference Id",
45+
description: "ID of a campaign that was sent in the message.",
46+
optional: true,
47+
}
1248
},
1349
async run({ $ }) {
14-
const { infobip, ...params } = this;
50+
const { infobip, bulkId, messageId, limit, applicationId, entityId, campaignReferenceId, ...params } = this;
1551

16-
const response = await infobip.getOutboundSmsMessageDeliveryReports({ $ });
52+
const pathQuery = [];
53+
if (bulkId !== undefined && bulkId !== null) pathQuery.push({ name: "bulkId", value: bulkId.toString() });
54+
if (messageId !== undefined && messageId !== null) pathQuery.push({ name: "messageId", value: messageId.toString() });
55+
if (limit !== undefined && limit !== null) pathQuery.push({ name: "limit", value: limit.toString() });
56+
if (applicationId !== undefined && applicationId !== null) pathQuery.push({ name: "applicationId", value: applicationId.toString() });
57+
if (entityId !== undefined && entityId !== null) pathQuery.push({ name: "entityId", value: entityId.toString() });
58+
if (campaignReferenceId !== undefined && campaignReferenceId !== null) pathQuery.push({ name: "campaignReferenceId", value: campaignReferenceId.toString() });
59+
60+
Object.entries(params).forEach(([key, value]) => {
61+
if (value !== undefined && value !== null) {
62+
pathQuery.push({ name: key, value: value.toString() });
63+
}
64+
});
65+
66+
const response = await infobip.getOutboundSmsMessageDeliveryReports({
67+
$,
68+
pathQuery: pathQuery.length > 0 ? pathQuery : undefined,
69+
});
1770

1871
$.export(
1972
"$summary",

0 commit comments

Comments
 (0)