@pipedream/pcloud 0.3.4 → 0.3.5
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/actions/common/base.mjs +1 -1
- package/actions/copy-file/copy-file.mjs +1 -1
- package/actions/copy-folder/copy-folder.mjs +1 -1
- package/actions/create-folder/create-folder.mjs +1 -1
- package/actions/download-files/download-files.mjs +1 -1
- package/actions/list-contents/list-contents.mjs +1 -1
- package/actions/move-file/move-file.mjs +45 -0
- package/actions/move-folder/move-folder.mjs +45 -0
- package/actions/rename-file/rename-file.mjs +43 -0
- package/actions/rename-folder/rename-folder.mjs +43 -0
- package/actions/upload-file/upload-file.mjs +1 -1
- package/package.json +1 -1
- package/pcloud.app.mjs +88 -0
- package/sources/watch-folder/watch-folder.mjs +1 -1
package/actions/common/base.mjs
CHANGED
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "pcloud-copy-folder",
|
|
7
7
|
name: "Copy Folder",
|
|
8
8
|
description: "Copy a folder to the specified folder. [See the docs here](https://docs.pcloud.com/methods/folder/copyfolder.html)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.3",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
...common.props,
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
name: "Create Folder",
|
|
8
8
|
description:
|
|
9
9
|
"Create a folder in the specified folder. [See the docs here](https://docs.pcloud.com/methods/folder/createfolder.html)",
|
|
10
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.3",
|
|
11
11
|
type: "action",
|
|
12
12
|
props: {
|
|
13
13
|
...common.props,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "pcloud-download-files",
|
|
7
7
|
name: "Download File(s)",
|
|
8
8
|
description: "Download one or more files to a folder. [See the docs here](https://docs.pcloud.com/methods/file/downloadfile.html)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.3",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
...common.props,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "pcloud-list-contents",
|
|
7
7
|
name: "List Contents",
|
|
8
8
|
description: "Get the contents of the specified folder. [See the docs here](https://docs.pcloud.com/methods/folder/listfolder.html)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.3",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
...common.props,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import pcloud from "../../pcloud.app.mjs";
|
|
2
|
+
import common from "../common/base.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
...common,
|
|
6
|
+
key: "pcloud-move-file",
|
|
7
|
+
name: "Move File",
|
|
8
|
+
description: "Moves a file to the specified destination. [See the docs here](https://docs.pcloud.com/methods/file/renamefile.html)",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
props: {
|
|
12
|
+
...common.props,
|
|
13
|
+
fileId: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
pcloud,
|
|
16
|
+
"fileId",
|
|
17
|
+
],
|
|
18
|
+
description: `Select a **File** to move.
|
|
19
|
+
\\
|
|
20
|
+
Alternatively, you can provide a custom *File ID*.`,
|
|
21
|
+
},
|
|
22
|
+
toFolderId: {
|
|
23
|
+
propDefinition: [
|
|
24
|
+
pcloud,
|
|
25
|
+
"folderId",
|
|
26
|
+
],
|
|
27
|
+
label: "Destination Folder ID",
|
|
28
|
+
description: `Select a **Destination Folder** to put the file.
|
|
29
|
+
\\
|
|
30
|
+
Alternatively, you can provide a custom *Folder ID*.`,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
methods: {
|
|
34
|
+
...common.methods,
|
|
35
|
+
getSummary() {
|
|
36
|
+
return "Moved file successfully";
|
|
37
|
+
},
|
|
38
|
+
async requestMethod() {
|
|
39
|
+
return this.pcloud.moveFile(
|
|
40
|
+
this.fileId,
|
|
41
|
+
this.toFolderId,
|
|
42
|
+
);
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import pcloud from "../../pcloud.app.mjs";
|
|
2
|
+
import common from "../common/base.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
...common,
|
|
6
|
+
key: "pcloud-move-folder",
|
|
7
|
+
name: "Move Folder",
|
|
8
|
+
description: "Moves a folder to the specified destination. [See the docs here](https://docs.pcloud.com/methods/folder/renamefolder.html)",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
props: {
|
|
12
|
+
...common.props,
|
|
13
|
+
folderId: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
pcloud,
|
|
16
|
+
"folderId",
|
|
17
|
+
],
|
|
18
|
+
description: `Select a **Folder** to move.
|
|
19
|
+
\\
|
|
20
|
+
Alternatively, you can provide a custom *Folder ID*.`,
|
|
21
|
+
},
|
|
22
|
+
toFolderId: {
|
|
23
|
+
propDefinition: [
|
|
24
|
+
pcloud,
|
|
25
|
+
"folderId",
|
|
26
|
+
],
|
|
27
|
+
label: "Destination Folder ID",
|
|
28
|
+
description: `Select a **Destination Folder** to put the folder.
|
|
29
|
+
\\
|
|
30
|
+
Alternatively, you can provide a custom *Folder ID*.`,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
methods: {
|
|
34
|
+
...common.methods,
|
|
35
|
+
getSummary() {
|
|
36
|
+
return "Moved folder successfully";
|
|
37
|
+
},
|
|
38
|
+
async requestMethod() {
|
|
39
|
+
return this.pcloud.moveFolder(
|
|
40
|
+
this.folderId,
|
|
41
|
+
this.toFolderId,
|
|
42
|
+
);
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import pcloud from "../../pcloud.app.mjs";
|
|
2
|
+
import common from "../common/base.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
...common,
|
|
6
|
+
key: "pcloud-rename-file",
|
|
7
|
+
name: "Rename File",
|
|
8
|
+
description: "Renames a file. [See the docs here](https://docs.pcloud.com/methods/file/renamefile.html)",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
props: {
|
|
12
|
+
...common.props,
|
|
13
|
+
fileId: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
pcloud,
|
|
16
|
+
"fileId",
|
|
17
|
+
],
|
|
18
|
+
description: `Select a **File** to rename.
|
|
19
|
+
\\
|
|
20
|
+
Alternatively, you can provide a custom *File ID*.`,
|
|
21
|
+
},
|
|
22
|
+
toName: {
|
|
23
|
+
propDefinition: [
|
|
24
|
+
pcloud,
|
|
25
|
+
"name",
|
|
26
|
+
],
|
|
27
|
+
label: "New File Name",
|
|
28
|
+
description: "New name of the file.",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
...common.methods,
|
|
33
|
+
getSummary() {
|
|
34
|
+
return `Successfully renamed file to ${this.toName}`;
|
|
35
|
+
},
|
|
36
|
+
async requestMethod() {
|
|
37
|
+
return this.pcloud.renameFile(
|
|
38
|
+
this.fileId,
|
|
39
|
+
this.toName,
|
|
40
|
+
);
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import pcloud from "../../pcloud.app.mjs";
|
|
2
|
+
import common from "../common/base.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
...common,
|
|
6
|
+
key: "pcloud-rename-folder",
|
|
7
|
+
name: "Rename Folder",
|
|
8
|
+
description: "Renames a folder. [See the docs here](https://docs.pcloud.com/methods/folder/renamefolder.html)",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "action",
|
|
11
|
+
props: {
|
|
12
|
+
...common.props,
|
|
13
|
+
folderId: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
pcloud,
|
|
16
|
+
"folderId",
|
|
17
|
+
],
|
|
18
|
+
description: `Select a **Folder** to rename.
|
|
19
|
+
\\
|
|
20
|
+
Alternatively, you can provide a custom *Folder ID*.`,
|
|
21
|
+
},
|
|
22
|
+
toName: {
|
|
23
|
+
propDefinition: [
|
|
24
|
+
pcloud,
|
|
25
|
+
"name",
|
|
26
|
+
],
|
|
27
|
+
label: "New Folder Name",
|
|
28
|
+
description: "New name of the folder.",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
...common.methods,
|
|
33
|
+
getSummary() {
|
|
34
|
+
return `Successfully renamed folder to ${this.toName}`;
|
|
35
|
+
},
|
|
36
|
+
async requestMethod() {
|
|
37
|
+
return this.pcloud.renameFolder(
|
|
38
|
+
this.folderId,
|
|
39
|
+
this.toName,
|
|
40
|
+
);
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
name: "Upload File",
|
|
9
9
|
description:
|
|
10
10
|
"Upload a file to the specified folder. [See the docs here](https://docs.pcloud.com/methods/file/uploadfile.html)",
|
|
11
|
-
version: "0.0.
|
|
11
|
+
version: "0.0.3",
|
|
12
12
|
type: "action",
|
|
13
13
|
props: {
|
|
14
14
|
...common.props,
|
package/package.json
CHANGED
package/pcloud.app.mjs
CHANGED
|
@@ -161,6 +161,50 @@ export default {
|
|
|
161
161
|
params,
|
|
162
162
|
});
|
|
163
163
|
},
|
|
164
|
+
/**
|
|
165
|
+
* Takes one file and moves it to another location in the user's filesystem.
|
|
166
|
+
* pCloud API domain URL depends on the location of pCLoud data center associated to the
|
|
167
|
+
* account.
|
|
168
|
+
* @params {integer} fileId - ID of the file to move.
|
|
169
|
+
* @params {integer} toFolderId - ID of the destination folder.
|
|
170
|
+
* @returns {metadata: array, result: integer } An array with the [metadata](https://docs.pcloud.com/structures/metadata.html) of the newly copied file. A `result` integer that indicates the results of the API operation, 0 means success, a non-zero result means an error occurred, when the result is non-zero an `error` message is included.
|
|
171
|
+
*/
|
|
172
|
+
async moveFile(
|
|
173
|
+
fileId,
|
|
174
|
+
toFolderId,
|
|
175
|
+
) {
|
|
176
|
+
const params = {
|
|
177
|
+
fileid: fileId,
|
|
178
|
+
tofolderid: toFolderId,
|
|
179
|
+
};
|
|
180
|
+
return (
|
|
181
|
+
await this.api()
|
|
182
|
+
).api("renamefile", {
|
|
183
|
+
params,
|
|
184
|
+
});
|
|
185
|
+
},
|
|
186
|
+
/**
|
|
187
|
+
* Takes one file and renames it.
|
|
188
|
+
* pCloud API domain URL depends on the location of pCLoud data center associated to the
|
|
189
|
+
* account.
|
|
190
|
+
* @params {integer} fileId - ID of the file to rename.
|
|
191
|
+
* @params {string} toName - New name for the file.
|
|
192
|
+
* @returns {metadata: array, result: integer } An array with the [metadata](https://docs.pcloud.com/structures/metadata.html) of the newly copied file. A `result` integer that indicates the results of the API operation, 0 means success, a non-zero result means an error occurred, when the result is non-zero an `error` message is included.
|
|
193
|
+
*/
|
|
194
|
+
async renameFile(
|
|
195
|
+
fileId,
|
|
196
|
+
toName,
|
|
197
|
+
) {
|
|
198
|
+
const params = {
|
|
199
|
+
fileid: fileId,
|
|
200
|
+
toname: toName,
|
|
201
|
+
};
|
|
202
|
+
return (
|
|
203
|
+
await this.api()
|
|
204
|
+
).api("renamefile", {
|
|
205
|
+
params,
|
|
206
|
+
});
|
|
207
|
+
},
|
|
164
208
|
/**
|
|
165
209
|
* Copies a folder to the specified folder.
|
|
166
210
|
* @params {integer} folderId - ID of the folder to copy.
|
|
@@ -196,6 +240,50 @@ export default {
|
|
|
196
240
|
async createFolder(name, folderId) {
|
|
197
241
|
return (await this.api()).createfolder(name, folderId);
|
|
198
242
|
},
|
|
243
|
+
/**
|
|
244
|
+
* Takes one folder and moves it to another location in the user's filesystem.
|
|
245
|
+
* pCloud API domain URL depends on the location of pCLoud data center associated to the
|
|
246
|
+
* account.
|
|
247
|
+
* @params {integer} folderId - ID of the folder to move.
|
|
248
|
+
* @params {integer} toFolderId - ID of the destination folder.
|
|
249
|
+
* @returns {metadata: array, result: integer } An array with the [metadata](https://docs.pcloud.com/structures/metadata.html) of the newly copied file. A `result` integer that indicates the results of the API operation, 0 means success, a non-zero result means an error occurred, when the result is non-zero an `error` message is included.
|
|
250
|
+
*/
|
|
251
|
+
async moveFolder(
|
|
252
|
+
folderId,
|
|
253
|
+
toFolderId,
|
|
254
|
+
) {
|
|
255
|
+
const params = {
|
|
256
|
+
folderid: folderId,
|
|
257
|
+
tofolderid: toFolderId,
|
|
258
|
+
};
|
|
259
|
+
return (
|
|
260
|
+
await this.api()
|
|
261
|
+
).api("renamefolder", {
|
|
262
|
+
params,
|
|
263
|
+
});
|
|
264
|
+
},
|
|
265
|
+
/**
|
|
266
|
+
* Takes one folder and renames it.
|
|
267
|
+
* pCloud API domain URL depends on the location of pCLoud data center associated to the
|
|
268
|
+
* account.
|
|
269
|
+
* @params {integer} folderId - ID of the folder to rename.
|
|
270
|
+
* @params {string} toName - New name for the folder.
|
|
271
|
+
* @returns {metadata: array, result: integer } An array with the [metadata](https://docs.pcloud.com/structures/metadata.html) of the newly copied file. A `result` integer that indicates the results of the API operation, 0 means success, a non-zero result means an error occurred, when the result is non-zero an `error` message is included.
|
|
272
|
+
*/
|
|
273
|
+
async renameFolder(
|
|
274
|
+
folderId,
|
|
275
|
+
toName,
|
|
276
|
+
) {
|
|
277
|
+
const params = {
|
|
278
|
+
folderid: folderId,
|
|
279
|
+
toname: toName,
|
|
280
|
+
};
|
|
281
|
+
return (
|
|
282
|
+
await this.api()
|
|
283
|
+
).api("renamefolder", {
|
|
284
|
+
params,
|
|
285
|
+
});
|
|
286
|
+
},
|
|
199
287
|
/**
|
|
200
288
|
* Downloads one or more files from links supplied in the url parameter.
|
|
201
289
|
* @params {array} urls - URL(s) of the files to download.
|