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
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ updates:
groups:
types:
patterns:
- "@types/*"
- '@types/*'
minor-and-patch:
update-types:
- minor
Expand All @@ -23,4 +23,4 @@ updates:
groups:
github-actions:
patterns:
- "*"
- '*'
37 changes: 37 additions & 0 deletions .github/workflows/pr-prettier-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: PR Prettier Check

on:
pull_request:

permissions:
contents: read

jobs:
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
# Full history so origin/<base> exists for the merge-base diff below.
fetch-depth: 0
# Nothing after checkout needs git credentials; keep the token away
# from the npx-executed steps below.
persist-credentials: false

- uses: actions/setup-node@v6.4.0
with:
node-version: '24'

# Runs the exact Prettier version from package-lock.json — the same one
# devs get from `npm install` and the pre-commit hook uses — without
# paying for a full `npm ci`. Mirrors the pre-commit lint-staged
# semantics: changed files only, --ignore-unknown, .prettierignore
# respected.
- name: Check formatting of changed files
run: |
VERSION=$(node -p "require('./package-lock.json').packages['node_modules/prettier'].version")
# The lockfile is PR-controlled: accept only an exact semver so npx
# cannot be steered to a tag or range.
echo "$VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$' || { echo "Unexpected prettier version in package-lock.json: $VERSION"; exit 1; }
git diff -z --name-only --diff-filter=ACMRT "origin/${GITHUB_BASE_REF}...HEAD" \
| xargs -0 -r npx --yes "prettier@${VERSION}" --check --ignore-unknown --
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh

npx --no-install lint-staged
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# npm owns the lockfile format (2-space JSON); this repo's prettier config
# uses tabs, so checking it would fight every npm install.
package-lock.json
9 changes: 2 additions & 7 deletions nodes/Browserless/Browserless.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ const URL_OPERATIONS = [
];

// Browser-based operations that accept Puppeteer options (viewport, cookies, auth, waitFor, etc.)
const BROWSER_OPERATIONS = [
'smartScrape',
'screenshot',
'pdf',
];
const BROWSER_OPERATIONS = ['smartScrape', 'screenshot', 'pdf'];

