n8n-nodes-smbclient 1.0.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.
Files changed (38) hide show
  1. package/.editorconfig +20 -0
  2. package/.github/workflows/npm-publish.yml +32 -0
  3. package/.github/workflows/one-shot-npm-publish.yml +30 -0
  4. package/.prettierrc.js +51 -0
  5. package/LICENSE.md +19 -0
  6. package/Readme.md +131 -0
  7. package/credentials/Smb2Api.credentials.ts +72 -0
  8. package/credentials/smb2.svg +36 -0
  9. package/dist/credentials/Smb2Api.credentials.d.ts +7 -0
  10. package/dist/credentials/Smb2Api.credentials.js +72 -0
  11. package/dist/credentials/Smb2Api.credentials.js.map +1 -0
  12. package/dist/credentials/smb2.svg +36 -0
  13. package/dist/nodes/Smb2/Smb2.node.d.ts +5 -0
  14. package/dist/nodes/Smb2/Smb2.node.js +174 -0
  15. package/dist/nodes/Smb2/Smb2.node.js.map +1 -0
  16. package/dist/nodes/Smb2/Smb2.node.json +19 -0
  17. package/dist/nodes/Smb2/SmbClientWrapper.d.ts +22 -0
  18. package/dist/nodes/Smb2/SmbClientWrapper.js +231 -0
  19. package/dist/nodes/Smb2/SmbClientWrapper.js.map +1 -0
  20. package/dist/nodes/Smb2/SmbEntryHelpers.d.ts +6 -0
  21. package/dist/nodes/Smb2/SmbEntryHelpers.js +102 -0
  22. package/dist/nodes/Smb2/SmbEntryHelpers.js.map +1 -0
  23. package/dist/nodes/Smb2/interfaces.d.ts +31 -0
  24. package/dist/nodes/Smb2/interfaces.js +3 -0
  25. package/dist/nodes/Smb2/interfaces.js.map +1 -0
  26. package/dist/nodes/Smb2/smb2.svg +36 -0
  27. package/dist/package.json +67 -0
  28. package/eslint.config.mjs +174 -0
  29. package/gulpfile.js +16 -0
  30. package/index.js +0 -0
  31. package/nodes/Smb2/Smb2.node.json +19 -0
  32. package/nodes/Smb2/Smb2.node.ts +184 -0
  33. package/nodes/Smb2/SmbClientWrapper.ts +285 -0
  34. package/nodes/Smb2/SmbEntryHelpers.ts +129 -0
  35. package/nodes/Smb2/interfaces.ts +39 -0
  36. package/nodes/Smb2/smb2.svg +36 -0
  37. package/package.json +67 -0
  38. package/tsconfig.json +30 -0
