-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[Components] mumble #17305 #17550
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
[Components] mumble #17305 #17550
Changes from 2 commits
Commits
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
84 changes: 84 additions & 0 deletions
84
components/mumble/actions/add-new-customer/add-new-customer.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,84 @@ | ||
| import app from "../../mumble.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "mumble-add-new-customer", | ||
| name: "Add New Customer", | ||
| description: "Adds a new customer. [See the documentation](https://app.mumble.co.il/mumbleapi/docs)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| customerPhone: { | ||
| propDefinition: [ | ||
| app, | ||
| "customerPhone", | ||
| ], | ||
| }, | ||
| name: { | ||
| propDefinition: [ | ||
| app, | ||
| "name", | ||
| ], | ||
| }, | ||
| email: { | ||
| propDefinition: [ | ||
| app, | ||
| "email", | ||
| ], | ||
| }, | ||
| source: { | ||
| propDefinition: [ | ||
| app, | ||
| "source", | ||
| ], | ||
| }, | ||
| utmSource: { | ||
| propDefinition: [ | ||
| app, | ||
| "utmSource", | ||
| ], | ||
| }, | ||
| utmMedium: { | ||
| propDefinition: [ | ||
| app, | ||
| "utmMedium", | ||
| ], | ||
| }, | ||
| utmCampaign: { | ||
| propDefinition: [ | ||
| app, | ||
| "utmCampaign", | ||
| ], | ||
| }, | ||
| gclid: { | ||
| propDefinition: [ | ||
| app, | ||
| "gclid", | ||
| ], | ||
| }, | ||
| currentUrl: { | ||
| propDefinition: [ | ||
| app, | ||
| "currentUrl", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.addNewCustomer({ | ||
| $, | ||
| data: { | ||
| customer_phone: this.customerPhone, | ||
| name: this.name, | ||
| email: this.email, | ||
| source: this.source, | ||
| utm_source: this.utmSource, | ||
| utm_medium: this.utmMedium, | ||
| utm_campaign: this.utmCampaign, | ||
| gclid: this.gclid, | ||
| current_url: this.currentUrl, | ||
| }, | ||
| }); | ||
| $.export("$summary", "Successfully sent the request to add a new customer: " + response.message); | ||
| return response; | ||
| }, | ||
| }; |
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,28 @@ | ||
| import app from "../../mumble.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "mumble-add-new-label", | ||
| name: "Add New Label", | ||
| description: "Adds a new label. [See the documentation](https://app.mumble.co.il/mumbleapi/docs)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| labelName: { | ||
| propDefinition: [ | ||
| app, | ||
| "labelName", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.addNewLabel({ | ||
| $, | ||
| data: { | ||
| label_name: this.labelName, | ||
| }, | ||
| }); | ||
| $.export("$summary", "Successfully sent the request to add a new label: " + response.message); | ||
| return response; | ||
| }, | ||
| }; |
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,28 @@ | ||
| import app from "../../mumble.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "mumble-delete-label", | ||
| name: "Delete Label", | ||
| description: "Deletes a label. [See the documentation](https://app.mumble.co.il/mumbleapi/docs)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| labelNameList: { | ||
| propDefinition: [ | ||
| app, | ||
| "labelNameList", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.deleteLabel({ | ||
| $, | ||
| data: { | ||
| label_name: this.labelNameList, | ||
| }, | ||
| }); | ||
| $.export("$summary", "Successfully sent the request do delete a label: " + response.message); | ||
| return response; | ||
| }, | ||
| }; | ||
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,84 @@ | ||
| import app from "../../mumble.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "mumble-edit-customer", | ||
| name: "Edit Customer", | ||
| description: "Edits the customer with the specified phone number. [See the documentation](https://app.mumble.co.il/mumbleapi/docs)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| customerPhone: { | ||
| propDefinition: [ | ||
| app, | ||
| "customerPhone", | ||
| ], | ||
| }, | ||
| name: { | ||
| propDefinition: [ | ||
| app, | ||
| "name", | ||
| ], | ||
| }, | ||
| email: { | ||
| propDefinition: [ | ||
| app, | ||
| "email", | ||
| ], | ||
| }, | ||
| source: { | ||
| propDefinition: [ | ||
| app, | ||
| "source", | ||
| ], | ||
| }, | ||
| utmSource: { | ||
| propDefinition: [ | ||
| app, | ||
| "utmSource", | ||
| ], | ||
| }, | ||
| utmMedium: { | ||
| propDefinition: [ | ||
| app, | ||
| "utmMedium", | ||
| ], | ||
| }, | ||
| utmCampaign: { | ||
| propDefinition: [ | ||
| app, | ||
| "utmCampaign", | ||
| ], | ||
| }, | ||
| gclid: { | ||
| propDefinition: [ | ||
| app, | ||
| "gclid", | ||
| ], | ||
| }, | ||
| currentUrl: { | ||
| propDefinition: [ | ||
| app, | ||
| "currentUrl", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.editCustomer({ | ||
| $, | ||
| data: { | ||
| customer_phone: this.customerPhone, | ||
| name: this.name, | ||
| email: this.email, | ||
| source: this.source, | ||
| utm_source: this.utmSource, | ||
| utm_medium: this.utmMedium, | ||
| utm_campaign: this.utmCampaign, | ||
| gclid: this.gclid, | ||
| current_url: this.currentUrl, | ||
| }, | ||
| }); | ||
| $.export("$summary", "Successfully sent the request to edit a customer: " + response.message); | ||
| return response; | ||
| }, | ||
| }; |
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,11 +1,134 @@ | ||
| import { axios } from "@pipedream/platform"; | ||
|
|
||
| export default { | ||
| type: "app", | ||
| app: "mumble", | ||
| propDefinitions: {}, | ||
| propDefinitions: { | ||
| labelName: { | ||
| type: "string", | ||
| label: "Label Name", | ||
| description: "Name of the label", | ||
| }, | ||
| customerPhone: { | ||
| type: "string", | ||
| label: "Customer Phone", | ||
| description: "Phone number of the customer", | ||
| }, | ||
| name: { | ||
| type: "string", | ||
| label: "Name", | ||
| description: "Name of the customer", | ||
| optional: true, | ||
| }, | ||
| email: { | ||
| type: "string", | ||
| label: "Email", | ||
| description: "Email address", | ||
| optional: true, | ||
| }, | ||
| source: { | ||
| type: "string", | ||
| label: "Source", | ||
| description: "Source identifier", | ||
| optional: true, | ||
| }, | ||
| utmSource: { | ||
| type: "string", | ||
| label: "UTM Source", | ||
| description: "UTM source value", | ||
| optional: true, | ||
| }, | ||
| utmMedium: { | ||
| type: "string", | ||
| label: "UTM Medium", | ||
| description: "UTM medium value", | ||
| optional: true, | ||
| }, | ||
| utmCampaign: { | ||
| type: "string", | ||
| label: "UTM Campaign", | ||
| description: "UTM campaign value", | ||
| optional: true, | ||
| }, | ||
| gclid: { | ||
| type: "string", | ||
| label: "GCLID", | ||
| description: "Google Ads click ID", | ||
| optional: true, | ||
| }, | ||
| currentUrl: { | ||
| type: "string", | ||
| label: "Current URL", | ||
| description: "Current URL", | ||
| optional: true, | ||
| }, | ||
| labelNameList: { | ||
| type: "string", | ||
| label: "Label Name", | ||
| description: "Name of the label", | ||
| async options() { | ||
| const response = await this.getLabels(); | ||
| const labelsArray = response.labels; | ||
| return labelsArray.map((label) => ({ | ||
| value: label, | ||
| label: label, | ||
| })); | ||
| }, | ||
| }, | ||
| }, | ||
| methods: { | ||
| // this.$auth contains connected account data | ||
| authKeys() { | ||
| console.log(Object.keys(this.$auth)); | ||
| _baseUrl() { | ||
| return "https://app.mumble.co.il/mumbleapi"; | ||
| }, | ||
| async _makeRequest(opts = {}) { | ||
| const { | ||
| $ = this, | ||
| path, | ||
| headers, | ||
| ...otherOpts | ||
| } = opts; | ||
| return axios($, { | ||
| ...otherOpts, | ||
| url: this._baseUrl() + path, | ||
| headers: { | ||
| "mumble-api-key": `${this.$auth.api_key}`, | ||
| ...headers, | ||
| }, | ||
| }); | ||
| }, | ||
| async addNewLabel(args = {}) { | ||
| return this._makeRequest({ | ||
| path: "/add-new-label", | ||
| method: "post", | ||
| ...args, | ||
| }); | ||
| }, | ||
| async deleteLabel(args = {}) { | ||
| return this._makeRequest({ | ||
| path: "/delete-label", | ||
| method: "delete", | ||
| ...args, | ||
| }); | ||
| }, | ||
| async addNewCustomer(args = {}) { | ||
| return this._makeRequest({ | ||
| path: "/add-new-customer", | ||
| method: "post", | ||
| ...args, | ||
| }); | ||
| }, | ||
| async editCustomer(args = {}) { | ||
| return this._makeRequest({ | ||
| path: "/edit-customer", | ||
| method: "post", | ||
| ...args, | ||
| }); | ||
| }, | ||
| async getLabels(args = {}) { | ||
| return this._makeRequest({ | ||
| path: "/get-labels", | ||
| ...args, | ||
| }); | ||
| }, | ||
| }, | ||
| }; | ||
| }; |
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,6 +1,6 @@ | ||
| { | ||
| "name": "@pipedream/mumble", | ||
| "version": "0.0.1", | ||
| "version": "0.1.0", | ||
| "description": "Pipedream Mumble Components", | ||
| "main": "mumble.app.mjs", | ||
| "keywords": [ | ||
|
|
@@ -11,5 +11,8 @@ | |
| "author": "Pipedream <[email protected]> (https://pipedream.com/)", | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "dependencies": { | ||
| "@pipedream/platform": "^3.1.0" | ||
| } | ||
| } | ||
| } | ||
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.