Skip to content

Commit 24dae00

Browse files
optional folder id prop to avoid rate limiting
1 parent 5914a1b commit 24dae00

File tree

3 files changed

+38
-9
lines changed

3 files changed

+38
-9
lines changed

components/zoho_workdrive/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/zoho_workdrive",
3-
"version": "0.2.5",
3+
"version": "0.2.6",
44
"description": "Pipedream Zoho WorkDrive Components",
55
"main": "zoho_workdrive.app.mjs",
66
"keywords": [

components/zoho_workdrive/sources/new-file-in-folder/new-file-in-folder.mjs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform";
1+
import {
2+
ConfigurationError,
3+
DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
4+
} from "@pipedream/platform";
25
import app from "../../zoho_workdrive.app.mjs";
36
import { Readable } from "stream";
47
import { fileTypeFromBuffer } from "file-type";
@@ -7,7 +10,7 @@ import sampleEmit from "./test-event.mjs";
710
export default {
811
key: "zoho_workdrive-new-file-in-folder",
912
name: "New File In Folder",
10-
version: "0.1.0",
13+
version: "0.2.0",
1114
description: "Emit new event when a new file is created in a specific folder.",
1215
type: "source",
1316
dedupe: "unique",
@@ -46,7 +49,14 @@ export default {
4649
}),
4750
],
4851
label: "Folder Id",
49-
description: "The unique ID of the folder.",
52+
description: "Select the unique ID of the folder.",
53+
optional: true,
54+
},
55+
typedFolderId: {
56+
type: "string",
57+
label: "Typed Folder Id",
58+
description: "Type in the unique ID of the folder. Use this if you hit rate limits on the `Folder Id` prop.",
59+
optional: true,
5060
},
5161
includeLink: {
5262
label: "Include Link",
@@ -88,16 +98,21 @@ export default {
8898
const {
8999
app,
90100
folderId,
101+
typedFolderId,
91102
} = this;
92103

104+
if (!folderId && !typedFolderId) {
105+
throw new ConfigurationError("Please select a Folder Id or type in a Typed Folder Id.");
106+
}
107+
93108
const lastDate = this._getLastDate();
94109
let maxDate = lastDate;
95110
const items = app.paginate({
96111
fn: app.listFiles,
97112
maxResults,
98113
filter: "allfiles",
99114
sort: "created_time",
100-
folderId,
115+
folderId: folderId || typedFolderId,
101116
});
102117

103118
let responseArray = [];

components/zoho_workdrive/sources/new-folder/new-folder.mjs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform";
2-
import app from "../../zoho_workdrive.app.mjs";
1+
import {
2+
ConfigurationError,
3+
DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
4+
} from "@pipedream/platform";import app from "../../zoho_workdrive.app.mjs";
35
import sampleEmit from "./test-event.mjs";
46

57
export default {
68
key: "zoho_workdrive-new-folder",
79
name: "New Folder",
8-
version: "0.0.4",
10+
version: "0.1.0",
911
description: "Emit new event when a new folder is created in a specific folder.",
1012
type: "source",
1113
dedupe: "unique",
@@ -45,6 +47,13 @@ export default {
4547
],
4648
label: "Folder Id",
4749
description: "The unique ID of the folder.",
50+
optional: true,
51+
},
52+
typedFolderId: {
53+
type: "string",
54+
label: "Typed Folder Id",
55+
description: "Type in the unique ID of the folder. Use this if you hit rate limits on the `Folder Id` prop.",
56+
optional: true,
4857
},
4958
},
5059
methods: {
@@ -58,16 +67,21 @@ export default {
5867
const {
5968
app,
6069
folderId,
70+
typedFolderId,
6171
} = this;
6272

73+
if (!folderId && !typedFolderId) {
74+
throw new ConfigurationError("Please select a Folder Id or type in a Typed Folder Id.");
75+
}
76+
6377
const lastDate = this._getLastDate();
6478
let maxDate = lastDate;
6579
const items = app.paginate({
6680
fn: app.listFiles,
6781
maxResults,
6882
filter: "folder",
6983
sort: "created_time",
70-
folderId,
84+
folderId: folderId || typedFolderId,
7185
});
7286

7387
let responseArray = [];

0 commit comments

Comments
 (0)