export class Browserless implements INodeType {
description: INodeTypeDescription = {
Expand Down Expand Up @@ -126,8 +122,7 @@ export class Browserless implements INodeType {
{
name: 'Smart Scrape',
value: 'smartScrape',
description:
'Scrape a page with automatic fallbacks for blocked or JS-heavy sites',
description: 'Scrape a page with automatic fallbacks for blocked or JS-heavy sites',
action: 'Smart scrape a page',
},
],
Expand Down
12 changes: 2 additions & 10 deletions nodes/Browserless/operations/crawl/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,13 @@ export async function execute(
const webhook: Record<string, unknown> = {
url: additionalFields.webhookUrl,
};
if (
additionalFields.webhookEvents &&
(additionalFields.webhookEvents as string[]).length > 0
) {
if (additionalFields.webhookEvents && (additionalFields.webhookEvents as string[]).length > 0) {
webhook.events = additionalFields.webhookEvents;
}
body.webhook = webhook;
}

const response = (await browserlessApiRequest.call(
this,
'POST',
'/crawl',
body,
)) as IDataObject;
const response = (await browserlessApiRequest.call(this, 'POST', '/crawl', body)) as IDataObject;

return [{ json: response, pairedItem: { item: index } }];
}
3 changes: 1 addition & 2 deletions nodes/Browserless/operations/export/description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ export const exportFields: INodeProperties[] = [
name: 'includeResources',
type: 'boolean',
default: false,
description:
'Whether to bundle all page resources (CSS, images, etc.) into a ZIP file',
description: 'Whether to bundle all page resources (CSS, images, etc.) into a ZIP file',
},
{
displayName: 'Referer',
Expand Down
10 changes: 3 additions & 7 deletions nodes/Browserless/operations/function/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,9 @@ export async function execute(

const body = buildFunctionRequestBody(code, context);

const response = (await browserlessApiRequest.call(
this,
'POST',
'/function',
body,
{ contentType: 'application/javascript' },
)) as IDataObject;
const response = (await browserlessApiRequest.call(this, 'POST', '/function', body, {
contentType: 'application/javascript',
})) as IDataObject;

return [{ json: response, pairedItem: { item: index } }];
}
7 changes: 1 addition & 6 deletions nodes/Browserless/operations/map/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ export async function execute(
body.location = location;
}

const response = (await browserlessApiRequest.call(
this,
'POST',
'/map',
body,
)) as IDataObject;
const response = (await browserlessApiRequest.call(this, 'POST', '/map', body)) as IDataObject;

return [{ json: response, pairedItem: { item: index } }];
}
3 changes: 1 addition & 2 deletions nodes/Browserless/operations/pdf/description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ export const pdfFields: INodeProperties[] = [
name: 'preferCSSPageSize',
type: 'boolean',
default: false,
description:
'Whether to use the CSS-defined page size instead of the format option',
description: 'Whether to use the CSS-defined page size instead of the format option',
},
{
displayName: 'Print Background',
Expand Down
3 changes: 1 addition & 2 deletions nodes/Browserless/operations/screenshot/description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ export const screenshotFields: INodeProperties[] = [
name: 'omitBackground',
type: 'boolean',
default: false,
description:
'Whether to hide the default white background for transparent screenshots',
description: 'Whether to hide the default white background for transparent screenshots',
},
{
displayName: 'Optimize For Speed',
Expand Down
10 changes: 3 additions & 7 deletions nodes/Browserless/operations/screenshot/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,9 @@ export async function execute(
body.selector = additionalFields.selector;
}

const response = (await browserlessApiRequest.call(
this,
'POST',
'/chromium/screenshot',
body,
{ encoding: 'arraybuffer' },
)) as BinaryResponse;
const response = (await browserlessApiRequest.call(this, 'POST', '/chromium/screenshot', body, {
encoding: 'arraybuffer',
})) as BinaryResponse;

const mimeType = MIME_TYPES[imageType] || 'image/png';
const fileName = `screenshot.${imageType}`;
Expand Down
17 changes: 3 additions & 14 deletions nodes/Browserless/operations/search/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,11 @@ export async function execute(
if (additionalFields.tbs) body.tbs = additionalFields.tbs;
if (additionalFields.timeout) body.timeout = additionalFields.timeout;

if (
additionalFields.sources &&
(additionalFields.sources as string[]).length > 0
) {
if (additionalFields.sources && (additionalFields.sources as string[]).length > 0) {
body.sources = additionalFields.sources;
}

if (
additionalFields.categories &&
(additionalFields.categories as string[]).length > 0
) {
if (additionalFields.categories && (additionalFields.categories as string[]).length > 0) {
body.categories = additionalFields.categories;
}

Expand All @@ -56,12 +50,7 @@ export async function execute(
body.scrapeOptions = scrapeOptions;
}

const response = (await browserlessApiRequest.call(
this,
'POST',
'/search',
body,
)) as IDataObject;
const response = (await browserlessApiRequest.call(this, 'POST', '/search', body)) as IDataObject;

return [{ json: response, pairedItem: { item: index } }];
}
6 changes: 2 additions & 4 deletions nodes/Browserless/shared/descriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ export function getWaitOptions(operations: string[]): INodeProperties {
name: 'cookies',
type: 'json',
default: '[]',
placeholder:
'e.g. [{"name": "session", "value": "abc123", "domain": "example.com"}]',
placeholder: 'e.g. [{"name": "session", "value": "abc123", "domain": "example.com"}]',
description: 'Cookies to set on the page before navigation',
},
{
Expand Down Expand Up @@ -125,8 +124,7 @@ export function getWaitOptions(operations: string[]): INodeProperties {
type: 'string',
default: '',
placeholder: 'e.g. *.css,*.png,tracker.js',
description:
'Comma-separated URL patterns to block (supports wildcards)',
description: 'Comma-separated URL patterns to block (supports wildcards)',
},
{
displayName: 'Reject Resource Types',
Expand Down
Loading
Loading