-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New Components - repliq #12375
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
New Components - repliq #12375
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1f04c7a
repliq init
luancazarine 3caeb7e
[Components] repliq #12345
luancazarine 7317ad4
pnpm update
luancazarine 97334f2
change the way to get template types
luancazarine c629650
Update components/repliq/actions/launch-template/launch-template.mjs
luancazarine ad4f1e4
Update components/repliq/repliq.app.mjs
luancazarine ab47a16
Update components/repliq/common/props.mjs
luancazarine 938b235
eslint
michelle0927 dbf7fe0
Merge remote-tracking branch 'origin/master' into issue-12345
michelle0927 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
19 changes: 19 additions & 0 deletions
19
components/repliq/actions/get-credits-count/get-credits-count.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,19 @@ | ||
| import repliq from "../../repliq.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "repliq-get-credits-count", | ||
| name: "Get Credits Count", | ||
| description: "Retrieve the total number of credits left for the month. [See the documentation](https://developer.repliq.co/get/g1-credits-count)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| repliq, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.repliq.getCreditsCount({ | ||
| $, | ||
| }); | ||
| $.export("$summary", `Successfully retrieved credits count: ${response.creditsCount}`); | ||
| return response; | ||
| }, | ||
| }; |
57 changes: 57 additions & 0 deletions
57
components/repliq/actions/launch-template/launch-template.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,57 @@ | ||
| import { predefinedProps } from "../../common/props.mjs"; | ||
| import repliq from "../../repliq.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "repliq-launch-template", | ||
| name: "Launch Repliq Template", | ||
| description: "Launch a Repliq process by deploying the selected template. [See the documentation](https://developer.repliq.co/)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| repliq, | ||
| templateId: { | ||
| propDefinition: [ | ||
| repliq, | ||
| "templateId", | ||
| ], | ||
| reloadProps: true, | ||
| }, | ||
| }, | ||
| async additionalProps() { | ||
| let props = {}; | ||
| if (this.templateId) { | ||
| const templates = await this.repliq.listTemplates(); | ||
| const template = templates.find((item) => item.id === this.templateId); | ||
|
|
||
| props = { | ||
| ...predefinedProps[template.type], | ||
| email: { | ||
| type: "string", | ||
| label: "Email", | ||
| description: "The account email you want to send this result to.", | ||
| optional: true, | ||
| }, | ||
| webhook: { | ||
| type: "string", | ||
| label: "Webhook", | ||
| description: "Attach a webhook URL that will trigger when the process is ready for you to use. You cannot use multiple URLs.", | ||
| optional: true, | ||
| }, | ||
| }; | ||
| } | ||
| return props; | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| repliq, | ||
| ...data | ||
| } = this; | ||
|
|
||
| const response = await repliq.launchTemplate({ | ||
| $, | ||
| data, | ||
| }); | ||
| $.export("$summary", `Successfully launched template with ID ${this.templateId}`); | ||
| 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,109 @@ | ||
| const url = { | ||
| type: "string", | ||
| label: "URL", | ||
| description: "The url of the website you want to use.", | ||
| }; | ||
| const firstName = { | ||
| type: "string", | ||
| label: "First Name", | ||
| description: "The name of the person you create the process for.", | ||
| }; | ||
| const lastName = { | ||
| type: "string", | ||
| label: "Last Name", | ||
| description: "The last name of the person you create the process for.", | ||
| optional: true, | ||
| }; | ||
| const companyName = { | ||
| type: "string", | ||
| label: "Company Name", | ||
| description: "The name of the company you create the process for.", | ||
| }; | ||
| const jobTitle = { | ||
| type: "string", | ||
| label: "Job Title", | ||
| description: "The Job Title of the person you create the process for.", | ||
| optional: true, | ||
| }; | ||
| const icebreaker = { | ||
| type: "string", | ||
| label: "Icebreaker", | ||
| description: "Use an icebreaker as introduction for your process specific to the person you create the process for.", | ||
| optional: true, | ||
| }; | ||
| const yourCustomVariable = { | ||
| type: "string", | ||
| label: "Your Custom Variable", | ||
| description: "The yourCustomVariable you use for your process.", | ||
| optional: true, | ||
| }; | ||
|
|
||
| export const predefinedProps = { | ||
| ai_image: { | ||
| firstName, | ||
| lastName, | ||
| jobTitle, | ||
| companyName: { | ||
| ...companyName, | ||
| optional: true, | ||
| }, | ||
| yourCustomVariable, | ||
| }, | ||
| ai_avatar: { | ||
| url, | ||
| companyName: { | ||
| ...companyName, | ||
| optional: true, | ||
| }, | ||
| firstName: { | ||
| ...firstName, | ||
| optional: true, | ||
| }, | ||
| jobTitle, | ||
| icebreaker, | ||
| }, | ||
| gpt_image: { | ||
| companyName, | ||
| firstName: { | ||
| ...firstName, | ||
| optional: true, | ||
| }, | ||
| lastName, | ||
| jobTitle, | ||
| competion: { | ||
| type: "string", | ||
| label: "Competion", | ||
| description: "The competion of the company you create an image for.", | ||
| optional: true, | ||
| }, | ||
| yourCustomVariable, | ||
| }, | ||
| icebreaker: { | ||
| url, | ||
| firstName, | ||
| }, | ||
| text_to_video: { | ||
| firstName, | ||
| prospectImgUrl: { | ||
| type: "string", | ||
| label: "Prospect Img URL", | ||
| description: "The linkedin profile url of the person you want to reach out to.", | ||
| optional: true, | ||
| }, | ||
| lastName, | ||
| companyName: { | ||
| ...companyName, | ||
| optional: true, | ||
| }, | ||
| jobTitle, | ||
| icebreaker, | ||
| }, | ||
| video_scale: { | ||
| url, | ||
| firstName: { | ||
| ...firstName, | ||
| optional: true, | ||
| }, | ||
| lastName, | ||
| }, | ||
| }; | ||
luancazarine marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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
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,63 @@ | ||
| import { axios } from "@pipedream/platform"; | ||
|
|
||
| export default { | ||
| type: "app", | ||
| app: "repliq", | ||
| propDefinitions: {}, | ||
| propDefinitions: { | ||
| templateId: { | ||
| type: "string", | ||
| label: "Template ID", | ||
| description: "The ID of the template you want to deploy.", | ||
| async options() { | ||
| const templates = await this.listTemplates(); | ||
| if (templates.error) return []; | ||
|
|
||
| return templates.map(({ | ||
| id: value, name: label, | ||
| }) => ({ | ||
| label, | ||
| value, | ||
| })); | ||
| }, | ||
| }, | ||
| }, | ||
| methods: { | ||
| // this.$auth contains connected account data | ||
| authKeys() { | ||
| console.log(Object.keys(this.$auth)); | ||
| _baseUrl() { | ||
| return "https://api.repliq.co/v2"; | ||
| }, | ||
| _headers() { | ||
| return { | ||
| Authorization: `Bearer ${this.$auth.api_key}`, | ||
| }; | ||
| }, | ||
| _makeRequest({ | ||
| $ = this, | ||
| path, | ||
| ...opts | ||
| }) { | ||
| return axios($, { | ||
| url: this._baseUrl() + path, | ||
| headers: this._headers(), | ||
| ...opts, | ||
| }); | ||
| }, | ||
| getCreditsCount(opts = {}) { | ||
| return this._makeRequest({ | ||
| path: "/getCreditsCount", | ||
| ...opts, | ||
| }); | ||
| }, | ||
| listTemplates() { | ||
| return this._makeRequest({ | ||
| path: "/getTemplateList", | ||
| }); | ||
| }, | ||
| launchTemplate(opts = {}) { | ||
| return this._makeRequest({ | ||
| method: "POST", | ||
| path: "/launchTemplate", | ||
| ...opts, | ||
| }); | ||
| }, | ||
| }, | ||
| }; | ||
| }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.