Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "clockify-add-members-to-project",
name: "Add Members To Project",
description: "Adds member(s) to a project in Clockify. [See the documentation](https://docs.clockify.me/#tag/Project/operation/updateMemberships)",
version: "0.0.2",
version: "0.0.3",
annotations: {
destructiveHint: true,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "clockify-add-task-to-project",
name: "Add Task To Project",
description: "Adds a task to a project in Clockify. [See the documentation](https://docs.clockify.me/#tag/Task/operation/create_7)",
version: "0.0.2",
version: "0.0.3",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "clockify-create-project",
name: "Create Project",
description: "Creates a new project in Clockify. [See the documentation](https://docs.clockify.me/#tag/Project/operation/create_6)",
version: "0.0.2",
version: "0.0.3",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
import clockify from "../../clockify.app.mjs";

export default {
name: "Get Time Entry Report",
description: "Get a time entry report. [See the documentation](https://docs.clockify.me/#tag/Time-Entry-Report/operation/generateDetailedReport)",
key: "clockify-get-time-entry-report",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
clockify,
workspaceId: {
propDefinition: [
clockify,
"workspaceId",
],
},
dateRangeStart: {
type: "string",
label: "Date Range Start",
description: "The start date of the date range. Format: YYYY-MM-DDTHH:MM:SS.ssssssZ",
},
dateRangeEnd: {
type: "string",
label: "Date Range End",
description: "The end date of the date range. Format: YYYY-MM-DDTHH:MM:SS.ssssssZ",
},
clientIds: {
propDefinition: [
clockify,
"clientId",
(c) => ({
workspaceId: c.workspaceId,
}),
],
type: "string[]",
label: "Client IDs",
description: "Array of client identifiers",
},
projectId: {
propDefinition: [
clockify,
"projectId",
(c) => ({
workspaceId: c.workspaceId,
}),
],
optional: true,
},
taskIds: {
propDefinition: [
clockify,
"taskId",
(c) => ({
workspaceId: c.workspaceId,
projectId: c.projectId,
}),
],
type: "string[]",
label: "Task IDs",
description: "Array of task identifiers",
optional: true,
},
tagIds: {
propDefinition: [
clockify,
"tagIds",
(c) => ({
workspaceId: c.workspaceId,
}),
],
optional: true,
},
userIds: {
propDefinition: [
clockify,
"memberIds",
(c) => ({
workspaceId: c.workspaceId,
}),
],
optional: true,
},
},
async run({ $ }) {
const response = await this.clockify.getTimeEntryReport({
$,
workspaceId: this.workspaceId,
data: {
dateRangeStart: this.dateRangeStart,
dateRangeEnd: this.dateRangeEnd,
detailedFilter: {
options: {
totals: "CALCULATE",
},
},
clients: this.clientIds
? {
contains: "CONTAINS",
ids: this.clientIds,
status: "ALL",
}
: undefined,
projects: this.projectId
? {
contains: "CONTAINS",
ids: [
this.projectId,
],
status: "ALL",
}
: undefined,
tasks: this.taskIds
? {
contains: "CONTAINS",
ids: this.taskIds,
status: "ALL",
}
: undefined,
tags: this.tagIds
? {
contains: "CONTAINS",
ids: this.tagIds,
status: "ALL",
}
: undefined,
users: this.userIds
? {
contains: "CONTAINS",
ids: this.userIds,
status: "ALL",
}
: undefined,
},
});

$.export("$summary", "Successfully retrieved time entry report");

return response;
},
};
190 changes: 190 additions & 0 deletions components/clockify/actions/list-projects/list-projects.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
import clockify from "../../clockify.app.mjs";

export default {
key: "clockify-list-projects",
name: "List Projects",
description: "List all projects in a Clockify workspace. [See the documentation](https://docs.clockify.me/#tag/Project/operation/getProjects)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
clockify,
workspaceId: {
propDefinition: [
clockify,
"workspaceId",
],
},
name: {
type: "string",
label: "Name",
description: "If provided, you'll get a filtered list of projects that contains the provided string in the project name",
optional: true,
},
strictNameSearch: {
propDefinition: [
clockify,
"strictNameSearch",
],
},
archived: {
type: "boolean",
label: "Archived",
description: "If set to `true`, you'll only get archived projects",
optional: true,
},
billable: {
type: "boolean",
label: "Billable",
description: "If set to `true`, you'll only get billable projects",
optional: true,
},
clients: {
propDefinition: [
clockify,
"clientId",
(c) => ({
workspaceId: c.workspaceId,
}),
],
type: "string[]",
label: "Clients",
description: "Array of client identifiers",
},
containsClient: {
type: "boolean",
label: "Contains Client",
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.",
optional: true,
},
clientStatus: {
type: "string",
label: "Client Status",
description: "Filters projects based on client status provided",
optional: true,
options: [
"ACTIVE",
"ARCHIVED",
"ALL",
],
},
users: {
propDefinition: [
clockify,
"memberIds",
(c) => ({
workspaceId: c.workspaceId,
}),
],
label: "Users",
description: "Array of member/user identifiers",
optional: true,
},
containsUser: {
type: "boolean",
label: "Contains User",
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.",
optional: true,
},
userStatus: {
type: "string",
label: "User Status",
description: "Filters projects based on user status provided",
optional: true,
options: [
"PENDING",
"ACTIVE",
"DECLINED",
"INACTIVE",
"ALL",
],
},
isTemplate: {
type: "boolean",
label: "Is Template",
description: "Filters projects based on whether they are used as a template or not",
optional: true,
},
sortColumn: {
type: "string",
label: "Sort Column",
description: "The column to sort the projects by",
optional: true,
options: [
"ID",
"NAME",
"CLIENT_NAME",
"DURATION",
"BUDGET",
"PROGRESS",
],
},
sortOrder: {
propDefinition: [
clockify,
"sortOrder",
],
},
hydrated: {
propDefinition: [
clockify,
"hydrated",
],
},
access: {
type: "string",
label: "Access",
description: "If provided, you'll get a filtered list of projects that matches the provided access",
optional: true,
options: [
"PUBLIC",
"PRIVATE",
],
},
page: {
propDefinition: [
clockify,
"page",
],
},
pageSize: {
propDefinition: [
clockify,
"pageSize",
],
},
},
async run({ $ }) {
const response = await this.clockify.listProjects({
$,
workspaceId: this.workspaceId,
params: {
"name": this.name,
"strict-name-search": this.strictNameSearch,
"archived": this.archived,
"billable": this.billable,
"clients": this.clients,
"contains-client": this.containsClient,
"client-status": this.clientStatus,
"users": this.users,
"contains-user": this.containsUser,
"user-status": this.userStatus,
"is-template": this.isTemplate,
"sort-column": this.sortColumn,
"sort-order": this.sortOrder,
"hydrated": this.hydrated,
"access": this.access,
"page": this.page,
"page-size": this.pageSize,
},
});

$.export("$summary", `Successfully listed ${response.length} projects in the workspace`);

return response;
},
};
Loading
Loading