Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions components/repliq/actions/get-credits-count/get-credits-count.mjs
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 components/repliq/actions/launch-template/launch-template.mjs
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;
},
};
109 changes: 109 additions & 0 deletions components/repliq/common/props.mjs
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,
},
};
8 changes: 6 additions & 2 deletions components/repliq/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/repliq",
"version": "0.0.1",
"version": "0.1.0",
"description": "Pipedream RepliQ Components",
"main": "repliq.app.mjs",
"keywords": [
Expand All @@ -11,5 +11,9 @@
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^2.0.0"
}
}
}

62 changes: 57 additions & 5 deletions components/repliq/repliq.app.mjs
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,
});
},
},
};
};
5 changes: 4 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.