-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New Components - slybroadcast #14661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
components/slybroadcast/actions/start-campaign-audio-file/start-campaign-audio-file.mjs
This file contains hidden or 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,42 @@ | ||
| import slybroadcast from "../../slybroadcast.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "slybroadcast-start-campaign-audio-file", | ||
| name: "Start Campaign with Audio File", | ||
| description: "Start a new voicemail campaign using an audio file uploaded to your slybroadcast account. [See the documentation](https://www.slybroadcast.com/documentation.php)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| slybroadcast, | ||
| audioFile: { | ||
| propDefinition: [ | ||
| slybroadcast, | ||
| "audioFile", | ||
| ], | ||
| }, | ||
| recipients: { | ||
| propDefinition: [ | ||
| slybroadcast, | ||
| "recipients", | ||
| ], | ||
| }, | ||
| date: { | ||
| propDefinition: [ | ||
| slybroadcast, | ||
| "date", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.slybroadcast.startCampaign({ | ||
| $, | ||
| data: { | ||
| c_record_audio: this.audioFile, | ||
| c_phone: this.recipients.join(), | ||
| c_date: this.date, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Started campaign with audio file ID: ${this.audioFile}`); | ||
| return response; | ||
| }, | ||
| }; | ||
52 changes: 52 additions & 0 deletions
52
components/slybroadcast/actions/start-campaign-audio-url/start-campaign-audio-url.mjs
This file contains hidden or 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,52 @@ | ||
| import slybroadcast from "../../slybroadcast.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "slybroadcast-start-campaign-audio-url", | ||
| name: "Start Campaign With Audio URL", | ||
| description: "Launch a new voicemail campaign to an individual or a group using an audio file url. [See the documentation](https://www.slybroadcast.com/documentation.php)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| slybroadcast, | ||
| audioFileUrl: { | ||
| type: "string", | ||
| label: "Audio File URL", | ||
| description: "The URL of the audio file for the voicemail campaign", | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| audioFileType: { | ||
| type: "string", | ||
| label: "Audio File Type", | ||
| description: "WAV, Mp3 or M4a", | ||
| options: [ | ||
| "WAV", | ||
| "Mp3", | ||
| "M4a", | ||
| ], | ||
| }, | ||
| recipients: { | ||
| propDefinition: [ | ||
| slybroadcast, | ||
| "recipients", | ||
| ], | ||
| }, | ||
| date: { | ||
| propDefinition: [ | ||
| slybroadcast, | ||
| "date", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.slybroadcast.startCampaign({ | ||
| $, | ||
| data: { | ||
| c_url: this.audioFileUrl, | ||
| c_audio: this.audioFileType, | ||
| c_phone: this.recipients.join(), | ||
| c_date: this.date, | ||
| }, | ||
| }); | ||
| $.export("$summary", "Campaign started successfully"); | ||
| return response; | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
| @@ -1,16 +1,18 @@ | ||
| { | ||
| "name": "@pipedream/slybroadcast", | ||
| "version": "0.0.2", | ||
| "version": "0.1.0", | ||
| "description": "Pipedream Slybroadcast Components", | ||
| "main": "dist/app/slybroadcast.app.mjs", | ||
| "main": "slybroadcast.app.mjs", | ||
| "keywords": [ | ||
| "pipedream", | ||
| "slybroadcast" | ||
| ], | ||
| "files": ["dist"], | ||
| "homepage": "https://pipedream.com/apps/slybroadcast", | ||
| "author": "Pipedream <support@pipedream.com> (https://pipedream.com/)", | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "dependencies": { | ||
| "@pipedream/platform": "^3.0.3" | ||
| } | ||
| } |
This file contains hidden or 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,70 @@ | ||
| import { axios } from "@pipedream/platform"; | ||
|
|
||
| export default { | ||
| type: "app", | ||
| app: "slybroadcast", | ||
| propDefinitions: { | ||
| audioFile: { | ||
| type: "string", | ||
| label: "Audio File", | ||
| description: "The audio file uploaded to your slybroadcast account", | ||
| async options() { | ||
| const files = await this.listAudioFiles(); | ||
| const filenames = [ | ||
| ...files.matchAll(/"\|"(.*?)"\|"/g), | ||
| ].map((match) => match[1]); | ||
| return filenames; | ||
| }, | ||
| }, | ||
| recipients: { | ||
| type: "string[]", | ||
| label: "Recipients", | ||
| description: "Array of recipients' phone numbers for the voicemail campaign", | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| date: { | ||
| type: "string", | ||
| label: "Date", | ||
| description: "Date/Time of delivery in Eastern Time. YYYY-MM-DD HH:MM:SS *Must use 24-hour time format. Example: 5:00pm = 17:00:00", | ||
| default: "now", | ||
| optional: true, | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| methods: { | ||
| _baseUrl() { | ||
| return "https://www.mobile-sphere.com/gateway/"; | ||
| }, | ||
| _makeRequest(opts = {}) { | ||
| const { | ||
| $ = this, method = "POST", path, data, ...otherOpts | ||
| } = opts; | ||
| return axios($, { | ||
| ...otherOpts, | ||
| method, | ||
| url: `${this._baseUrl()}${path}`, | ||
| data: { | ||
| ...data, | ||
| c_uid: `${this.$auth.email}`, | ||
| c_password: `${this.$auth.password}`, | ||
| }, | ||
| headers: { | ||
| "Content-Type": "application/x-www-form-urlencoded", | ||
| }, | ||
| }); | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| listAudioFiles(opts = {}) { | ||
| return this._makeRequest({ | ||
| path: "/vmb.aflist.php", | ||
| data: { | ||
| c_method: "get_audio_list", | ||
| }, | ||
| ...opts, | ||
| }); | ||
| }, | ||
| startCampaign(opts = {}) { | ||
| return this._makeRequest({ | ||
| path: "/vmb.php", | ||
| ...opts, | ||
| }); | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| }; | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.