@activepieces/piece-sftp
Advanced tools
Comparing version 0.1.5 to 0.2.0
{ | ||
"name": "@activepieces/piece-sftp", | ||
"version": "0.1.5", | ||
"version": "0.2.0", | ||
"dependencies": { | ||
@@ -10,8 +10,9 @@ "@sinclair/typebox": "^0.26.3", | ||
"nanoid": "^3.3.4", | ||
"semver": "7.5.3", | ||
"object-sizeof": "^2.6.3", | ||
"semver": "7.5.4", | ||
"ssh2-sftp-client": "^9.1.0", | ||
"@activepieces/pieces-common": "0.2.2", | ||
"@activepieces/pieces-framework": "0.6.10", | ||
"@activepieces/shared": "0.6.4", | ||
"tslib": "1.14.1" | ||
"@activepieces/pieces-framework": "0.6.12", | ||
"@activepieces/shared": "0.7.2", | ||
"tslib": "2.6.1" | ||
}, | ||
@@ -18,0 +19,0 @@ "main": "./src/index.js", |
@@ -8,3 +8,2 @@ export declare const readFileContent: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<true, { | ||
filePath: import("@activepieces/pieces-framework").ShortTextProperty<true>; | ||
outputFormat: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>; | ||
}>; |
@@ -17,22 +17,6 @@ "use strict"; | ||
required: true | ||
}), | ||
outputFormat: pieces_framework_1.Property.StaticDropdown({ | ||
displayName: 'Output Format', | ||
required: true, | ||
defaultValue: 'base64', | ||
options: { | ||
options: [ | ||
{ | ||
value: 'Text', | ||
label: 'utf8' | ||
}, | ||
{ | ||
value: 'base64', | ||
label: 'Base64' | ||
} | ||
] | ||
} | ||
}) | ||
}, | ||
run(context) { | ||
var _a; | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
@@ -50,5 +34,9 @@ const { host, port, username, password } = context.auth; | ||
const fileContent = yield sftp.get(filePath); | ||
const fileName = (_a = filePath.split('/').pop()) !== null && _a !== void 0 ? _a : filePath; | ||
yield sftp.end(); | ||
return { | ||
base64: fileContent.toString(context.propsValue.outputFormat === 'base64' ? 'base64' : 'utf8') | ||
file: yield context.files.write({ | ||
fileName: fileName, | ||
data: fileContent, | ||
}) | ||
}; | ||
@@ -55,0 +43,0 @@ }); |
Sorry, the diff of this file is not supported yet
20707
12
303
+ Addedobject-sizeof@^2.6.3
+ Added@activepieces/pieces-framework@0.6.12(transitive)
+ Added@activepieces/shared@0.7.2(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbuffer@6.0.3(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedobject-sizeof@2.6.5(transitive)
+ Addedsemver@7.5.4(transitive)
+ Addedtslib@2.6.1(transitive)
Updated@activepieces/shared@0.7.2
Updatedsemver@7.5.4
Updatedtslib@2.6.1