Skip to content

Commit 6859233

Browse files
Allow passing start_date, end_date, since, before, meta, include_sharing to Get Time Entries action (PipedreamHQ#16536)
1 parent a9f7999 commit 6859233

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

components/toggl/actions/get-time-entries/get-time-entries.mjs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,53 @@ export default {
88
type: "action",
99
props: {
1010
toggl,
11+
startDate: {
12+
type: "string",
13+
label: "Start Date",
14+
description: "Get entries with start time, from start_date YYYY-MM-DD or with time in RFC3339 format. To be used with end_date.",
15+
optional: true,
16+
},
17+
endDate: {
18+
type: "string",
19+
label: "End Date",
20+
description: "Get entries with start time, until end_date YYYY-MM-DD or with time in RFC3339 format. To be used with start_date.",
21+
optional: true,
22+
},
23+
since: {
24+
type: "string",
25+
label: "Since (UNIX timestamp)",
26+
description: "Get entries modified since this date using UNIX timestamp, including deleted ones.",
27+
optional: true,
28+
},
29+
before: {
30+
type: "string",
31+
label: "Before",
32+
description: "Get entries with start time, before given date (YYYY-MM-DD) or with time in RFC3339 format.",
33+
optional: true,
34+
},
35+
meta: {
36+
type: "boolean",
37+
label: "Meta",
38+
description: "Should the response contain data for meta entities.",
39+
optional: true,
40+
},
41+
includeSharing: {
42+
type: "boolean",
43+
label: "Include Sharing",
44+
description: "Include sharing details in the response.",
45+
optional: true,
46+
},
1147
},
1248
async run({ $ }) {
49+
const params = {};
50+
if (this.startDate) params.start_date = this.startDate;
51+
if (this.endDate) params.end_date = this.endDate;
52+
if (this.since) params.since = this.since;
53+
if (this.before) params.before = this.before;
54+
if (typeof this.meta === "boolean") params.meta = this.meta;
55+
if (typeof this.includeSharing === "boolean") params.include_sharing = this.includeSharing;
1356
const response = await this.toggl.getTimeEntries({
57+
params,
1458
$,
1559
});
1660

0 commit comments

Comments
 (0)