@pipedream/octopush_sms 0.0.1 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # Overview
2
+
3
+ The Octopush SMS API lets you programmatically send text messages, providing a powerful way to reach out to customers directly on their phones. With Pipedream, you can create workflows that trigger SMS sending via Octopush based on various events, streamlining communication processes. You could use this API to send alerts, reminders, verification codes, or marketing messages, and integrate with other apps to respond to emails, form submissions, or updates in a CRM.
4
+
5
+ # Example Use Cases
6
+
7
+ - **SMS Alerts for Critical System Outages**: When a monitoring system like Datadog detects an outage or critical system issue, it can trigger a Pipedream workflow to send an immediate alert via Octopush SMS to your on-call engineers, reducing response times.
8
+
9
+ - **Appointment Reminders from Google Calendar**: Set up a workflow where upcoming Google Calendar events trigger SMS reminders through Octopush. This keeps clients or patients informed about their appointments, potentially cutting down on no-shows.
10
+
11
+ - **E-commerce Order Confirmations**: Whenever a new order is placed in an e-commerce platform like Shopify, a Pipedream workflow can automatically send an order confirmation and updates via SMS through Octopush, enhancing customer experience.
@@ -0,0 +1,62 @@
1
+ import octopush from "../../octopush_sms.app.mjs";
2
+
3
+ export default {
4
+ key: "octopush_sms-add-contact",
5
+ name: "Add Contact",
6
+ description: "Adds a new contact to a list in the Octopush SMS Gateway. [See the documentation](https://dev.octopush.com/en/sms-gateway-api-documentation/add-a-contact/)",
7
+ version: "0.0.2",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
13
+ type: "action",
14
+ props: {
15
+ octopush,
16
+ phone: {
17
+ type: "string",
18
+ label: "Phone Number",
19
+ description: "Phone number of the contact",
20
+ },
21
+ firstName: {
22
+ type: "string",
23
+ label: "First Name",
24
+ description: "First name of the contact",
25
+ },
26
+ lastName: {
27
+ type: "string",
28
+ label: "Last Name",
29
+ description: "Last name of the contact",
30
+ },
31
+ listName: {
32
+ type: "string",
33
+ label: "List Name",
34
+ description: " Name of the list to which the contact should be added",
35
+ optional: true,
36
+ },
37
+ tag: {
38
+ type: "string",
39
+ label: "Tag Name",
40
+ description: "Name of the tag that will be attached to the contact",
41
+ optional: true,
42
+ },
43
+ },
44
+ async run({ $ }) {
45
+ const response = await this.octopush.createContact({
46
+ $,
47
+ data: {
48
+ list_name: this.listName,
49
+ contacts: [
50
+ {
51
+ phone_number: this.phone,
52
+ first_name: this.firstName,
53
+ last_name: this.lastName,
54
+ },
55
+ ],
56
+ tag_name: this.tag,
57
+ },
58
+ });
59
+ $.export("$summary", "Successfully created contact.");
60
+ return response;
61
+ },
62
+ };
@@ -0,0 +1,103 @@
1
+ import octopush from "../../octopush_sms.app.mjs";
2
+
3
+ export default {
4
+ key: "octopush_sms-send-new-sms",
5
+ name: "Send New SMS",
6
+ description: "Sends a new SMS using Octopush SMS. [See the documentation](https://dev.octopush.com/en/sms-gateway-api-documentation/send-sms/)",
7
+ version: "0.0.3",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
13
+ type: "action",
14
+ ai: "optimized",
15
+ props: {
16
+ octopush,
17
+ text: {
18
+ type: "string",
19
+ label: "Text",
20
+ description: "The message text (from 1 to 1224 characters).",
21
+ },
22
+ phone: {
23
+ type: "string",
24
+ label: "Phone Number",
25
+ description: "Phone number of the recipient",
26
+ },
27
+ firstName: {
28
+ type: "string",
29
+ label: "First Name",
30
+ description: "First name of the recipient",
31
+ },
32
+ lastName: {
33
+ type: "string",
34
+ label: "Last Name",
35
+ description: "Last name of the recipient",
36
+ },
37
+ type: {
38
+ type: "string",
39
+ label: "Type",
40
+ description: "Campaign Type",
41
+ options: [
42
+ "sms_premium",
43
+ "sms_low_cost",
44
+ ],
45
+ },
46
+ sender: {
47
+ type: "string",
48
+ label: "Sender",
49
+ description: "Sender of the message (if the user allows it), 3-11 alphanumeric characters (a-zA-Z0-9)",
50
+ optional: true,
51
+ },
52
+ sendAt: {
53
+ type: "string",
54
+ label: "Send At",
55
+ description: "When you want to send the sms campaign. Format: DateTime ISO8601 (for ex: “2018-10-03T07:42:39-07:00”)",
56
+ optional: true,
57
+ },
58
+ purpose: {
59
+ type: "string",
60
+ label: "Purpose",
61
+ description: "Campaign purpose",
62
+ options: [
63
+ "alert",
64
+ "wholesale",
65
+ ],
66
+ optional: true,
67
+ },
68
+ withReplies: {
69
+ type: "boolean",
70
+ label: "With Replies",
71
+ description: "Set to `true` to get back recipient replies",
72
+ optional: true,
73
+ },
74
+ simulationMode: {
75
+ type: "boolean",
76
+ label: "Simulation Mode",
77
+ description: "If this value is `true`, your request will be simulated, and you will receive a fake result",
78
+ optional: true,
79
+ },
80
+ },
81
+ async run({ $ }) {
82
+ const response = await this.octopush.sendSMS({
83
+ $,
84
+ data: {
85
+ text: this.text,
86
+ recipients: [
87
+ {
88
+ phone_number: this.phone,
89
+ first_name: this.firstName,
90
+ last_name: this.lastName,
91
+ },
92
+ ],
93
+ type: this.type,
94
+ send_at: this.sendAt,
95
+ purpose: this.purpose,
96
+ with_replies: this.withReplies,
97
+ simulation_mode: this.simulationMode,
98
+ },
99
+ });
100
+ $.export("$summary", "Successfully send new SMS.");
101
+ return response;
102
+ },
103
+ };
@@ -1,11 +1,44 @@
1
+ import { axios } from "@pipedream/platform";
2
+
1
3
  export default {
2
4
  type: "app",
3
5
  app: "octopush_sms",
4
6
  propDefinitions: {},
5
7
  methods: {
6
- // this.$auth contains connected account data
7
- authKeys() {
8
- console.log(Object.keys(this.$auth));
8
+ _baseUrl() {
9
+ return "https://api.octopush.com/v1/public";
10
+ },
11
+ _headers() {
12
+ return {
13
+ "Content-Type": "application/json",
14
+ "api-login": `${this.$auth.api_login}`,
15
+ "api-key": `${this.$auth.api_key}`,
16
+ };
17
+ },
18
+ _makeRequest({
19
+ $ = this,
20
+ path,
21
+ ...opts
22
+ }) {
23
+ return axios($, {
24
+ url: `${this._baseUrl()}${path}`,
25
+ headers: this._headers(),
26
+ ...opts,
27
+ });
28
+ },
29
+ createContact(opts = {}) {
30
+ return this._makeRequest({
31
+ method: "POST",
32
+ path: "/contact/create",
33
+ ...opts,
34
+ });
35
+ },
36
+ sendSMS(opts = {}) {
37
+ return this._makeRequest({
38
+ method: "POST",
39
+ path: "/sms-campaign/send",
40
+ ...opts,
41
+ });
9
42
  },
10
43
  },
11
- };
44
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/octopush_sms",
3
- "version": "0.0.1",
3
+ "version": "0.1.1",
4
4
  "description": "Pipedream Octopush SMS Components",
5
5
  "main": "octopush_sms.app.mjs",
6
6
  "keywords": [
@@ -11,5 +11,8 @@
11
11
  "author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
12
12
  "publishConfig": {
13
13
  "access": "public"
14
+ },
15
+ "dependencies": {
16
+ "@pipedream/platform": "^1.6.8"
14
17
  }
15
18
  }