n8n-nodes-surface 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Canada Site Ops
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
|
package/README.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
#
|
|
1
|
+
# n8n-nodes-surface
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Surface for n8n: **the link-safety layer between an AI agent and the open web.**
|
|
4
|
+
|
|
5
|
+
The **Surface Preflight** node checks a link before your workflow or AI agent opens it. It unwraps short links (t.co, bit.ly, lnkd.in, youtu.be), follows redirects and answers `fetch` or `skip`, without returning the page. It is usable as an AI Agent tool.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
In n8n: **Settings → Community Nodes → Install** → `n8n-nodes-surface`.
|
|
9
|
+
|
|
10
|
+
## Credentials
|
|
11
|
+
`Surface API` — API key is optional (free up to 1M requests/month). Base URL defaults to `https://nova-otter-delta-cloud.grok.me`.
|
|
12
|
+
|
|
13
|
+
## Output
|
|
14
|
+
`{ next: "fetch" | "skip", fetch, url, final_url, final_host, status, redirects, shortener, reason }`. On error it answers `skip`.
|
|
15
|
+
|
|
16
|
+
Also available: remote MCP server at `https://nova-otter-delta-cloud.grok.me/mcp` (tool `preflight_url`).
|
|
17
|
+
|
|
18
|
+
Homepage: https://otter-sand-wolf-spring.grok.me · MIT · Canada Site Ops
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SurfaceApi = void 0;
|
|
4
|
+
class SurfaceApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = "surfaceApi";
|
|
7
|
+
this.displayName = "Surface API";
|
|
8
|
+
this.documentationUrl = "https://otter-sand-wolf-spring.grok.me";
|
|
9
|
+
this.properties = [
|
|
10
|
+
{ displayName: "API Key (optional)", name: "apiKey", type: "string", typeOptions: { password: true }, default: "",
|
|
11
|
+
description: "Optional. Surface is free up to 1M requests a month without a key." },
|
|
12
|
+
{ displayName: "Base URL", name: "baseUrl", type: "string", default: "https://nova-otter-delta-cloud.grok.me" },
|
|
13
|
+
];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.SurfaceApi = SurfaceApi;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SurfacePreflight = void 0;
|
|
4
|
+
const DEFAULT_BASE_URL = "https://nova-otter-delta-cloud.grok.me";
|
|
5
|
+
class SurfacePreflight {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.description = {
|
|
8
|
+
displayName: "Surface Preflight",
|
|
9
|
+
name: "surfacePreflight",
|
|
10
|
+
icon: "file:surface.svg",
|
|
11
|
+
group: ["transform"],
|
|
12
|
+
version: 1,
|
|
13
|
+
subtitle: "={{$parameter[\"url\"]}}",
|
|
14
|
+
description: "Check a link before you open it: unwraps short links, follows redirects, answers fetch or skip without returning the page.",
|
|
15
|
+
defaults: { name: "Surface Preflight" },
|
|
16
|
+
inputs: ["main"],
|
|
17
|
+
outputs: ["main"],
|
|
18
|
+
usableAsTool: true,
|
|
19
|
+
credentials: [{ name: "surfaceApi", required: false }],
|
|
20
|
+
properties: [
|
|
21
|
+
{ displayName: "URL", name: "url", type: "string", default: "", required: true, placeholder: "https://t.co/abc123",
|
|
22
|
+
description: "The link to check before fetching it" },
|
|
23
|
+
{ displayName: "On Error Answer Skip", name: "skipOnError", type: "boolean", default: true,
|
|
24
|
+
description: "Whether to return next=skip instead of failing when Surface cannot be reached" },
|
|
25
|
+
],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
async execute() {
|
|
29
|
+
const items = this.getInputData();
|
|
30
|
+
const out = [];
|
|
31
|
+
let creds = {};
|
|
32
|
+
try { creds = (await this.getCredentials("surfaceApi")) || {}; } catch (e) { creds = {}; }
|
|
33
|
+
const base = String(creds.baseUrl || DEFAULT_BASE_URL).replace(/\/$/, "");
|
|
34
|
+
for (let i = 0; i < items.length; i++) {
|
|
35
|
+
const url = this.getNodeParameter("url", i);
|
|
36
|
+
const skipOnError = this.getNodeParameter("skipOnError", i, true);
|
|
37
|
+
try {
|
|
38
|
+
const headers = { "content-type": "application/json", accept: "application/json", "user-agent": "n8n-nodes-surface/0.1.0" };
|
|
39
|
+
if (creds.apiKey) headers.authorization = "Bearer " + creds.apiKey;
|
|
40
|
+
if (process.env.SURFACE_INTERNAL === "1") headers["X-Surface-Internal"] = "1";
|
|
41
|
+
const d = await this.helpers.httpRequest({ method: "POST", url: base + "/v1/preflight", headers, body: { url }, json: true, timeout: 15000 });
|
|
42
|
+
const next = d.next || d.verdict;
|
|
43
|
+
out.push({ json: { next, fetch: next === "fetch", url: d.url || url, final_url: d.final_url, final_host: d.final_host,
|
|
44
|
+
status: d.status, redirects: d.redirects, shortener: d.shortener, reason: d.reason }, pairedItem: { item: i } });
|
|
45
|
+
} catch (e) {
|
|
46
|
+
if (!skipOnError && !this.continueOnFail()) throw e;
|
|
47
|
+
out.push({ json: { next: "skip", fetch: false, url, error: String((e && e.message) || e) }, pairedItem: { item: i } });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return [out];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.SurfacePreflight = SurfacePreflight;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" rx="12" fill="#0f766e"/><path d="M20 34l8 8 16-20" stroke="#fff" stroke-width="6" fill="none" stroke-linecap="round"/></svg>
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-surface",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
}
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Surface for n8n: the link-safety layer between an AI agent and the open web. Surface Preflight unwraps short links, follows redirects and answers fetch or skip, without returning the page.",
|
|
5
|
+
"keywords": ["n8n-community-node-package", "n8n", "surface", "link-safety", "url", "preflight", "ai-agents", "redirect", "short-links"],
|
|
6
|
+
"author": { "name": "Canada Site Ops", "email": "canada.site.ops@gmail.com" },
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"homepage": "https://otter-sand-wolf-spring.grok.me",
|
|
9
|
+
"main": "index.js",
|
|
10
|
+
"files": ["index.js", "dist", "README.md", "LICENSE"],
|
|
11
|
+
"n8n": {
|
|
12
|
+
"n8nNodesApiVersion": 1,
|
|
13
|
+
"credentials": ["dist/credentials/SurfaceApi.credentials.js"],
|
|
14
|
+
"nodes": ["dist/nodes/SurfacePreflight/SurfacePreflight.node.js"]
|
|
15
|
+
},
|
|
16
|
+
"peerDependencies": { "n8n-workflow": "*" },
|
|
17
|
+
"engines": { "node": ">=18" },
|
|
18
|
+
"publishConfig": { "access": "public" }
|
|
19
|
+
}
|