-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[Components] local_reviews - new components #17179
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 1 commit
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
17 changes: 17 additions & 0 deletions
17
components/local_reviews/actions/get-survey-url/get-survey-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,17 @@ | ||
| import app from "../../local_reviews.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "local_reviews-get-survey-url", | ||
| name: "Get Survey URL", | ||
| description: "Retrieve the survey link associated with the connected license. [See the documentation](https://app.localreviews.com/review-tools/api-documentation).", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.getSurveyUrl(); | ||
| $.export("$summary", "Successfully retrieved survey URL."); | ||
| return response; | ||
| }, | ||
| }; | ||
45 changes: 45 additions & 0 deletions
45
...nts/local_reviews/actions/send-review-request-via-email/send-review-request-via-email.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,45 @@ | ||
| import app from "../../local_reviews.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "local_reviews-send-review-request-via-email", | ||
| name: "Send Review Request Via Email", | ||
| description: "Send a review invitation to a customer via email. [See the documentation](https://app.localreviews.com/review-tools/api-documentation).", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| email: { | ||
| type: "string", | ||
| label: "Email", | ||
| description: "The email address of the recipient.", | ||
| }, | ||
| subject: { | ||
| type: "string", | ||
| label: "Subject", | ||
| description: "The subject of the email.", | ||
| }, | ||
| message: { | ||
| type: "string", | ||
| label: "Message", | ||
| description: "The content of the email message.", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| app, | ||
| email, | ||
| subject, | ||
| message, | ||
| } = this; | ||
| const response = await app.sendReviewRequestViaEmail({ | ||
| $, | ||
| data: { | ||
| email, | ||
| subject, | ||
| message, | ||
| }, | ||
| }); | ||
| $.export("$summary", "Successfully sent review request email."); | ||
| return response; | ||
| }, | ||
| }; |
38 changes: 38 additions & 0 deletions
38
components/local_reviews/actions/send-review-request-via-sms/send-review-request-via-sms.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,38 @@ | ||
| import app from "../../local_reviews.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "local_reviews-send-review-request-via-sms", | ||
| name: "Send Review Request Via SMS", | ||
| description: "Send a review invitation to a customer via SMS. [See the documentation](https://app.localreviews.com/review-tools/api-documentation).", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| phone: { | ||
| type: "string", | ||
| label: "Phone Number", | ||
| description: "The phone number of the recipient.", | ||
| }, | ||
| message: { | ||
| type: "string", | ||
| label: "Message", | ||
| description: "The content of the SMS message.", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| app, | ||
| phone, | ||
| message, | ||
| } = this; | ||
| const response = await app.sendReviewRequestViaSms({ | ||
| $, | ||
| data: { | ||
| phone, | ||
| message, | ||
| }, | ||
| }); | ||
| $.export("$summary", "Successfully sent review request SMS."); | ||
| 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,50 @@ | ||
| import { axios } from "@pipedream/platform"; | ||
|
|
||
| export default { | ||
| type: "app", | ||
| app: "local_reviews", | ||
| propDefinitions: {}, | ||
| methods: { | ||
| // this.$auth contains connected account data | ||
| authKeys() { | ||
| console.log(Object.keys(this.$auth)); | ||
| _getBaseUrl(path) { | ||
| return `https://api.localreviews.com/api/v2${path}`; | ||
| }, | ||
| _getHeaders() { | ||
| return { | ||
| Authorization: `Bearer ${this.$auth.oauth_access_token}`, | ||
| }; | ||
| }, | ||
| _makeRequest({ | ||
| $ = this, path, ...args | ||
| } = {}) { | ||
| return axios($, { | ||
| url: this._getBaseUrl(path), | ||
| headers: this._getHeaders(), | ||
| ...args, | ||
| }); | ||
| }, | ||
| post(args = {}) { | ||
| return this._makeRequest({ | ||
| method: "POST", | ||
| ...args, | ||
| }); | ||
| }, | ||
| sendReviewRequestViaEmail(args = {}) { | ||
| return this.post({ | ||
| path: "/oauth/oauth-request/send-email", | ||
| ...args, | ||
| }); | ||
| }, | ||
| sendReviewRequestViaSms(args = {}) { | ||
| return this.post({ | ||
| path: "/oauth/oauth-request/send-text", | ||
| ...args, | ||
| }); | ||
| }, | ||
| getSurveyUrl(args = {}) { | ||
| return this._makeRequest({ | ||
| path: "/oauth/oauth-request/get-survey-url", | ||
| ...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/local_reviews", | ||
| "version": "0.0.1", | ||
| "version": "0.1.0", | ||
| "description": "Pipedream Local Reviews Components", | ||
| "main": "local_reviews.app.mjs", | ||
| "keywords": [ | ||
|
|
@@ -11,5 +11,8 @@ | |
| "author": "Pipedream <[email protected]> (https://pipedream.com/)", | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "dependencies": { | ||
| "@pipedream/platform": "^3.1.0" | ||
| } | ||
| } | ||
| } | ||
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.