n8n-nodes-socialfetch 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.
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cursorPagination = cursorPagination;
4
+ function nextCursorFrom(items) {
5
+ const last = items[items.length - 1];
6
+ const page = last?.json?.data?.page;
7
+ if (page?.hasMore === true &&
8
+ typeof page.nextCursor === "string" &&
9
+ page.nextCursor.length > 0) {
10
+ return page.nextCursor;
11
+ }
12
+ return undefined;
13
+ }
14
+ /**
15
+ * Cursor paginator for SocialFetch list endpoints.
16
+ *
17
+ * Gated by the `returnAll` parameter via `routing.send.paginate`: when
18
+ * `returnAll` is false n8n performs a single request and this returns only the
19
+ * first page. When true, it follows `data.page.nextCursor` until `hasMore` is
20
+ * false, accumulating one item per page.
21
+ */
22
+ async function cursorPagination(requestOptions) {
23
+ const aggregate = [];
24
+ let responseData = await this.makeRoutingRequest(requestOptions);
25
+ aggregate.push(...responseData);
26
+ let cursor = nextCursorFrom(responseData);
27
+ while (cursor !== undefined) {
28
+ requestOptions.options.qs = {
29
+ ...(requestOptions.options.qs ?? {}),
30
+ cursor,
31
+ };
32
+ responseData = await this.makeRoutingRequest(requestOptions);
33
+ aggregate.push(...responseData);
34
+ cursor = nextCursorFrom(responseData);
35
+ }
36
+ return aggregate;
37
+ }
@@ -0,0 +1,29 @@
1
+ <svg
2
+ width="48"
3
+ height="48"
4
+ viewBox="0 0 48 48"
5
+ fill="none"
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ >
8
+ <rect width="48" height="48" fill="#AAF7ED" />
9
+ <g clip-path="url(#clip0_200_7)">
10
+ <path
11
+ d="M25.5245 32.8171H19.6903V38.6513H25.5245L31.3586 32.8171L37.1928 26.983L40.1099 24.0659L37.1928 21.1488L31.3586 15.3146L25.5245 9.48047H19.6903V15.3146H25.5245V21.1488H31.3586V26.983H25.5245V32.8171Z"
12
+ fill="#232023"
13
+ />
14
+ <path
15
+ d="M19.6903 32.8171V26.983H25.5245V21.1488H19.6903V15.3146H13.8561V21.1488V26.983V32.8171H19.6903Z"
16
+ fill="#232023"
17
+ />
18
+ </g>
19
+ <defs>
20
+ <clipPath id="clip0_200_7">
21
+ <rect
22
+ width="32.0879"
23
+ height="32.0879"
24
+ fill="white"
25
+ transform="translate(8.02197 8.02197)"
26
+ />
27
+ </clipPath>
28
+ </defs>
29
+ </svg>
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "n8n-nodes-socialfetch",
3
+ "version": "0.1.0",
4
+ "description": "Fetch social media and web data with the SocialFetch API.",
5
+ "keywords": [
6
+ "n8n-community-node-package",
7
+ "socialfetch",
8
+ "social-media",
9
+ "tiktok",
10
+ "instagram",
11
+ "youtube",
12
+ "twitter"
13
+ ],
14
+ "license": "MIT",
15
+ "homepage": "https://www.socialfetch.dev",
16
+ "author": {
17
+ "name": "Social Fetch"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/social-freak-ltd/n8n-nodes-socialfetch.git"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "packageManager": "pnpm@10.33.0",
27
+ "engines": {
28
+ "node": ">=22"
29
+ },
30
+ "main": "dist/index.js",
31
+ "scripts": {
32
+ "build": "n8n-node build",
33
+ "dev": "n8n-node dev",
34
+ "lint": "n8n-node lint",
35
+ "lint:fix": "n8n-node lint --fix",
36
+ "release": "n8n-node release",
37
+ "prepublishOnly": "n8n-node prerelease"
38
+ },
39
+ "files": [
40
+ "dist"
41
+ ],
42
+ "n8n": {
43
+ "n8nNodesApiVersion": 1,
44
+ "credentials": [
45
+ "dist/credentials/SocialFetchApi.credentials.js"
46
+ ],
47
+ "nodes": [
48
+ "dist/nodes/SocialFetch/SocialFetch.node.js"
49
+ ]
50
+ },
51
+ "devDependencies": {
52
+ "@n8n/node-cli": "0.32.1",
53
+ "eslint": "9.39.4",
54
+ "n8n-workflow": "2.16.0",
55
+ "prettier": "3.8.3",
56
+ "typescript": "5.9.3"
57
+ },
58
+ "peerDependencies": {
59
+ "n8n-workflow": "*"
60
+ }
61
+ }