@@ -0,0 +1,36 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg id="Calque_1" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 512 512">
3
+ <!-- Generator: Adobe Illustrator 29.5.1, SVG Export Plug-In . SVG Version: 2.1.0 Build 141) -->
4
+ <defs>
5
+ <style>
6
+ .st0 {
7
+ fill: url(#Dégradé_sans_nom1);
8
+ }
9
+
10
+ .st1 {
11
+ fill: url(#Dégradé_sans_nom2);
12
+ }
13
+
14
+ .st2 {
15
+ fill: url(#Dégradé_sans_nom);
16
+ }
17
+
18
+ .st3 {
19
+ fill: url(#Dégradé_sans_nom3);
20
+ }
21
+ </style>
22
+ <linearGradient id="Dégradé_sans_nom" data-name="Dégradé sans nom" x1="-1301.41" y1="140.82" x2="-1300.41" y2="141.82" gradientTransform="translate(174550 -18839.5) scale(134)" gradientUnits="userSpaceOnUse">
23
+ <stop offset="0" stop-color="#4c9ded"/>
24
+ <stop offset="1" stop-color="#3178b5"/>
25
+ </linearGradient>
26
+ <linearGradient id="Dégradé_sans_nom1" data-name="Dégradé sans nom" x1="-1305.78" y1="138.8" x2="-1304.78" y2="139.8" gradientTransform="translate(418568.08 -11797.5) scale(320.43 87)" xlink:href="#Dégradé_sans_nom"/>
27
+ <linearGradient id="Dégradé_sans_nom2" data-name="Dégradé sans nom" x1="214.73" y1="-57.27" x2="452.27" y2="180.27" gradientTransform="translate(0 514) scale(1 -1)" xlink:href="#Dégradé_sans_nom"/>
28
+ <linearGradient id="Dégradé_sans_nom3" data-name="Dégradé sans nom" x1="0" y1="217" x2="325" y2="217" gradientTransform="matrix(1,0,0,1,0,0)" xlink:href="#Dégradé_sans_nom"/>
29
+ </defs>
30
+ <g id="Calque_1-2">
31
+ <path class="st2" d="M325,134v-6.6c0-3.18-1.26-6.23-3.5-8.48L206.37,3.52c-2.25-2.26-5.31-3.52-8.5-3.52h-6.87v134h134Z"/>
32
+ <path class="st0" d="M228.3,274c-5.89,0-11.3,3.23-14.09,8.42l-42.21,78.58h320.38l-48-79.28c-2.89-4.78-8.07-7.71-13.66-7.72h-202.42Z"/>
33
+ <path class="st1" d="M280.77,441.58c-1.74-.84-3.67-1.21-5.6-1.08h-4.95v9.59h5.47c2.59,0,4.38-.42,5.37-1.27,1.03-.93,1.58-2.28,1.49-3.66.12-1.43-.56-2.81-1.78-3.58ZM282.77,457.2c-.56-.86-1.39-1.5-2.36-1.83-1.42-.48-2.92-.7-4.42-.64h-5.74v11h6c2.67,0,4.53-.51,5.59-1.54,1.11-1.11,1.7-2.63,1.62-4.19.02-.98-.23-1.95-.72-2.8h.03ZM282.77,457.2c-.56-.86-1.39-1.5-2.36-1.83-1.42-.48-2.92-.7-4.42-.64h-5.74v11h6c2.67,0,4.53-.51,5.59-1.54,1.11-1.11,1.7-2.63,1.62-4.19.02-.98-.23-1.95-.72-2.8h.03ZM280.77,441.58c-1.74-.84-3.67-1.21-5.6-1.08h-4.95v9.59h5.47c2.59,0,4.38-.42,5.37-1.27,1.03-.93,1.58-2.28,1.49-3.66.12-1.43-.56-2.81-1.78-3.58ZM280.77,441.58c-1.74-.84-3.67-1.21-5.6-1.08h-4.95v9.59h5.47c2.59,0,4.38-.42,5.37-1.27,1.03-.93,1.58-2.28,1.49-3.66.12-1.43-.56-2.81-1.78-3.58ZM282.77,457.2c-.56-.86-1.39-1.5-2.36-1.83-1.42-.48-2.92-.7-4.42-.64h-5.74v11h6c2.67,0,4.53-.51,5.59-1.54,1.11-1.11,1.7-2.63,1.62-4.19.02-.98-.23-1.95-.72-2.8h.03ZM282.77,457.2c-.56-.86-1.39-1.5-2.36-1.83-1.42-.48-2.92-.7-4.42-.64h-5.74v11h6c2.67,0,4.53-.51,5.59-1.54,1.11-1.11,1.7-2.63,1.62-4.19.02-.98-.23-1.95-.72-2.8h.03ZM281.09,448.82c1.03-.93,1.58-2.28,1.49-3.66.12-1.43-.57-2.81-1.78-3.58-1.74-.84-3.67-1.21-5.6-1.08h-4.95v9.59h5.47c2.57,0,4.35-.42,5.34-1.27h.03ZM496,393H171c-8.84,0-16,7.16-16,16v87c0,8.84,7.16,16,16,16h325c8.84,0,16-7.16,16-16v-87c0-8.84-7.16-16-16-16ZM211.39,466.38c-1.07,1.55-2.58,2.74-4.33,3.43-2.14.84-4.42,1.24-6.72,1.19-1.22,0-2.43-.07-3.64-.21-1.1-.14-2.19-.35-3.27-.63-.97-.25-1.91-.59-2.82-1v-5.37c1.55.66,3.14,1.22,4.76,1.67,1.73.5,3.53.75,5.33.75,1.25.04,2.49-.16,3.66-.58.88-.32,1.64-.9,2.18-1.67.49-.75.74-1.63.72-2.53.04-.94-.26-1.86-.83-2.6-.69-.83-1.55-1.51-2.51-2-1.37-.71-2.78-1.36-4.22-1.92-1.12-.44-2.21-.96-3.26-1.55-1-.57-1.93-1.27-2.76-2.07-.82-.81-1.48-1.77-1.93-2.83-.5-1.21-.74-2.52-.71-3.83-.05-1.79.44-3.56,1.42-5.06,1-1.44,2.38-2.55,4-3.22,1.9-.78,3.94-1.16,6-1.12,1.74-.01,3.47.18,5.16.58,1.62.4,3.21.94,4.74,1.61l-1.77,4.58c-1.36-.56-2.75-1.03-4.16-1.41-1.33-.36-2.71-.54-4.09-.54-1.05-.03-2.1.16-3.07.55-2.21,1-3.18,3.61-2.18,5.81.1.22.22.43.36.64.63.79,1.42,1.43,2.33,1.88,1.06.57,2.42,1.2,4.08,1.9,1.7.68,3.34,1.52,4.89,2.5,1.26.78,2.32,1.86,3.08,3.13.76,1.39,1.13,2.96,1.07,4.55.06,1.9-.47,3.78-1.51,5.37ZM255.39,470.52h-5.44v-22.8c0-1.23.08-2.4.13-3.51s.11-2,.16-2.67h-.24l-10.37,29h-5l-10-29h-.21c0,.65.1,1.53.16,2.65s.12,2.32.17,3.62.07,2.51.07,3.67v19.08h-5.19v-34.82h8l9.64,27.77h.14l10-27.77h8l-.02,34.78ZM287.94,466c-1.07,1.53-2.57,2.72-4.31,3.4-2.11.82-4.36,1.22-6.63,1.16h-12.49v-34.82h10.35c4.49,0,7.88.65,10.16,1.95,2.28,1.3,3.42,3.55,3.43,6.76.01,1.23-.22,2.45-.7,3.59-.44,1.03-1.12,1.93-2,2.63-.97.72-2.09,1.2-3.28,1.39v.24c1.26.21,2.48.64,3.6,1.26,1.06.61,1.93,1.51,2.5,2.59.66,1.36.98,2.87.92,4.38.05,1.94-.49,3.85-1.55,5.47ZM317.81,470.56h-23.58v-4.21l9-9.13c1.74-1.78,3.18-3.31,4.3-4.61,1-1.11,1.85-2.34,2.53-3.67.56-1.19.84-2.48.83-3.79.1-1.41-.43-2.8-1.45-3.79-1.07-.9-2.43-1.37-3.83-1.3-1.44-.01-2.87.29-4.18.89-1.43.68-2.77,1.53-4,2.54l-3.07-3.71c.97-.82,2-1.57,3.08-2.24,1.16-.71,2.4-1.26,3.7-1.64,1.52-.44,3.1-.65,4.69-.62,1.97-.05,3.92.35,5.71,1.18,1.52.72,2.81,1.85,3.7,3.28.88,1.47,1.33,3.16,1.29,4.87.02,1.79-.36,3.56-1.11,5.19-.83,1.71-1.91,3.29-3.19,4.7-1.38,1.56-3,3.24-4.93,5.05l-6,5.85v.26h16.47l.04,4.9ZM372.74,476.78c-13.25,0-24-10.75-24-24s10.75-24,24-24,24,10.75,24,24c-.02,13.24-10.76,23.96-24,23.96v.04ZM444.74,476.78c-13.25,0-24-10.75-24-24s10.75-24,24-24,24,10.75,24,24c-.02,13.24-10.76,23.96-24,23.96v.04ZM280.38,455.37c-1.42-.48-2.92-.7-4.42-.64h-5.74v11h6c2.67,0,4.53-.51,5.59-1.54,1.11-1.11,1.7-2.63,1.62-4.19.02-.98-.22-1.96-.71-2.81-.56-.85-1.38-1.49-2.34-1.82ZM281.06,448.82c1.03-.93,1.58-2.28,1.49-3.66.12-1.43-.57-2.81-1.78-3.58-1.74-.84-3.67-1.21-5.6-1.08h-4.95v9.59h5.47c2.59,0,4.38-.42,5.37-1.27ZM280.77,441.58c-1.74-.84-3.67-1.21-5.6-1.08h-4.95v9.59h5.47c2.59,0,4.38-.42,5.37-1.27,1.03-.93,1.58-2.28,1.49-3.66.12-1.43-.56-2.81-1.78-3.58h0ZM282.77,457.2c-.56-.86-1.39-1.5-2.36-1.83-1.42-.48-2.92-.7-4.42-.64h-5.74v11h6c2.67,0,4.53-.51,5.59-1.54,1.11-1.11,1.7-2.63,1.62-4.19.02-.98-.23-1.95-.72-2.8h.03ZM282.77,457.2c-.56-.86-1.39-1.5-2.36-1.83-1.42-.48-2.92-.7-4.42-.64h-5.74v11h6c2.67,0,4.53-.51,5.59-1.54,1.11-1.11,1.7-2.63,1.62-4.19.02-.98-.23-1.95-.72-2.8h.03ZM280.77,441.58c-1.74-.84-3.67-1.21-5.6-1.08h-4.95v9.59h5.47c2.59,0,4.38-.42,5.37-1.27,1.03-.93,1.58-2.28,1.49-3.66.12-1.43-.56-2.81-1.78-3.58h0ZM280.77,441.58c-1.74-.84-3.67-1.21-5.6-1.08h-4.95v9.59h5.47c2.59,0,4.38-.42,5.37-1.27,1.03-.93,1.58-2.28,1.49-3.66.12-1.43-.56-2.81-1.78-3.58h0ZM282.77,457.2c-.56-.86-1.39-1.5-2.36-1.83-1.42-.48-2.92-.7-4.42-.64h-5.74v11h6c2.67,0,4.53-.51,5.59-1.54,1.11-1.11,1.7-2.63,1.62-4.19.02-.98-.23-1.95-.72-2.8h.03ZM282.77,457.2c-.56-.86-1.39-1.5-2.36-1.83-1.42-.48-2.92-.7-4.42-.64h-5.74v11h6c2.67,0,4.53-.51,5.59-1.54,1.11-1.11,1.7-2.63,1.62-4.19.02-.98-.23-1.95-.72-2.8h.03ZM280.77,441.58c-1.74-.84-3.67-1.21-5.6-1.08h-4.95v9.59h5.47c2.59,0,4.38-.42,5.37-1.27,1.03-.93,1.58-2.28,1.49-3.66.12-1.43-.56-2.81-1.78-3.58h0Z"/>
34
+ <path class="st3" d="M325,166v76h-96.44c-17.67,0-33.91,9.7-42.28,25.26l-57.08,106.15c-4.06,7.56-6.19,16.01-6.2,24.59v36H12c-6.63,0-12-5.37-12-12V12C0,5.37,5.37,0,12,0h147v154c0,6.63,5.37,12,12,12h154Z"/>
35
+ </g>
36
+ </svg>
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "n8n-nodes-smbclient",
3
+ "version": "1.0.0",
4
+ "description": "Transfer files via Samba (SMB2) and smbclient package with n8n, some of the base work are based on https://github.com/drudge/n8n-nodes-smb work.",
5
+ "keywords": [
6
+ "n8n-community-node-package",
7
+ "n8n-nodes-smbclient",
8
+ "smb",
9
+ "smb",
10
+ "samba",
11
+ "binary",
12
+ "file",
13
+ "transfer",
14
+ "node",
15
+ "n8n"
16
+ ],
17
+ "engines": {
18
+ "node": ">=20.15"
19
+ },
20
+ "repository": "https://github.com/JimmyMtl/n8n-nodes-smbclient",
21
+ "main": "index.js",
22
+ "scripts": {
23
+ "build": "npx rimraf dist && tsc && gulp build:icons",
24
+ "dev": "tsc --watch",
25
+ "format": "prettier nodes credentials --write",
26
+ "lint": "eslint nodes credentials package.json",
27
+ "lintfix": "eslint nodes credentials package.json --fix",
28
+ "prepublishOnly": "npm run build && npm run lint -c .eslintrc.prepublish.js nodes credentials package.json",
29
+ "release": "npx standard-version"
30
+ },
31
+ "n8n": {
32
+ "n8nNodesApiVersion": 1,
33
+ "credentials": [
34
+ "dist/credentials/Smb2Api.credentials.js"
35
+ ],
36
+ "nodes": [
37
+ "dist/nodes/Smb2/Smb2.node.js"
38
+ ]
39
+ },
40
+ "devDependencies": {
41
+ "@eslint/eslintrc": "^3.3.1",
42
+ "@eslint/js": "^9.35.0",
43
+ "@types/node": "^24.9.2",
44
+ "@typescript-eslint/parser": "^8.46.2",
45
+ "eslint": "^9.38.0",
46
+ "eslint-plugin-n8n-nodes-base": "^1.16.4",
47
+ "globals": "^16.4.0",
48
+ "gulp": "^5.0.1",
49
+ "prettier": "^3.6.2",
50
+ "typescript": "^5.9.3"
51
+ },
52
+ "peerDependencies": {
53
+ "n8n-workflow": "^1.115.0"
54
+ },
55
+ "dependencies": {
56
+ "tmp-promise": "^3.0.3"
57
+ },
58
+ "overrides": {
59
+ "form-data": "^4.0.4",
60
+ "axios": "1.12.0"
61
+ },
62
+ "pnpm": {
63
+ "onlyBuiltDependencies": [
64
+ "eslint-plugin-n8n-nodes-base"
65
+ ]
66
+ }
67
+ }
@@ -0,0 +1,174 @@
1
+ import {defineConfig, globalIgnores} from "eslint/config";
2
+ import globals from "globals";
3
+ import tsParser from "@typescript-eslint/parser";
4
+ import n8nNodesBase from "eslint-plugin-n8n-nodes-base";
5
+ import path from "node:path";
6
+ import {fileURLToPath} from "node:url";
7
+ import js from "@eslint/js";
8
+ import {FlatCompat} from "@eslint/eslintrc";
9
+
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = path.dirname(__filename);
12
+ const compat = new FlatCompat({
13
+ baseDirectory: __dirname,
14
+ recommendedConfig: js.configs.recommended,
15
+ allConfig: js.configs.all
16
+ });
17
+
18
+ export default defineConfig([
19
+ globalIgnores(["**/.eslintrc.js", "**/*.js", "**/node_modules/**/*", "**/dist/**/*"]),
20
+ {
21
+ languageOptions: {
22
+ globals: {
23
+ ...globals.browser,
24
+ ...globals.node,
25
+ },
26
+
27
+ parser: tsParser,
28
+ ecmaVersion: 5,
29
+ sourceType: "module",
30
+
31
+ parserOptions: {
32
+ project: ["./tsconfig.json"],
33
+ extraFileExtensions: [".json"],
34
+ },
35
+ },
36
+ },
37
+ {
38
+ files: ["**/package.json"],
39
+ extends: compat.extends("plugin:n8n-nodes-base/community"),
40
+
41
+ plugins: {
42
+ "n8n-nodes-base": n8nNodesBase,
43
+ },
44
+
45
+ rules: {
46
+ "n8n-nodes-base/community-package-json-name-still-default": "off",
47
+ "n8n-nodes-base/community-package-json-license-missing": "off",
48
+ "n8n-nodes-base/community-package-json-author-missing": "off"
49
+ },
50
+ },
51
+ {
52
+ files: ["./credentials/**/*.ts"],
53
+ extends: compat.extends("plugin:n8n-nodes-base/credentials"),
54
+
55
+ plugins: {
56
+ "n8n-nodes-base": n8nNodesBase,
57
+ },
58
+
59
+ rules: {
60
+ 'n8n-nodes-base/cred-class-field-authenticate-type-assertion': 'error',
61
+ 'n8n-nodes-base/cred-class-field-display-name-missing-oauth2': 'error',
62
+ 'n8n-nodes-base/cred-class-field-display-name-miscased': 'error',
63
+ 'n8n-nodes-base/cred-class-field-documentation-url-missing': 'off',
64
+ 'n8n-nodes-base/cred-class-field-documentation-url-miscased': 'off',
65
+ 'n8n-nodes-base/cred-class-field-name-missing-oauth2': 'error',
66
+ 'n8n-nodes-base/cred-class-field-name-unsuffixed': 'error',
67
+ 'n8n-nodes-base/cred-class-field-name-uppercase-first-char': 'error',
68
+ 'n8n-nodes-base/cred-class-field-properties-assertion': 'error',
69
+ 'n8n-nodes-base/cred-class-field-type-options-password-missing': 'error',
70
+ 'n8n-nodes-base/cred-class-name-missing-oauth2-suffix': 'error',
71
+ 'n8n-nodes-base/cred-class-name-unsuffixed': 'error',
72
+ 'n8n-nodes-base/cred-filename-against-convention': 'error',
73
+ },
74
+ },
75
+ {
76
+ files: ["./nodes/**/*.ts"],
77
+ extends: compat.extends("plugin:n8n-nodes-base/nodes"),
78
+
79
+ plugins: {
80
+ "n8n-nodes-base": n8nNodesBase,
81
+ },
82
+
83
+ rules: {
84
+ 'n8n-nodes-base/node-class-description-credentials-name-unsuffixed': 'error',
85
+ 'n8n-nodes-base/node-class-description-display-name-unsuffixed-trigger-node': 'error',
86
+ 'n8n-nodes-base/node-class-description-empty-string': 'error',
87
+ 'n8n-nodes-base/node-class-description-icon-not-svg': 'error',
88
+ 'n8n-nodes-base/node-class-description-inputs-wrong-trigger-node': 'error',
89
+ 'n8n-nodes-base/node-class-description-missing-subtitle': 'error',
90
+ 'n8n-nodes-base/node-class-description-non-core-color-present': 'error',
91
+ 'n8n-nodes-base/node-class-description-name-miscased': 'error',
92
+ 'n8n-nodes-base/node-class-description-name-unsuffixed-trigger-node': 'error',
93
+ 'n8n-nodes-base/node-dirname-against-convention': 'error',
94
+ 'n8n-nodes-base/node-execute-block-double-assertion-for-items': 'error',
95
+ 'n8n-nodes-base/node-execute-block-wrong-error-thrown': 'error',
96
+ 'n8n-nodes-base/node-filename-against-convention': 'error',
97
+ 'n8n-nodes-base/node-param-array-type-assertion': 'error',
98
+ 'n8n-nodes-base/node-param-color-type-unused': 'error',
99
+ 'n8n-nodes-base/node-param-default-missing': 'error',
100
+ 'n8n-nodes-base/node-param-default-wrong-for-boolean': 'error',
101
+ 'n8n-nodes-base/node-param-default-wrong-for-collection': 'error',
102
+ 'n8n-nodes-base/node-param-default-wrong-for-fixed-collection': 'error',
103
+ 'n8n-nodes-base/node-param-default-wrong-for-multi-options': 'error',
104
+ 'n8n-nodes-base/node-param-default-wrong-for-number': 'error',
105
+ 'n8n-nodes-base/node-param-default-wrong-for-simplify': 'error',
106
+ 'n8n-nodes-base/node-param-default-wrong-for-string': 'error',
107
+ 'n8n-nodes-base/node-param-description-boolean-without-whether': 'error',
108
+ 'n8n-nodes-base/node-param-description-comma-separated-hyphen': 'error',
109
+ 'n8n-nodes-base/node-param-description-empty-string': 'error',
110
+ 'n8n-nodes-base/node-param-description-excess-final-period': 'error',
111
+ 'n8n-nodes-base/node-param-description-excess-inner-whitespace': 'error',
112
+ 'n8n-nodes-base/node-param-description-identical-to-display-name': 'error',
113
+ 'n8n-nodes-base/node-param-description-line-break-html-tag': 'error',
114
+ 'n8n-nodes-base/node-param-description-lowercase-first-char': 'error',
115
+ 'n8n-nodes-base/node-param-description-miscased-id': 'error',
116
+ 'n8n-nodes-base/node-param-description-miscased-json': 'error',
117
+ 'n8n-nodes-base/node-param-description-miscased-url': 'error',
118
+ 'n8n-nodes-base/node-param-description-missing-final-period': 'error',
119
+ 'n8n-nodes-base/node-param-description-missing-for-ignore-ssl-issues': 'error',
120
+ 'n8n-nodes-base/node-param-description-missing-for-return-all': 'error',
121
+ 'n8n-nodes-base/node-param-description-missing-for-simplify': 'error',
122
+ 'n8n-nodes-base/node-param-description-missing-from-dynamic-multi-options': 'error',
123
+ 'n8n-nodes-base/node-param-description-missing-from-dynamic-options': 'error',
124
+ 'n8n-nodes-base/node-param-description-missing-from-limit': 'error',
125
+ 'n8n-nodes-base/node-param-description-unencoded-angle-brackets': 'error',
126
+ 'n8n-nodes-base/node-param-description-unneeded-backticks': 'error',
127
+ 'n8n-nodes-base/node-param-description-untrimmed': 'error',
128
+ 'n8n-nodes-base/node-param-description-url-missing-protocol': 'error',
129
+ 'n8n-nodes-base/node-param-description-weak': 'error',
130
+ 'n8n-nodes-base/node-param-description-wrong-for-dynamic-multi-options': 'error',
131
+ 'n8n-nodes-base/node-param-description-wrong-for-dynamic-options': 'error',
132
+ 'n8n-nodes-base/node-param-description-wrong-for-ignore-ssl-issues': 'error',
133
+ 'n8n-nodes-base/node-param-description-wrong-for-limit': 'error',
134
+ 'n8n-nodes-base/node-param-description-wrong-for-return-all': 'error',
135
+ 'n8n-nodes-base/node-param-description-wrong-for-simplify': 'error',
136
+ 'n8n-nodes-base/node-param-description-wrong-for-upsert': 'error',
137
+ 'n8n-nodes-base/node-param-display-name-excess-inner-whitespace': 'error',
138
+ 'n8n-nodes-base/node-param-display-name-miscased-id': 'error',
139
+ 'n8n-nodes-base/node-param-display-name-miscased': 'error',
140
+ 'n8n-nodes-base/node-param-display-name-not-first-position': 'error',
141
+ 'n8n-nodes-base/node-param-display-name-untrimmed': 'error',
142
+ 'n8n-nodes-base/node-param-display-name-wrong-for-dynamic-multi-options': 'error',
143
+ 'n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options': 'error',
144
+ 'n8n-nodes-base/node-param-display-name-wrong-for-simplify': 'error',
145
+ 'n8n-nodes-base/node-param-display-name-wrong-for-update-fields': 'error',
146
+ 'n8n-nodes-base/node-param-min-value-wrong-for-limit': 'error',
147
+ 'n8n-nodes-base/node-param-multi-options-type-unsorted-items': 'error',
148
+ 'n8n-nodes-base/node-param-name-untrimmed': 'error',
149
+ 'n8n-nodes-base/node-param-operation-option-action-wrong-for-get-many': 'error',
150
+ 'n8n-nodes-base/node-param-operation-option-description-wrong-for-get-many': 'error',
151
+ 'n8n-nodes-base/node-param-operation-option-without-action': 'error',
152
+ 'n8n-nodes-base/node-param-operation-without-no-data-expression': 'error',
153
+ 'n8n-nodes-base/node-param-option-description-identical-to-name': 'error',
154
+ 'n8n-nodes-base/node-param-option-name-containing-star': 'error',
155
+ 'n8n-nodes-base/node-param-option-name-duplicate': 'error',
156
+ 'n8n-nodes-base/node-param-option-name-wrong-for-get-many': 'error',
157
+ 'n8n-nodes-base/node-param-option-name-wrong-for-upsert': 'error',
158
+ 'n8n-nodes-base/node-param-option-value-duplicate': 'error',
159
+ 'n8n-nodes-base/node-param-options-type-unsorted-items': 'error',
160
+ 'n8n-nodes-base/node-param-placeholder-miscased-id': 'error',
161
+ 'n8n-nodes-base/node-param-placeholder-missing-email': 'error',
162
+ 'n8n-nodes-base/node-param-required-false': 'error',
163
+ 'n8n-nodes-base/node-param-resource-with-plural-option': 'error',
164
+ 'n8n-nodes-base/node-param-resource-without-no-data-expression': 'error',
165
+ 'n8n-nodes-base/node-param-type-options-missing-from-limit': 'error',
166
+ 'n8n-nodes-base/node-param-type-options-password-missing': 'error',
167
+ "n8n-nodes-base/node-execute-block-missing-continue-on-fail": "off",
168
+ "n8n-nodes-base/node-resource-description-filename-against-convention": "off",
169
+ "n8n-nodes-base/node-param-fixed-collection-type-unsorted-items": "off",
170
+ "n8n-nodes-base/node-class-description-outputs-wrong": "off",
171
+ "n8n-nodes-base/node-class-description-inputs-wrong-regular-node": "off"
172
+ },
173
+ },
174
+ ]);
package/gulpfile.js ADDED
@@ -0,0 +1,16 @@
1
+ const path = require('path');
2
+ const { task, src, dest } = require('gulp');
3
+
4
+ task('build:icons', copyIcons);
5
+
6
+ function copyIcons() {
7
+ const nodeSource = path.resolve('nodes', '**', '*.{png,svg}');
8
+ const nodeDestination = path.resolve('dist', 'nodes');
9
+
10
+ src(nodeSource).pipe(dest(nodeDestination));
11
+
12
+ const credSource = path.resolve('credentials', '**', '*.{png,svg}');
13
+ const credDestination = path.resolve('dist', 'credentials');
14
+
15
+ return src(credSource).pipe(dest(credDestination));
16
+ }
package/index.js ADDED
File without changes
@@ -0,0 +1,19 @@
1
+ {
2
+ "node": "n8n-nodes-smbclient.Smb2",
3
+ "nodeVersion": "1.0",
4
+ "codexVersion": "1.0",
5
+ "categories": ["Data & Storage", "Development", "Utility"],
6
+ "resources": {
7
+ "credentialDocumentation": [
8
+ {
9
+ "url": "https://github.com/JimmyMtl/n8n-nodes-smbclient"
10
+ }
11
+ ],
12
+ "primaryDocumentation": [
13
+ {
14
+ "url": "https://github.com/JimmyMtl/n8n-nodes-smbclient"
15
+ }
16
+ ]
17
+ },
18
+ "alias": ["SMB","SMB2", "Samba", "SMB3", "CIFS","Binary", "File", "Transfer"]
19
+ }
@@ -0,0 +1,184 @@
1
+ import type {
2
+ IExecuteFunctions, INodeExecutionData,
3
+ INodeType,
4
+ INodeTypeDescription
5
+ } from 'n8n-workflow';
6
+ import {Operation} from "./interfaces";
7
+ import {buildClient, handlers} from "./SmbEntryHelpers";
8
+ import { NodeOperationError } from 'n8n-workflow';
9
+ export class Smb2 implements INodeType {
10
+ description: INodeTypeDescription = {
11
+ displayName: 'SMB2 using smbclient',
12
+ name: 'smb2',
13
+ icon: 'file:smb2.svg',
14
+ group: ['transform'],
15
+ version: 1,
16
+ description: 'Interact with SMB shares using the smbclient CLI',
17
+ defaults: {
18
+ name: 'Smbclient (SMB2) API',
19
+ },
20
+ inputs: ['main'],
21
+ outputs: ['main'],
22
+ credentials: [
23
+ {
24
+ name: 'smb2Api',
25
+ required: true,
26
+ },
27
+ ],
28
+ properties: [
29
+ /* Connection */
30
+ {
31
+ displayName: 'Smbclient Path',
32
+ name: 'smbclientPath',
33
+ type: 'string',
34
+ default: 'smbclient',
35
+ description: 'Custom path to smbclient binary, if not in PATH',
36
+ },
37
+
38
+ /* Operation */
39
+ {
40
+ displayName: 'Operation',
41
+ name: 'operation',
42
+ type: 'options',
43
+ noDataExpression: true,
44
+ options: [
45
+ {
46
+ name: 'Delete File', value: 'del', description: 'Delete a file',
47
+ action: 'Delete a file'
48
+ },
49
+ {
50
+ name: 'Get File', value: 'get', description: 'Download a file from SMB',
51
+ action: 'Get a file'
52
+ },
53
+ {
54
+ name: 'List Directory', value: 'list', description: 'List a directory',
55
+ action: 'List a directory'
56
+ },
57
+ {
58
+ name: 'Make Directory', value: 'mkdir', description: 'Create a directory',
59
+ action: 'Create a directory'
60
+ },
61
+ {
62
+ name: 'Remove Directory', value: 'rmdir', description: 'Remove a directory',
63
+ action: 'Remove a directory'
64
+ },
65
+ {
66
+ name: 'Stat', value: 'stat', description: 'Get file/folder metadata',
67
+ action: 'Get file folder metadata'
68
+ },
69
+ {
70
+ name: 'Upload File', value: 'put', description: 'Upload a file',
71
+ action: 'Upload a file'
72
+ }
73
+ ],
74
+ default: 'list',
75
+ },
76
+
77
+ /* Common path(s) */
78
+ {
79
+ displayName: 'Remote Path',
80
+ name: 'remotePath',
81
+ type: 'string',
82
+ default: '/',
83
+ displayOptions: {
84
+ show: {
85
+ operation: ['stat', 'get', 'put', 'del'],
86
+ },
87
+ },
88
+ },
89
+ {
90
+ displayName: 'Directory',
91
+ name: 'directory',
92
+ type: 'string',
93
+ default: '/',
94
+ displayOptions: {
95
+ show: {
96
+ operation: ['list', 'mkdir', 'rmdir'],
97
+ },
98
+ },
99
+ },
100
+
101
+ /* Put options */
102
+ {
103
+ displayName: 'Source',
104
+ name: 'putSource',
105
+ type: 'options',
106
+ options: [
107
+ {name: 'Binary Property', value: 'binary'},
108
+ {name: 'Text', value: 'text'},
109
+ ],
110
+ default: 'binary',
111
+ displayOptions: {show: {operation: ['put']}},
112
+ },
113
+ {
114
+ displayName: 'Binary Property',
115
+ name: 'binaryPropertyName',
116
+ type: 'string',
117
+ default: 'data',
118
+ displayOptions: {
119
+ show: {operation: ['put'], putSource: ['binary']},
120
+ },
121
+ },
122
+ {
123
+ displayName: 'Text Content',
124
+ name: 'textContent',
125
+ type: 'string',
126
+ typeOptions: {rows: 4},
127
+ default: '',
128
+ displayOptions: {
129
+ show: {operation: ['put'], putSource: ['text']},
130
+ },
131
+ },
132
+
133
+ /* Get options */
134
+ {
135
+ displayName: 'Binary Property (Output)',
136
+ name: 'outBinaryPropertyName',
137
+ type: 'string',
138
+ default: 'data',
139
+ displayOptions: {show: {operation: ['get']}},
140
+ },
141
+ {
142
+ displayName: 'File Name (Output)',
143
+ name: 'outFileName',
144
+ type: 'string',
145
+ default: '',
146
+ placeholder: 'example.txt',
147
+ displayOptions: {show: {operation: ['get']}},
148
+ },
149
+ {
150
+ displayName: 'MIME Type (Output)',
151
+ name: 'outMimeType',
152
+ type: 'string',
153
+ default: 'application/octet-stream',
154
+ displayOptions: {show: {operation: ['get']}},
155
+ },
156
+ ],
157
+ };
158
+
159
+ async execute(this: IExecuteFunctions) {
160
+ const op = this.getNodeParameter('operation', 0) as Operation;
161
+ const handler = handlers[op];
162
+ if (!handler) {
163
+ throw new NodeOperationError(this.getNode(), `Unsupported operation: ${op}`);
164
+ }
165
+
166
+ const items = this.getInputData();
167
+ const client = await buildClient(this);
168
+
169
+ const out: INodeExecutionData[] = [];
170
+ try {
171
+ for (let i = 0; i < items.length; i++) {
172
+ out.push(await handler(this, i, client));
173
+ }
174
+ } catch (err) {
175
+ console.error(err)
176
+ throw new NodeOperationError(this.getNode(), (err as Error)?.message || 'SMB operation failed');
177
+ } finally {
178
+ await client.close().catch(() => {
179
+ });
180
+ }
181
+
182
+ return this.prepareOutputData(out);
183
+ }
184
+ }