Skip to content

Commit 7e5539b

Browse files
authored
Clockify - new components (#18989)
* new components * pnpm-lock.yaml * versions * update * pnpm-lock.yaml
1 parent 79c5390 commit 7e5539b

File tree

20 files changed

+712
-18
lines changed

20 files changed

+712
-18
lines changed

components/clockify/actions/add-members-to-project/add-members-to-project.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "clockify-add-members-to-project",
55
name: "Add Members To Project",
66
description: "Adds member(s) to a project in Clockify. [See the documentation](https://docs.clockify.me/#tag/Project/operation/updateMemberships)",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
annotations: {
99
destructiveHint: true,
1010
openWorldHint: true,

components/clockify/actions/add-task-to-project/add-task-to-project.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "clockify-add-task-to-project",
55
name: "Add Task To Project",
66
description: "Adds a task to a project in Clockify. [See the documentation](https://docs.clockify.me/#tag/Task/operation/create_7)",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/clockify/actions/create-project/create-project.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "clockify-create-project",
55
name: "Create Project",
66
description: "Creates a new project in Clockify. [See the documentation](https://docs.clockify.me/#tag/Project/operation/create_6)",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
import clockify from "../../clockify.app.mjs";
2+
3+
export default {
4+
name: "Get Time Entry Report",
5+
description: "Get a time entry report. [See the documentation](https://docs.clockify.me/#tag/Time-Entry-Report/operation/generateDetailedReport)",
6+
key: "clockify-get-time-entry-report",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
clockify,
16+
workspaceId: {
17+
propDefinition: [
18+
clockify,
19+
"workspaceId",
20+
],
21+
},
22+
dateRangeStart: {
23+
type: "string",
24+
label: "Date Range Start",
25+
description: "The start date of the date range. Format: YYYY-MM-DDTHH:MM:SS.ssssssZ",
26+
},
27+
dateRangeEnd: {
28+
type: "string",
29+
label: "Date Range End",
30+
description: "The end date of the date range. Format: YYYY-MM-DDTHH:MM:SS.ssssssZ",
31+
},
32+
clientIds: {
33+
propDefinition: [
34+
clockify,
35+
"clientId",
36+
(c) => ({
37+
workspaceId: c.workspaceId,
38+
}),
39+
],
40+
type: "string[]",
41+
label: "Client IDs",
42+
description: "Array of client identifiers",
43+
},
44+
projectId: {
45+
propDefinition: [
46+
clockify,
47+
"projectId",
48+
(c) => ({
49+
workspaceId: c.workspaceId,
50+
}),
51+
],
52+
optional: true,
53+
},
54+
taskIds: {
55+
propDefinition: [
56+
clockify,
57+
"taskId",
58+
(c) => ({
59+
workspaceId: c.workspaceId,
60+
projectId: c.projectId,
61+
}),
62+
],
63+
type: "string[]",
64+
label: "Task IDs",
65+
description: "Array of task identifiers",
66+
optional: true,
67+
},
68+
tagIds: {
69+
propDefinition: [
70+
clockify,
71+
"tagIds",
72+
(c) => ({
73+
workspaceId: c.workspaceId,
74+
}),
75+
],
76+
optional: true,
77+
},
78+
userIds: {
79+
propDefinition: [
80+
clockify,
81+
"memberIds",
82+
(c) => ({
83+
workspaceId: c.workspaceId,
84+
}),
85+
],
86+
optional: true,
87+
},
88+
},
89+
async run({ $ }) {
90+
const response = await this.clockify.getTimeEntryReport({
91+
$,
92+
workspaceId: this.workspaceId,
93+
data: {
94+
dateRangeStart: this.dateRangeStart,
95+
dateRangeEnd: this.dateRangeEnd,
96+
detailedFilter: {
97+
options: {
98+
totals: "CALCULATE",
99+
},
100+
},
101+
clients: this.clientIds
102+
? {
103+
contains: "CONTAINS",
104+
ids: this.clientIds,
105+
status: "ALL",
106+
}
107+
: undefined,
108+
projects: this.projectId
109+
? {
110+
contains: "CONTAINS",
111+
ids: [
112+
this.projectId,
113+
],
114+
status: "ALL",
115+
}
116+
: undefined,
117+
tasks: this.taskIds
118+
? {
119+
contains: "CONTAINS",
120+
ids: this.taskIds,
121+
status: "ALL",
122+
}
123+
: undefined,
124+
tags: this.tagIds
125+
? {
126+
contains: "CONTAINS",
127+
ids: this.tagIds,
128+
status: "ALL",
129+
}
130+
: undefined,
131+
users: this.userIds
132+
? {
133+
contains: "CONTAINS",
134+
ids: this.userIds,
135+
status: "ALL",
136+
}
137+
: undefined,
138+
},
139+
});
140+
141+
$.export("$summary", "Successfully retrieved time entry report");
142+
143+
return response;
144+
},
145+
};
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
import clockify from "../../clockify.app.mjs";
2+
3+
export default {
4+
key: "clockify-list-projects",
5+
name: "List Projects",
6+
description: "List all projects in a Clockify workspace. [See the documentation](https://docs.clockify.me/#tag/Project/operation/getProjects)",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
clockify,
16+
workspaceId: {
17+
propDefinition: [
18+
clockify,
19+
"workspaceId",
20+
],
21+
},
22+
name: {
23+
type: "string",
24+
label: "Name",
25+
description: "If provided, you'll get a filtered list of projects that contains the provided string in the project name",
26+
optional: true,
27+
},
28+
strictNameSearch: {
29+
propDefinition: [
30+
clockify,
31+
"strictNameSearch",
32+
],
33+
},
34+
archived: {
35+
type: "boolean",
36+
label: "Archived",
37+
description: "If set to `true`, you'll only get archived projects",
38+
optional: true,
39+
},
40+
billable: {
41+
type: "boolean",
42+
label: "Billable",
43+
description: "If set to `true`, you'll only get billable projects",
44+
optional: true,
45+
},
46+
clients: {
47+
propDefinition: [
48+
clockify,
49+
"clientId",
50+
(c) => ({
51+
workspaceId: c.workspaceId,
52+
}),
53+
],
54+
type: "string[]",
55+
label: "Clients",
56+
description: "Array of client identifiers",
57+
},
58+
containsClient: {
59+
type: "boolean",
60+
label: "Contains Client",
61+
description: "If set to `true`, you'll get a filtered list of projects that contain clients which match the provided id(s) in 'clients' field. If set to `false`, you'll get a filtered list of projects which do NOT contain clients that match the provided id(s) in 'clients' field.",
62+
optional: true,
63+
},
64+
clientStatus: {
65+
type: "string",
66+
label: "Client Status",
67+
description: "Filters projects based on client status provided",
68+
optional: true,
69+
options: [
70+
"ACTIVE",
71+
"ARCHIVED",
72+
"ALL",
73+
],
74+
},
75+
users: {
76+
propDefinition: [
77+
clockify,
78+
"memberIds",
79+
(c) => ({
80+
workspaceId: c.workspaceId,
81+
}),
82+
],
83+
label: "Users",
84+
description: "Array of member/user identifiers",
85+
optional: true,
86+
},
87+
containsUser: {
88+
type: "boolean",
89+
label: "Contains User",
90+
description: "If set to `true`, you'll get a filtered list of projects that contain users which match the provided id(s) in 'users' field. If set to `false`, you'll get a filtered list of projects which do NOT contain users that match the provided id(s) in 'users' field.",
91+
optional: true,
92+
},
93+
userStatus: {
94+
type: "string",
95+
label: "User Status",
96+
description: "Filters projects based on user status provided",
97+
optional: true,
98+
options: [
99+
"PENDING",
100+
"ACTIVE",
101+
"DECLINED",
102+
"INACTIVE",
103+
"ALL",
104+
],
105+
},
106+
isTemplate: {
107+
type: "boolean",
108+
label: "Is Template",
109+
description: "Filters projects based on whether they are used as a template or not",
110+
optional: true,
111+
},
112+
sortColumn: {
113+
type: "string",
114+
label: "Sort Column",
115+
description: "The column to sort the projects by",
116+
optional: true,
117+
options: [
118+
"ID",
119+
"NAME",
120+
"CLIENT_NAME",
121+
"DURATION",
122+
"BUDGET",
123+
"PROGRESS",
124+
],
125+
},
126+
sortOrder: {
127+
propDefinition: [
128+
clockify,
129+
"sortOrder",
130+
],
131+
},
132+
hydrated: {
133+
propDefinition: [
134+
clockify,
135+
"hydrated",
136+
],
137+
},
138+
access: {
139+
type: "string",
140+
label: "Access",
141+
description: "If provided, you'll get a filtered list of projects that matches the provided access",
142+
optional: true,
143+
options: [
144+
"PUBLIC",
145+
"PRIVATE",
146+
],
147+
},
148+
page: {
149+
propDefinition: [
150+
clockify,
151+
"page",
152+
],
153+
},
154+
pageSize: {
155+
propDefinition: [
156+
clockify,
157+
"pageSize",
158+
],
159+
},
160+
},
161+
async run({ $ }) {
162+
const response = await this.clockify.listProjects({
163+
$,
164+
workspaceId: this.workspaceId,
165+
params: {
166+
"name": this.name,
167+
"strict-name-search": this.strictNameSearch,
168+
"archived": this.archived,
169+
"billable": this.billable,
170+
"clients": this.clients,
171+
"contains-client": this.containsClient,
172+
"client-status": this.clientStatus,
173+
"users": this.users,
174+
"contains-user": this.containsUser,
175+
"user-status": this.userStatus,
176+
"is-template": this.isTemplate,
177+
"sort-column": this.sortColumn,
178+
"sort-order": this.sortOrder,
179+
"hydrated": this.hydrated,
180+
"access": this.access,
181+
"page": this.page,
182+
"page-size": this.pageSize,
183+
},
184+
});
185+
186+
$.export("$summary", `Successfully listed ${response.length} projects in the workspace`);
187+
188+
return response;
189+
},
190+
};

0 commit comments

Comments
 (0)