Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import { ConfigurationError } from "@pipedream/platform";
import rendex from "../../rendex.app.mjs";

export default {

Check failure on line 4 in components/rendex/actions/create-render-link/create-render-link.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Action component is missing required 'annotations' object
key: "rendex-create-render-link",
name: "Create Render Link",
description: "Mint a signed, hosted render URL for a page or HTML — ideal for `og:image` tags. The returned URL serves the rendered image/PDF directly. [See the documentation](https://rendex.dev/docs/api-reference).",
version: "0.0.1",
type: "action",
props: {
rendex,
url: {
type: "string",
label: "URL",
description: "The page URL to render. Provide either `url` or `html`.",
optional: true,
},
html: {
propDefinition: [
rendex,
"html",
],
},
format: {
propDefinition: [
rendex,
"format",
],
},
width: {
propDefinition: [
rendex,
"width",
],
},
height: {
propDefinition: [
rendex,
"height",
],
},
fullPage: {
propDefinition: [
rendex,
"fullPage",
],
},
expiresIn: {
propDefinition: [
rendex,
"expiresIn",
],
},
},
async run({ $ }) {
const hasHtml = Boolean(this.html);
const hasUrl = Boolean(this.url);
if (hasHtml === hasUrl) {
throw new ConfigurationError("Provide exactly one of `html` or `url`.");
}

const response = await this.rendex.createRenderLink({
$,
data: {
url: hasUrl
? this.url
: undefined,
html: hasHtml
? this.html
: undefined,
format: this.format,
width: this.width,
height: this.height,
fullPage: this.fullPage,
expiresIn: this.expiresIn,
},
});

const data = response.data;
$.export("$summary", `Created render link (expires ${data?.expiresAt})`);
return data;
},
};
Comment thread
coderabbitai[bot] marked this conversation as resolved.
80 changes: 80 additions & 0 deletions components/rendex/actions/create-watch/create-watch.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import rendex from "../../rendex.app.mjs";

export default {

Check failure on line 3 in components/rendex/actions/create-watch/create-watch.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Action component is missing required 'annotations' object
key: "rendex-create-watch",
name: "Create Watch",
description: "Create a watch that monitors a page for visual or text changes. [See the documentation](https://rendex.dev/docs/watch).",
version: "0.0.1",
type: "action",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
props: {
rendex,
url: {
type: "string",
label: "URL",
description: "The page URL to monitor for changes.",
},
name: {
propDefinition: [
rendex,
"name",
],
},
intervalMinutes: {
propDefinition: [
rendex,
"intervalMinutes",
],
},
diffMode: {
propDefinition: [
rendex,
"diffMode",
],
},
threshold: {
propDefinition: [
rendex,
"threshold",
],
},
webhookUrl: {
propDefinition: [
rendex,
"webhookUrl",
],
},
notifyEmail: {
propDefinition: [
rendex,
"notifyEmail",
],
},
paused: {
propDefinition: [
rendex,
"paused",
],
},
},
async run({ $ }) {
const response = await this.rendex.createWatch({
$,
data: {
url: this.url,
name: this.name,
intervalMinutes: this.intervalMinutes,
diffMode: this.diffMode,
threshold: this.threshold !== undefined
? Number(this.threshold)
: undefined,
webhookUrl: this.webhookUrl,
notifyEmail: this.notifyEmail,
paused: this.paused,
},
});

const watch = response.data;
$.export("$summary", `Created watch ${watch?.id}`);
return watch;
},
};
29 changes: 29 additions & 0 deletions components/rendex/actions/delete-watch/delete-watch.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import rendex from "../../rendex.app.mjs";

export default {

Check failure on line 3 in components/rendex/actions/delete-watch/delete-watch.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Action component is missing required 'annotations' object
key: "rendex-delete-watch",
name: "Delete Watch",
description: "Delete a watch and its run history. [See the documentation](https://rendex.dev/docs/watch).",
version: "0.0.1",
type: "action",
props: {
rendex,
watchId: {
propDefinition: [
rendex,
"watchId",
],
},
},
async run({ $ }) {
await this.rendex.deleteWatch(this.watchId, {
$,
});

$.export("$summary", `Deleted watch ${this.watchId}`);
return {
success: true,
watchId: this.watchId,
};
},
};
Comment thread
coderabbitai[bot] marked this conversation as resolved.
52 changes: 52 additions & 0 deletions components/rendex/actions/extract-content/extract-content.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import rendex from "../../rendex.app.mjs";

