@activepieces/piece-sftp 0.1.5 → 0.2.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/package.json
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-sftp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@sinclair/typebox": "^0.26.3",
|
|
6
6
|
"axios": "1.4.0",
|
|
7
7
|
"dayjs": "^1.11.8",
|
|
8
8
|
"is-base64": "^1.1.0",
|
|
9
9
|
"nanoid": "^3.3.4",
|
|
10
|
-
"
|
|
10
|
+
"object-sizeof": "^2.6.3",
|
|
11
|
+
"semver": "7.5.4",
|
|
11
12
|
"ssh2-sftp-client": "^9.1.0",
|
|
12
13
|
"@activepieces/pieces-common": "0.2.2",
|
|
13
|
-
"@activepieces/pieces-framework": "0.6.
|
|
14
|
-
"@activepieces/shared": "0.
|
|
15
|
-
"tslib": "
|
|
14
|
+
"@activepieces/pieces-framework": "0.6.12",
|
|
15
|
+
"@activepieces/shared": "0.7.2",
|
|
16
|
+
"tslib": "2.6.1"
|
|
16
17
|
},
|
|
17
18
|
"main": "./src/index.js",
|
|
18
19
|
"types": "./src/index.d.ts"
|
|
@@ -5,5 +5,4 @@ export declare const readFileContent: import("@activepieces/pieces-framework").I
|
|
|
5
5
|
password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
6
6
|
}>, {
|
|
7
7
|
filePath: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
8
|
-
outputFormat: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
9
8
|
}>;
|
|
@@ -14,26 +14,10 @@ exports.readFileContent = (0, pieces_framework_1.createAction)({
|
|
|
14
14
|
filePath: pieces_framework_1.Property.ShortText({
|
|
15
15
|
displayName: 'File Path',
|
|
16
16
|
required: true
|
|
17
|
-
}),
|
|
18
|
-
outputFormat: pieces_framework_1.Property.StaticDropdown({
|
|
19
|
-
displayName: 'Output Format',
|
|
20
|
-
required: true,
|
|
21
|
-
defaultValue: 'base64',
|
|
22
|
-
options: {
|
|
23
|
-
options: [
|
|
24
|
-
{
|
|
25
|
-
value: 'Text',
|
|
26
|
-
label: 'utf8'
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
value: 'base64',
|
|
30
|
-
label: 'Base64'
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
17
|
})
|
|
35
18
|
},
|
|
36
19
|
run(context) {
|
|
20
|
+
var _a;
|
|
37
21
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
38
22
|
const { host, port, username, password } = context.auth;
|
|
39
23
|
const filePath = context.propsValue['filePath'];
|
|
@@ -46,9 +30,13 @@ exports.readFileContent = (0, pieces_framework_1.createAction)({
|
|
|
46
30
|
readyTimeout: 15000
|
|
47
31
|
});
|
|
48
32
|
const fileContent = yield sftp.get(filePath);
|
|
33
|
+
const fileName = (_a = filePath.split('/').pop()) !== null && _a !== void 0 ? _a : filePath;
|
|
49
34
|
yield sftp.end();
|
|
50
35
|
return {
|
|
51
|
-
|
|
36
|
+
file: yield context.files.write({
|
|
37
|
+
fileName: fileName,
|
|
38
|
+
data: fileContent,
|
|
39
|
+
})
|
|
52
40
|
};
|
|
53
41
|
});
|
|
54
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-file.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/sftp/src/lib/actions/read-file.ts"],"names":[],"mappings":";;;;AAAA,uCAAuC;AACvC,qEAAwE;AACxE,gFAAsC;AAEzB,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,gBAAQ;IACd,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,4BAA4B;IACzC,KAAK,EAAE;QACL,QAAQ,EAA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