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
3 changes: 0 additions & 3 deletions components/getscreenshot/.gitignore

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import rasterwise from "../../getscreenshot.app.mjs";

export default {
key: "getscreenshot-get-account-api-usage",
name: "Get Account API Usage",
description:
"Retrieve your current API usage and available quota. [See the documentation](https://docs.rasterwise.com/docs/getscreenshot/api-reference-1/)",
version: "0.0.1",
type: "action",
props: {
rasterwise,
email: {
type: "string",
label: "Email Address",
description: "The email address of this account.",
},
},
async run({ $ }) {
const {
rasterwise, ...params
} = this;
const response = await rasterwise.getApiUsage({
$,
params,
});
$.export("$summary", "Successfully retrieved API usage");
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import getscreenshot from "../../getscreenshot.app.mjs";

export default {
key: "getscreenshot-get-website-screenshot",
name: "Get Website Screenshot",
description: "Capture a screenshot from a live website. [See the documentation](https://docs.rasterwise.com/docs/getscreenshot/api-reference-0/)",
version: "0.0.1",
type: "action",
props: {
getscreenshot,
url: {
type: "string",
label: "Website URL",
description: "URL of the website / page you want to screenshot. Should start with `http://` or `https://`",
},
format: {
type: "string",
label: "Image Format",
description: "The file type/format in which you want to get your capture. If `pdf` is selected, an A4 PDF of the passed website will be generated, rendered the same as if you were printing it from your browser.",
options: [
"png",
"jpeg",
"pdf",
],
default: "png",
optional: true,
},
email: {
type: "string",
label: "Email Address",
description: "If specified, a formatted email will be sent to this email address, including the captured image and details of the capture.",
optional: true,
},
element: {
type: "string",
label: "Element",
description: "If you need to target specific DOM elements instead of taking dimension-based screenshots, you can specify an element DOM selector, e.g. `#colordiv` to target a div with the id \"colordiv\".",
optional: true,
},
additionalParams: {
type: "object",
label: "Additional Parameters",
description: "Additional parameters (key/value pairs) to send in this request. [See the documentation](https://docs.rasterwise.com/docs/getscreenshot/api-reference-0/) for all available parameters.",
optional: true,
},
},
async run({ $ }) {
const {
getscreenshot, format, additionalParams, ...params
} = this;
const response = await getscreenshot.getScreenshot({
$,
params: {
...params,
...(format === "pdf"
? {
pdf: true,
}
: {
format,
}),
...additionalParams,
},
});
$.export("$summary", `Successfully captured screenshot of "${this.url}"`);
return response;
},
};
13 changes: 0 additions & 13 deletions components/getscreenshot/app/getscreenshot.app.ts

This file was deleted.

36 changes: 36 additions & 0 deletions components/getscreenshot/getscreenshot.app.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { axios } from "@pipedream/platform";

export default {
type: "app",
app: "getscreenshot",
propDefinitions: {},
methods: {
_baseUrl() {
return "https://api.rasterwise.com/v1";
},
async _makeRequest({
$, params, ...otherOpts
}) {
return axios($, {
...otherOpts,
baseURL: this._baseUrl(),
params: {
...params,
apikey: this.$auth.api_key,
},
});
},
async getScreenshot(args) {
return this._makeRequest({
url: "/get-screenshot",
...args,
});
},
async getApiUsage(args) {
return this._makeRequest({
url: "/usage",
...args,
});
},
},
};
10 changes: 5 additions & 5 deletions components/getscreenshot/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "@pipedream/getscreenshot",
"version": "0.0.3",
"version": "0.1.0",
"description": "Pipedream GetScreenshot Components",
"main": "dist/app/getscreenshot.app.mjs",
"main": "getscreenshot.app.mjs",
"keywords": [
"pipedream",
"getscreenshot"
],
"files": [
"dist"
],
"homepage": "https://pipedream.com/apps/getscreenshot",
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.0.3"
}
}
6 changes: 5 additions & 1 deletion pnpm-lock.yaml

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

Loading