export default {

Check failure on line 3 in components/rendex/actions/extract-content/extract-content.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Action component is missing required 'annotations' object
key: "rendex-extract-content",
name: "Extract Content",
description: "Extract the readable content of a page as Markdown, JSON, or HTML. [See the documentation](https://rendex.dev/docs/api-reference).",
version: "0.0.1",
type: "action",
props: {
rendex,
url: {
type: "string",
label: "URL",
description: "The page URL to extract content from.",
},
extractFormat: {
propDefinition: [
rendex,
"extractFormat",
],
},
waitForSelector: {
type: "string",
label: "Wait For Selector",
description: "Wait until this CSS selector is present before extracting.",
optional: true,
},
timeout: {
type: "integer",
label: "Timeout (seconds)",
description: "Maximum time to wait for the page to load (5–60).",
optional: true,
min: 5,
max: 60,
},
},
async run({ $ }) {
const response = await this.rendex.extract({
$,
data: {
url: this.url,
extractFormat: this.extractFormat,
waitForSelector: this.waitForSelector,
timeout: this.timeout,
},
});

const data = response.data;
$.export("$summary", `Extracted content from ${this.url}`);
return data;
},
};
Comment thread
coderabbitai[bot] marked this conversation as resolved.
27 changes: 27 additions & 0 deletions components/rendex/actions/get-watch/get-watch.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import rendex from "../../rendex.app.mjs";

export default {

Check failure on line 3 in components/rendex/actions/get-watch/get-watch.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Action component is missing required 'annotations' object
key: "rendex-get-watch",
name: "Get Watch",
description: "Retrieve a single watch by its ID. [See the documentation](https://rendex.dev/docs/watch).",
version: "0.0.1",
type: "action",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
props: {
rendex,
watchId: {
propDefinition: [
rendex,
"watchId",
],
},
},
async run({ $ }) {
const response = await this.rendex.getWatch(this.watchId, {
$,
});

const watch = response.data;
$.export("$summary", `Retrieved watch ${this.watchId}`);
return watch;
},
};
43 changes: 43 additions & 0 deletions components/rendex/actions/list-watch-runs/list-watch-runs.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import rendex from "../../rendex.app.mjs";

export default {

Check failure on line 3 in components/rendex/actions/list-watch-runs/list-watch-runs.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Action component is missing required 'annotations' object
key: "rendex-list-watch-runs",
name: "List Watch Runs",
description: "List the run history for a watch (most recent first). [See the documentation](https://rendex.dev/docs/watch).",
version: "0.0.1",
type: "action",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
props: {
rendex,
watchId: {
propDefinition: [
rendex,
"watchId",
],
},
limit: {
propDefinition: [
rendex,
"limit",
],
},
cursor: {
propDefinition: [
rendex,
"cursor",
],
},
},
async run({ $ }) {
const response = await this.rendex.listRuns(this.watchId, {
$,
params: {
limit: this.limit,
cursor: this.cursor,
},
});

const data = response.data;
$.export("$summary", `Retrieved ${data?.items?.length ?? 0} run(s)`);
return data;
},
};
49 changes: 49 additions & 0 deletions components/rendex/actions/render-markdown/render-markdown.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { ConfigurationError } from "@pipedream/platform";
import rendex from "../../rendex.app.mjs";

export default {
key: "rendex-render-markdown",
name: "Render Markdown",
description: "Render a Markdown string to an image or PDF via Rendex — clean default typography, no CSS required. Returns base64-encoded data with metadata. [See the documentation](https://rendex.dev/docs/api-reference#post-screenshot-json).",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
props: {
rendex,
markdown: {
propDefinition: [
rendex,
"markdown",
],
},
format: {
propDefinition: [
rendex,
"format",
],
},
},
async run({ $ }) {
if (!this.markdown) {
throw new ConfigurationError("`markdown` is required.");
}

const data = {
markdown: this.markdown,
format: this.format || "png",
};

const response = await this.rendex.renderJson({
$,
data,
});

const result = response.data;
$.export("$summary", `Successfully rendered ${result?.format || "image"} from Markdown (${result?.bytesSize ?? "unknown"} bytes)`);
return result;
},
};
27 changes: 27 additions & 0 deletions components/rendex/actions/run-watch/run-watch.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import rendex from "../../rendex.app.mjs";

export default {

Check failure on line 3 in components/rendex/actions/run-watch/run-watch.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Action component is missing required 'annotations' object
key: "rendex-run-watch",
name: "Run Watch Now",
description: "Trigger an immediate check for a watch. The run is queued and its diff result is produced asynchronously — poll **List Watch Runs** for the completed run. [See the documentation](https://rendex.dev/docs/watch).",
version: "0.0.1",
type: "action",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
props: {
rendex,
watchId: {
propDefinition: [
rendex,
"watchId",
],
},
},
async run({ $ }) {
const response = await this.rendex.runWatch(this.watchId, {
$,
});

const result = response.data;
$.export("$summary", `Queued run ${result?.runId} for watch ${this.watchId}`);
return result;
},
};
Loading
Loading