@activepieces/piece-sftp
Advanced tools
Comparing version 0.1.3 to 0.1.4
{ | ||
"name": "@activepieces/piece-sftp", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"dependencies": { | ||
@@ -8,8 +8,9 @@ "@sinclair/typebox": "^0.26.3", | ||
"dayjs": "^1.11.8", | ||
"is-base64": "^1.1.0", | ||
"nanoid": "^3.3.4", | ||
"semver": "7.5.3", | ||
"ssh2-sftp-client": "^9.1.0", | ||
"@activepieces/pieces-common": "0.2.1", | ||
"@activepieces/pieces-framework": "0.6.6", | ||
"@activepieces/shared": "0.5.11", | ||
"@activepieces/pieces-common": "0.2.2", | ||
"@activepieces/pieces-framework": "0.6.10", | ||
"@activepieces/shared": "0.6.4", | ||
"tslib": "1.14.1" | ||
@@ -16,0 +17,0 @@ }, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.sftp = exports.sftpAuth = void 0; | ||
const tslib_1 = require("tslib"); | ||
const pieces_framework_1 = require("@activepieces/pieces-framework"); | ||
const create_file_1 = require("./lib/actions/create-file"); | ||
const new_modified_file_1 = require("./lib/triggers/new-modified-file"); | ||
const ssh2_sftp_client_1 = tslib_1.__importDefault(require("ssh2-sftp-client")); | ||
const read_file_1 = require("./lib/actions/read-file"); | ||
exports.sftpAuth = pieces_framework_1.PieceAuth.CustomAuth({ | ||
displayName: 'Authentication', | ||
description: 'Enter the authentication details', | ||
@@ -14,3 +16,3 @@ props: { | ||
description: 'The host of the SFTP server', | ||
required: true, | ||
required: true | ||
}), | ||
@@ -21,3 +23,3 @@ port: pieces_framework_1.Property.Number({ | ||
required: true, | ||
defaultValue: 22, | ||
defaultValue: 22 | ||
}), | ||
@@ -27,3 +29,3 @@ username: pieces_framework_1.Property.ShortText({ | ||
description: 'The username of the SFTP server', | ||
required: true, | ||
required: true | ||
}), | ||
@@ -33,16 +35,40 @@ password: pieces_framework_1.PieceAuth.SecretText({ | ||
description: 'The password of the SFTP server', | ||
required: true, | ||
}), | ||
required: true | ||
}) | ||
}, | ||
validate: ({ auth }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
const { host, port, username, password } = auth; | ||
const sftp = new ssh2_sftp_client_1.default(); | ||
try { | ||
yield sftp.connect({ | ||
host, | ||
port, | ||
username, | ||
password | ||
}); | ||
return { | ||
valid: true | ||
}; | ||
} | ||
catch (err) { | ||
return { | ||
valid: false, | ||
error: 'Connection failed. Please check your credentials and try again.' | ||
}; | ||
} | ||
finally { | ||
yield sftp.end(); | ||
} | ||
}), | ||
required: true | ||
}); | ||
exports.sftp = (0, pieces_framework_1.createPiece)({ | ||
displayName: "SFTP", | ||
minimumSupportedRelease: '0.5.0', | ||
logoUrl: "https://cdn.activepieces.com/pieces/sftp.svg", | ||
authors: ["Abdallah-Alwarawreh"], | ||
displayName: 'SFTP', | ||
minimumSupportedRelease: '0.7.1', | ||
logoUrl: 'https://cdn.activepieces.com/pieces/sftp.svg', | ||
authors: ['Abdallah-Alwarawreh', 'abuaboud'], | ||
auth: exports.sftpAuth, | ||
actions: [create_file_1.createFile], | ||
triggers: [new_modified_file_1.newOrModifiedFile], | ||
actions: [create_file_1.createFile, read_file_1.readFileContent], | ||
triggers: [new_modified_file_1.newOrModifiedFile] | ||
}); | ||
//# sourceMappingURL=index.js.map |
@@ -11,3 +11,3 @@ "use strict"; | ||
name: 'create_file', | ||
displayName: 'Create new file', | ||
displayName: 'Create File from Text', | ||
description: 'Create a new file in the given path', | ||
@@ -17,3 +17,2 @@ props: { | ||
displayName: 'File Path', | ||
description: 'The name of the file to create', | ||
required: true, | ||
@@ -23,3 +22,2 @@ }), | ||
displayName: 'File content', | ||
description: 'The content of the file to create', | ||
required: true, | ||
@@ -26,0 +24,0 @@ }) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
21174
14
316
11
+ Addedis-base64@^1.1.0
+ Added@activepieces/pieces-common@0.2.2(transitive)
+ Added@activepieces/pieces-framework@0.6.10(transitive)
+ Added@activepieces/shared@0.6.4(transitive)
+ Addedis-base64@1.1.0(transitive)
- Removed@activepieces/pieces-common@0.2.1(transitive)
- Removed@activepieces/pieces-framework@0.6.10.6.6(transitive)
- Removed@activepieces/shared@0.5.100.5.110.5.60.5.7(transitive)
Updated@activepieces/shared@0.6.4