@activepieces/piece-sftp 0.0.2 → 0.1.1
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,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-sftp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@sinclair/typebox": "0.26.
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"@activepieces/
|
|
10
|
-
"
|
|
11
|
-
"tslib": "2.5.3"
|
|
5
|
+
"@sinclair/typebox": "^0.26.3",
|
|
6
|
+
"nanoid": "^3.3.4",
|
|
7
|
+
"ssh2-sftp-client": "^9.1.0",
|
|
8
|
+
"@activepieces/pieces-framework": "0.5.0",
|
|
9
|
+
"@activepieces/shared": "0.5.0",
|
|
10
|
+
"tslib": "1.14.1"
|
|
12
11
|
},
|
|
13
12
|
"main": "./src/index.js",
|
|
14
13
|
"types": "./src/index.d.ts"
|
package/src/index.d.ts
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const sftpAuth: import("@activepieces/pieces-framework").CustomAuthProperty<true, {
|
|
2
|
+
host: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
port: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
4
|
+
username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
|
+
password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const sftp: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").CustomAuthProperty<true, {
|
|
8
|
+
host: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
9
|
+
port: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
10
|
+
username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
11
|
+
password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
12
|
+
}>>;
|
package/src/index.js
CHANGED
|
@@ -1,12 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sftp = void 0;
|
|
3
|
+
exports.sftp = exports.sftpAuth = void 0;
|
|
4
4
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
5
|
const create_file_1 = require("./lib/actions/create-file");
|
|
6
|
+
exports.sftpAuth = pieces_framework_1.PieceAuth.CustomAuth({
|
|
7
|
+
displayName: 'Authentication',
|
|
8
|
+
description: 'Enter the authentication details',
|
|
9
|
+
props: {
|
|
10
|
+
host: pieces_framework_1.Property.ShortText({
|
|
11
|
+
displayName: 'Host',
|
|
12
|
+
description: 'The host of the SFTP server',
|
|
13
|
+
required: true,
|
|
14
|
+
}),
|
|
15
|
+
port: pieces_framework_1.Property.Number({
|
|
16
|
+
displayName: 'Port',
|
|
17
|
+
description: 'The port of the SFTP server',
|
|
18
|
+
required: true,
|
|
19
|
+
defaultValue: 22,
|
|
20
|
+
}),
|
|
21
|
+
username: pieces_framework_1.Property.ShortText({
|
|
22
|
+
displayName: 'Username',
|
|
23
|
+
description: 'The username of the SFTP server',
|
|
24
|
+
required: true,
|
|
25
|
+
}),
|
|
26
|
+
password: pieces_framework_1.PieceAuth.SecretText({
|
|
27
|
+
displayName: 'Password',
|
|
28
|
+
description: 'The password of the SFTP server',
|
|
29
|
+
required: true,
|
|
30
|
+
}),
|
|
31
|
+
},
|
|
32
|
+
required: true
|
|
33
|
+
});
|
|
6
34
|
exports.sftp = (0, pieces_framework_1.createPiece)({
|
|
7
35
|
displayName: "SFTP",
|
|
8
|
-
|
|
36
|
+
minimumSupportedRelease: '0.5.0',
|
|
37
|
+
logoUrl: "https://cdn.activepieces.com/pieces/sftp.svg",
|
|
9
38
|
authors: ["Abdallah-Alwarawreh"],
|
|
39
|
+
auth: exports.sftpAuth,
|
|
10
40
|
actions: [create_file_1.createFile],
|
|
11
41
|
triggers: [],
|
|
12
42
|
});
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/sftp/src/index.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/sftp/src/index.ts"],"names":[],"mappings":";;;AACA,qEAAkF;AAClF,2DAAuD;AAE1C,QAAA,QAAQ,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC3C,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,kCAAkC;IAC/C,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,6BAA6B;YAC1C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACpB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,6BAA6B;YAC1C,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,EAAE;SACjB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,4BAAS,CAAC,UAAU,CAAC;YAC7B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACD,QAAQ,EAAE,IAAI;CACf,CAAC,CAAA;AAEW,QAAA,IAAI,GAAG,IAAA,8BAAW,EAAC;IAC9B,WAAW,EAAE,MAAM;IACf,uBAAuB,EAAE,OAAO;IAClC,OAAO,EAAE,8CAA8C;IACzD,OAAO,EAAE,CAAC,qBAAqB,CAAC;IAChC,IAAI,EAAE,gBAAQ;IACd,OAAO,EAAE,CAAC,wBAAU,CAAC;IACrB,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
export declare const createFile: import("@activepieces/pieces-framework").
|
|
1
|
+
export declare const createFile: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<true, {
|
|
2
|
+
host: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
port: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
4
|
+
username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
|
+
password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
6
|
+
}>, {
|
|
7
|
+
fileName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
8
|
+
fileContent: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
9
|
+
}>;
|
|
@@ -4,40 +4,13 @@ exports.createFile = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
6
|
const ssh2_sftp_client_1 = tslib_1.__importDefault(require("ssh2-sftp-client"));
|
|
7
|
+
const __1 = require("../..");
|
|
7
8
|
exports.createFile = (0, pieces_framework_1.createAction)({
|
|
9
|
+
auth: __1.sftpAuth,
|
|
8
10
|
name: 'create_file',
|
|
9
11
|
displayName: 'Create new file',
|
|
10
12
|
description: 'Create a new file in the given path',
|
|
11
13
|
props: {
|
|
12
|
-
// host, port, username, password
|
|
13
|
-
authentication: pieces_framework_1.Property.CustomAuth({
|
|
14
|
-
displayName: 'Authentication',
|
|
15
|
-
description: 'Enter the authentication details',
|
|
16
|
-
props: {
|
|
17
|
-
host: pieces_framework_1.Property.ShortText({
|
|
18
|
-
displayName: 'Host',
|
|
19
|
-
description: 'The host of the SFTP server',
|
|
20
|
-
required: true,
|
|
21
|
-
}),
|
|
22
|
-
port: pieces_framework_1.Property.Number({
|
|
23
|
-
displayName: 'Port',
|
|
24
|
-
description: 'The port of the SFTP server',
|
|
25
|
-
required: true,
|
|
26
|
-
defaultValue: 22,
|
|
27
|
-
}),
|
|
28
|
-
username: pieces_framework_1.Property.ShortText({
|
|
29
|
-
displayName: 'Username',
|
|
30
|
-
description: 'The username of the SFTP server',
|
|
31
|
-
required: true,
|
|
32
|
-
}),
|
|
33
|
-
password: pieces_framework_1.Property.SecretText({
|
|
34
|
-
displayName: 'Password',
|
|
35
|
-
description: 'The password of the SFTP server',
|
|
36
|
-
required: true,
|
|
37
|
-
}),
|
|
38
|
-
},
|
|
39
|
-
required: true
|
|
40
|
-
}),
|
|
41
14
|
fileName: pieces_framework_1.Property.ShortText({
|
|
42
15
|
displayName: 'File Path',
|
|
43
16
|
description: 'The name of the file to create',
|
|
@@ -51,10 +24,10 @@ exports.createFile = (0, pieces_framework_1.createAction)({
|
|
|
51
24
|
},
|
|
52
25
|
run(context) {
|
|
53
26
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
const host = context.
|
|
55
|
-
const port = context.
|
|
56
|
-
const username = context.
|
|
57
|
-
const password = context.
|
|
27
|
+
const host = context.auth.host;
|
|
28
|
+
const port = context.auth.port;
|
|
29
|
+
const username = context.auth.username;
|
|
30
|
+
const password = context.auth.password;
|
|
58
31
|
const fileName = context.propsValue['fileName'];
|
|
59
32
|
const fileContent = context.propsValue['fileContent'];
|
|
60
33
|
const sftp = new ssh2_sftp_client_1.default();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-file.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/sftp/src/lib/actions/create-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,gFAAqC;
|
|
1
|
+
{"version":3,"file":"create-file.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/sftp/src/lib/actions/create-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,gFAAqC;AACrC,6BAAiC;AAEpB,QAAA,UA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