AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
feat(clockify): let AI agents track time and manage projects, tasks, clients and reports (#16699)
Kishan Parmar738d839a12a5
diff --git a/bun.lock b/bun.lockindex 0dde0783594..b171b787852 100644--- a/bun.lock+++ b/bun.lock@@ -2017,7 +2017,7 @@},"packages/pieces/community/clockify": {"name": "@activepieces/piece-clockify",- "version": "0.2.1",+ "version": "0.3.0","dependencies": {"@activepieces/core-piece-types": "workspace:*","@activepieces/core-utils": "workspace:*",diff --git a/packages/pieces/community/clockify/package.json b/packages/pieces/community/clockify/package.jsonindex cf6db0a09e7..b5d2bc24926 100644--- a/packages/pieces/community/clockify/package.json+++ b/packages/pieces/community/clockify/package.json@@ -1,6 +1,6 @@{"name": "@activepieces/piece-clockify",- "version": "0.2.1",+ "version": "0.3.0","main": "./dist/src/index.js","types": "./dist/src/index.d.ts","scripts": {diff --git a/packages/pieces/community/clockify/src/i18n/translation.json b/packages/pieces/community/clockify/src/i18n/translation.jsonindex 9f835209fba..7dea0359f48 100644--- a/packages/pieces/community/clockify/src/i18n/translation.json+++ b/packages/pieces/community/clockify/src/i18n/translation.json@@ -7,6 +7,91 @@"Find Task": "Find Task","Find Time Entry": "Find Time Entry","Find Running Timer": "Find Running Timer",+ "Add User Role": "Add User Role",+ "Add User to Group": "Add User to Group",+ "Assign Project Users": "Assign Project Users",+ "Bulk Delete Time Entries": "Bulk Delete Time Entries",+ "Bulk Update Time Entries": "Bulk Update Time Entries",+ "Create Client": "Create Client",+ "Create Holiday": "Create Holiday",+ "Create Project from Template": "Create Project from Template",+ "Create Project": "Create Project",+ "Create Shared Report": "Create Shared Report",+ "Create Tag": "Create Tag",+ "Create Template": "Create Template",+ "Create User Group": "Create User Group",+ "Create User Time Entry": "Create User Time Entry",+ "Create Workspace": "Create Workspace",+ "Delete Client": "Delete Client",+ "Delete Holiday": "Delete Holiday",+ "Delete Project": "Delete Project",+ "Delete Shared Report": "Delete Shared Report",+ "Delete Tag": "Delete Tag",+ "Delete Task": "Delete Task",+ "Delete Template": "Delete Template",+ "Delete Time Entry": "Delete Time Entry",+ "Delete User Group": "Delete User Group",+ "Duplicate Time Entry": "Duplicate Time Entry",+ "Generate Attendance Report": "Generate Attendance Report",+ "Generate Detailed Report": "Generate Detailed Report",+ "Generate Expense Report": "Generate Expense Report",+ "Generate Summary Report": "Generate Summary Report",+ "Generate Weekly Report": "Generate Weekly Report",+ "Get Client": "Get Client",+ "Get Current User": "Get Current User",+ "Get Member Profile": "Get Member Profile",+ "Get Project": "Get Project",+ "Get Shared Report": "Get Shared Report",+ "Get Tag": "Get Tag",+ "Get Task": "Get Task",+ "Get Template": "Get Template",+ "Get Time Entries by IDs": "Get Time Entries by IDs",+ "Get Time Entry": "Get Time Entry",+ "Get Workspace": "Get Workspace",+ "List Assignments": "List Assignments",+ "List Clients": "List Clients",+ "List Created Entities": "List Created Entities",+ "List Custom Fields": "List Custom Fields",+ "List Holidays in Period": "List Holidays in Period",+ "List Holidays": "List Holidays",+ "List Project Custom Fields": "List Project Custom Fields",+ "List Projects": "List Projects",+ "List Running Time Entries": "List Running Time Entries",+ "List Shared Reports": "List Shared Reports",+ "List Tags": "List Tags",+ "List Tasks": "List Tasks",+ "List Templates": "List Templates",+ "List Time Entries": "List Time Entries",+ "List User Groups": "List User Groups",+ "List User Managers": "List User Managers",+ "List Users": "List Users",+ "List Workspaces": "List Workspaces",+ "Mark Time Entries Invoiced": "Mark Time Entries Invoiced",+ "Remove User from Group": "Remove User from Group",+ "Remove User Role": "Remove User Role",+ "Update Client": "Update Client",+ "Update Holiday": "Update Holiday",+ "Update Member Profile": "Update Member Profile",+ "Update Project Estimate": "Update Project Estimate",+ "Replace Project Members": "Replace Project Members",+ "Update Project Template": "Update Project Template",+ "Update Project User Billable Rate": "Update Project User Billable Rate",+ "Update Project User Cost Rate": "Update Project User Cost Rate",+ "Update Project": "Update Project",+ "Update Shared Report": "Update Shared Report",+ "Update Tag": "Update Tag",+ "Update Task Billable Rate": "Update Task Billable Rate",+ "Update Task Cost Rate": "Update Task Cost Rate",+ "Update Task": "Update Task",+ "Update Template": "Update Template",+ "Update Time Entry": "Update Time Entry",+ "Update User Billable Rate": "Update User Billable Rate",+ "Update User Cost Rate": "Update User Cost Rate",+ "Update User Custom Field": "Update User Custom Field",+ "Update User Group": "Update User Group",+ "Update User Status": "Update User Status",+ "Update Workspace Billable Rate": "Update Workspace Billable Rate",+ "Update Workspace Cost Rate": "Update Workspace Cost Rate","Custom API Call": "Custom API Call","Creates a new in a specific project.": "Creates a new in a specific project.","Creates a new time entry.": "Creates a new time entry.",@@ -15,6 +100,95 @@"Finds an existing task in a specific project.": "Finds an existing task in a specific project.","Finds a time entry by description, start datetime or end datetime.": "Finds a time entry by description, start datetime or end datetime.","Finds currently running timer on specified workspace.": "Finds currently running timer on specified workspace.",+ "Gives a user an admin or manager role.": "Gives a user an admin or manager role.",+ "Adds a workspace member to a user group.": "Adds a workspace member to a user group.",+ "Adds or removes users on a project.": "Adds or removes users on a project.",+ "Deletes several of a user's time entries.": "Deletes several of a user's time entries.",+ "Applies the same change to several of a user's time entries.": "Applies the same change to several of a user's time entries.",+ "Creates a client in a workspace.": "Creates a client in a workspace.",+ "Adds a holiday to a workspace.": "Adds a holiday to a workspace.",+ "Creates a project from a template project.": "Creates a project from a template project.",+ "Creates a project in a workspace.": "Creates a project in a workspace.",+ "Saves a detailed, summary or weekly report as a shareable link.": "Saves a detailed, summary or weekly report as a shareable link.",+ "Creates a tag in a workspace.": "Creates a tag in a workspace.",+ "Creates a task in a project.": "Creates a task in a project.",+ "Creates a timesheet template.": "Creates a timesheet template.",+ "Logs a finished time entry for yourself.": "Logs a finished time entry for yourself.",+ "Creates a user group in a workspace.": "Creates a user group in a workspace.",+ "Logs time for another workspace member.": "Logs time for another workspace member.",+ "Creates a new workspace.": "Creates a new workspace.",+ "Deletes an archived client.": "Deletes an archived client.",+ "Deletes a holiday.": "Deletes a holiday.",+ "Deletes an archived project.": "Deletes an archived project.",+ "Deletes a shared report.": "Deletes a shared report.",+ "Deletes a tag.": "Deletes a tag.",+ "Deletes a task marked Done.": "Deletes a task marked Done.",+ "Deletes a timesheet template.": "Deletes a timesheet template.",+ "Deletes a time entry.": "Deletes a time entry.",+ "Deletes a user group.": "Deletes a user group.",+ "Copies a time entry.": "Copies a time entry.",+ "Daily first-in, last-out and break times per user.": "Daily first-in, last-out and break times per user.",+ "Lists every time entry in a period across the workspace.": "Lists every time entry in a period across the workspace.",+ "Lists expenses in a period.": "Lists expenses in a period.",+ "Totals tracked time in a period, grouped.": "Totals tracked time in a period, grouped.",+ "Tracked time per day of the week, by project or user.": "Tracked time per day of the week, by project or user.",+ "Gets a client by ID.": "Gets a client by ID.",+ "Gets the user the connection belongs to.": "Gets the user the connection belongs to.",+ "Gets a workspace member's profile.": "Gets a workspace member's profile.",+ "Gets a project by ID.": "Gets a project by ID.",+ "Runs a shared report and returns its data.": "Runs a shared report and returns its data.",+ "Gets a tag by ID.": "Gets a tag by ID.",+ "Gets a task by ID.": "Gets a task by ID.",+ "Gets a timesheet template by ID.": "Gets a timesheet template by ID.",+ "Gets several time entries by ID.": "Gets several time entries by ID.",+ "Gets a time entry by ID.": "Gets a time entry by ID.",+ "Gets a workspace by ID.": "Gets a workspace by ID.",+ "Lists scheduled assignments in a period.": "Lists scheduled assignments in a period.",+ "Lists or searches the clients of a workspace.": "Lists or searches the clients of a workspace.",+ "Lists records of one type created in a period.": "Lists records of one type created in a period.",+ "Lists the custom fields of a workspace.": "Lists the custom fields of a workspace.",+ "Lists the holidays of a user between two dates.": "Lists the holidays of a user between two dates.",+ "Lists the holidays of a workspace.": "Lists the holidays of a workspace.",+ "Lists the custom fields of a project.": "Lists the custom fields of a project.",+ "Lists or searches the projects of a workspace.": "Lists or searches the projects of a workspace.",+ "Lists every running timer in a workspace.": "Lists every running timer in a workspace.",+ "Lists the shared reports of a workspace.": "Lists the shared reports of a workspace.",+ "Lists or searches the tags of a workspace.": "Lists or searches the tags of a workspace.",+ "Lists or searches the tasks of a project.": "Lists or searches the tasks of a project.",+ "Lists the timesheet templates of a workspace.": "Lists the timesheet templates of a workspace.",+ "Lists or searches a user's time entries.": "Lists or searches a user's time entries.",+ "Lists or searches the user groups of a workspace.": "Lists or searches the user groups of a workspace.",+ "Lists a user's team managers.": "Lists a user's team managers.",+ "Lists or searches the members of a workspace.": "Lists or searches the members of a workspace.",+ "Lists the workspaces you belong to.": "Lists the workspaces you belong to.",+ "Marks time entries as invoiced or not invoiced.": "Marks time entries as invoiced or not invoiced.",+ "Removes a member from a user group.": "Removes a member from a user group.",+ "Removes an admin or manager role from a user.": "Removes an admin or manager role from a user.",+ "Starts a running timer for yourself.": "Starts a running timer for yourself.",+ "Stops a user's running timer.": "Stops a user's running timer.",+ "Updates or archives a client.": "Updates or archives a client.",+ "Changes a holiday.": "Changes a holiday.",+ "Updates a workspace member's profile.": "Updates a workspace member's profile.",+ "Sets the time or budget estimate of a project.": "Sets the time or budget estimate of a project.",+ "Replaces the whole member list of a project.": "Replaces the whole member list of a project.",+ "Marks a project as a template or not.": "Marks a project as a template or not.",+ "Sets a member billable rate on one project.": "Sets a member billable rate on one project.",+ "Sets a member cost rate on one project.": "Sets a member cost rate on one project.",+ "Updates or archives a project.": "Updates or archives a project.",+ "Renames a shared report or changes who can see it.": "Renames a shared report or changes who can see it.",+ "Renames, archives or unarchives a tag.": "Renames, archives or unarchives a tag.",+ "Sets the billable rate of a task.": "Sets the billable rate of a task.",+ "Sets the cost rate of a task.": "Sets the cost rate of a task.",+ "Updates, completes or reopens a task.": "Updates, completes or reopens a task.",+ "Renames a timesheet template.": "Renames a timesheet template.",+ "Updates a time entry.": "Updates a time entry.",+ "Sets a user's billable rate in a workspace.": "Sets a user's billable rate in a workspace.",+ "Sets a user's cost rate in a workspace.": "Sets a user's cost rate in a workspace.",+ "Sets the value of a user's custom field.": "Sets the value of a user's custom field.",+ "Renames a user group.": "Renames a user group.",+ "Activates or deactivates a workspace member.": "Activates or deactivates a workspace member.",+ "Sets the default billable rate of a workspace.": "Sets the default billable rate of a workspace.",+ "Sets the default cost rate of a workspace.": "Sets the default cost rate of a workspace.","Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint","Workspace": "Workspace","Project": "Project",@@ -28,6 +202,87 @@"Billable": "Billable","Tags": "Tags","Exact Match ?": "Exact Match ?",+ "Workspace ID": "Workspace ID",+ "User ID": "User ID",+ "Role": "Role",+ "Entity ID": "Entity ID",+ "Entity Is a User Group": "Entity Is a User Group",+ "User Group ID": "User Group ID",+ "Project ID": "Project ID",+ "User IDs": "User IDs",+ "Remove": "Remove",+ "Time Entry IDs": "Time Entry IDs",+ "Description": "Description",+ "Task ID": "Task ID",+ "Tag IDs": "Tag IDs",+ "Name": "Name",+ "Email": "Email",+ "Address": "Address",+ "Note": "Note",+ "Start Date": "Start Date",+ "End Date": "End Date",+ "User Group IDs": "User Group IDs",+ "Everyone": "Everyone",+ "Repeats Yearly": "Repeats Yearly",+ "Template Project ID": "Template Project ID",+ "Client ID": "Client ID",+ "Color": "Color",+ "Public": "Public",+ "Billable Rate": "Billable Rate",+ "Type": "Type",+ "From": "From",+ "To": "To",+ "Project IDs": "Project IDs",+ "Fixed Period": "Fixed Period",+ "Visible to Users": "Visible to Users",+ "Visible to User Groups": "Visible to User Groups",+ "Assignee IDs": "Assignee IDs",+ "Estimate": "Estimate",+ "Start": "Start",+ "End": "End",+ "Organization ID": "Organization ID",+ "Holiday ID": "Holiday ID",+ "Shared Report ID": "Shared Report ID",+ "Tag ID": "Tag ID",+ "Template ID": "Template ID",+ "Time Entry ID": "Time Entry ID",+ "Client IDs": "Client IDs",+ "Page": "Page",+ "Page Size": "Page Size",+ "Group By": "Group By",+ "Include Memberships": "Include Memberships",+ "Include Details": "Include Details",+ "Archived": "Archived",+ "Record Type": "Record Type",+ "Limit": "Limit",+ "Applies To": "Applies To",+ "Assigned To": "Assigned To",+ "Exact Name Match": "Exact Name Match",+ "Template": "Template",+ "Which Reports": "Which Reports",+ "Active": "Active",+ "Running Only": "Running Only",+ "Include Team Managers": "Include Team Managers",+ "Roles": "Roles",+ "Include Roles": "Include Roles",+ "Invoiced": "Invoiced",+ "Archive Projects Too": "Archive Projects Too",+ "Mark Tasks as Done": "Mark Tasks as Done",+ "Week Start": "Week Start",+ "Work Capacity": "Work Capacity",+ "Working Days": "Working Days",+ "Time Estimate": "Time Estimate",+ "Budget Estimate": "Budget Estimate",+ "Reset": "Reset",+ "Disable Time Estimate": "Disable Time Estimate",+ "Disable Budget Estimate": "Disable Budget Estimate",+ "Is Template": "Is Template",+ "Amount": "Amount",+ "Apply Since": "Apply Since",+ "Include Approved Entries": "Include Approved Entries",+ "Custom Field ID": "Custom Field ID",+ "Value": "Value",+ "Currency": "Currency","Method": "Method","Headers": "Headers","Query Parameters": "Query Parameters",@@ -37,21 +292,225 @@"Return Error as Output": "Return Error as Output","Timeout": "Timeout","Follow redirects": "Follow redirects",+ "Workspace ID. Use List Workspaces to find it.": "Workspace ID. Use List Workspaces to find it.",+ "User ID. Use List Users, or Get Current User for yourself.": "User ID. Use List Users, or Get Current User for yourself.",+ "What the role applies to. Workspace Admin: the workspace ID. Team Manager: the ID of the user (or user group) to manage. Project Manager: the project ID.": "What the role applies to. Workspace Admin: the workspace ID. Team Manager: the ID of the user (or user group) to manage. Project Manager: the project ID.",+ "Team Manager only: set when Entity ID is a user group ID rather than a user ID. Default false.": "Team Manager only: set when Entity ID is a user group ID rather than a user ID. Default false.",+ "User group ID. Use List User Groups to find it.": "User group ID. Use List User Groups to find it.",+ "Project ID. Use List Projects to find it.": "Project ID. Use List Projects to find it.",+ "User IDs to add or remove. Use List Users to find them.": "User IDs to add or remove. Use List Users to find them.",+ "Remove these users instead of adding them. Default false.": "Remove these users instead of adding them. Default false.",+ "User ID. Empty = the connected user. Another user needs workspace admin.": "User ID. Empty = the connected user. Another user needs workspace admin.",+ "Time entry IDs. Use List Time Entries to find them.": "Time entry IDs. Use List Time Entries to find them.",+ "IDs of the entries to change, all belonging to the user. Use List Time Entries to find them.": "IDs of the entries to change, all belonging to the user. Use List Time Entries to find them.",+ "What the time was spent on.": "What the time was spent on.",+ "New project ID. Empty = unchanged.": "New project ID. Empty = unchanged.",+ "New task ID. Empty = unchanged.": "New task ID. Empty = unchanged.",+ "Replaces the tags. Empty = unchanged.": "Replaces the tags. Empty = unchanged.",+ "Billable (Yes) or not (No). Empty = unchanged.": "Billable (Yes) or not (No). Empty = unchanged.",+ "Client name, unique in the workspace.": "Client name, unique in the workspace.",+ "First day, YYYY-MM-DD.": "First day, YYYY-MM-DD.",+ "Last day, YYYY-MM-DD. Same as Start Date for one day.": "Last day, YYYY-MM-DD. Same as Start Date for one day.",+ "Users it applies to. Use List Users.": "Users it applies to. Use List Users.",+ "User groups it applies to. Use List User Groups.": "User groups it applies to. Use List User Groups.",+ "Applies to all current and future members; User IDs and User Group IDs are then ignored. Default true.": "Applies to all current and future members; User IDs and User Group IDs are then ignored. Default true.",+ "Default false.": "Default false.",+ "ID of a template project. Use List Projects with Template = Yes.": "ID of a template project. Use List Projects with Template = Yes.",+ "Optional client ID. Use List Clients to find it.": "Optional client ID. Use List Clients to find it.",+ "Hex color, for example #03A9F4.": "Hex color, for example #03A9F4.",+ "Every workspace member can track time on it. Default false.": "Every workspace member can track time on it. Default false.",+ "Time on this project is billable by default. Default false.": "Time on this project is billable by default. Default false.",+ "Every workspace member can track time on it. Default false (only members).": "Every workspace member can track time on it. Default false (only members).",+ "Optional project billable rate in cents, for example 5000 for 50.00.": "Optional project billable rate in cents, for example 5000 for 50.00.",+ "Start of the report period, ISO 8601, for example 2026-10-01T00:00:00Z.": "Start of the report period, ISO 8601, for example 2026-10-01T00:00:00Z.",+ "End of the report period, ISO 8601, for example 2026-10-31T23:59:59Z.": "End of the report period, ISO 8601, for example 2026-10-31T23:59:59Z.",+ "Optional: only these projects.": "Optional: only these projects.",+ "Optional: only these users.": "Optional: only these users.",+ "Anyone with the link can view it. Default false.": "Anyone with the link can view it. Default false.",+ "Viewers cannot change the period. Default false.": "Viewers cannot change the period. Default false.",+ "User IDs that can view it.": "User IDs that can view it.",+ "User group IDs that can view it.": "User group IDs that can view it.",+ "Tag name, unique in the workspace.": "Tag name, unique in the workspace.",+ "Default Active.": "Default Active.",+ "User IDs to assign. Use List Users to find them.": "User IDs to assign. Use List Users to find them.",+ "User group IDs to assign. Use List User Groups to find them.": "User group IDs to assign. Use List User Groups to find them.",+ "Time estimate as an ISO 8601 duration, for example PT8H.": "Time estimate as an ISO 8601 duration, for example PT8H.",+ "Projects to put on the template, one row each. Use List Projects.": "Projects to put on the template, one row each. Use List Projects.",+ "ISO 8601 start datetime, for example 2026-10-21T09:00:00Z.": "ISO 8601 start datetime, for example 2026-10-21T09:00:00Z.",+ "ISO 8601 end datetime, after Start.": "ISO 8601 end datetime, after Start.",+ "Optional project ID. Use List Projects to find it.": "Optional project ID. Use List Projects to find it.",+ "Optional task ID in that project. Use List Tasks to find it.": "Optional task ID in that project. Use List Tasks to find it.",+ "Tag IDs to put on the time entry. Use List Tags to find them.": "Tag IDs to put on the time entry. Use List Tags to find them.",+ "Name of the group, unique in the workspace.": "Name of the group, unique in the workspace.",+ "ISO 8601 end datetime. Empty = start a running timer.": "ISO 8601 end datetime. Empty = start a running timer.",+ "Name of the new workspace.": "Name of the new workspace.",+ "Optional organization to create the workspace in: the cakeOrganizationId of an existing workspace (Get Workspace). Empty = the organization of your active workspace.": "Optional organization to create the workspace in: the cakeOrganizationId of an existing workspace (Get Workspace). Empty = the organization of your active workspace.",+ "Client ID. Use List Clients to find it.": "Client ID. Use List Clients to find it.",+ "Holiday ID. Use List Holidays to find it.": "Holiday ID. Use List Holidays to find it.",+ "Shared report ID. Use List Shared Reports to find it.": "Shared report ID. Use List Shared Reports to find it.",+ "Tag ID. Use List Tags to find it.": "Tag ID. Use List Tags to find it.",+ "Task ID. Use List Tasks to find it.": "Task ID. Use List Tasks to find it.",+ "Timesheet template ID. Use List Templates to find it.": "Timesheet template ID. Use List Templates to find it.",+ "Time entry ID. Use List Time Entries to find it.": "Time entry ID. Use List Time Entries to find it.",+ "Optional: only these projects. Use List Projects.": "Optional: only these projects. Use List Projects.",+ "Optional: only these users. Use List Users.": "Optional: only these users. Use List Users.",+ "Optional: only these clients. Use List Clients.": "Optional: only these clients. Use List Clients.",+ "Optional: only entries with these tags. Use List Tags.": "Optional: only entries with these tags. Use List Tags.",+ "Optional: only billable (Yes) or non-billable (No) time. Empty = both.": "Optional: only billable (Yes) or non-billable (No) time. Empty = both.",+ "Page number, starting at 1. Default 1.": "Page number, starting at 1. Default 1.",+ "Items per page, 1 to 5000. Default 50.": "Items per page, 1 to 5000. Default 50.",+ "Up to three levels of grouping, in order. Default Project.": "Up to three levels of grouping, in order. Default Project.",+ "Rows of the weekly grid. Default Project.": "Rows of the weekly grid. Default Project.",+ "Also return the user memberships (workspaces and projects the user belongs to). Default false.": "Also return the user memberships (workspaces and projects the user belongs to). Default false.",+ "Optional start of the period, ISO 8601. Empty = the saved period.": "Optional start of the period, ISO 8601. Empty = the saved period.",+ "Optional end of the period, ISO 8601. Empty = the saved period.": "Optional end of the period, ISO 8601. Empty = the saved period.",+ "Return the template projects, tasks and entries. Default false.": "Return the template projects, tasks and entries. Default false.",+ "Return project, task and tag objects instead of only their IDs. Default false.": "Return project, task and tag objects instead of only their IDs. Default false.",+ "Start of the period, ISO 8601.": "Start of the period, ISO 8601.",+ "End of the period, ISO 8601.": "End of the period, ISO 8601.",+ "Optional: only assignments whose project or user name contains this text.": "Optional: only assignments whose project or user name contains this text.",+ "Optional: only clients whose name contains this text.": "Optional: only clients whose name contains this text.",+ "Optional: only archived (Yes) or only active (No) clients. Empty = both.": "Optional: only archived (Yes) or only active (No) clients. Empty = both.",+ "Type of record to list changes for.": "Type of record to list changes for.",+ "Optional start of the period, ISO 8601.": "Optional start of the period, ISO 8601.",+ "Optional end of the period, ISO 8601.": "Optional end of the period, ISO 8601.",+ "Items per page. Default 50.": "Items per page. Default 50.",+ "Optional: only fields whose name contains this text.": "Optional: only fields whose name contains this text.",+ "User whose holidays to return. Empty = the connected user.": "User whose holidays to return. Empty = the connected user.",+ "Optional: only holidays that apply to this user ID.": "Optional: only holidays that apply to this user ID.",+ "Optional: only fields with this status.": "Optional: only fields with this status.",+ "Optional: only projects whose name contains this text.": "Optional: only projects whose name contains this text.",+ "Match Name exactly instead of contains. Default false.": "Match Name exactly instead of contains. Default false.",+ "Optional: only projects of this client. Use List Clients to find it.": "Optional: only projects of this client. Use List Clients to find it.",+ "Optional: only archived (Yes) or only active (No) projects. Empty = both.": "Optional: only archived (Yes) or only active (No) projects. Empty = both.",+ "Optional: only billable (Yes) or non-billable (No) projects. Empty = both.": "Optional: only billable (Yes) or non-billable (No) projects. Empty = both.",+ "Optional: only template (Yes) or regular (No) projects. Empty = both.": "Optional: only template (Yes) or regular (No) projects. Empty = both.",+ "Default All.": "Default All.",+ "Optional: only tags whose name contains this text.": "Optional: only tags whose name contains this text.",+ "Optional: only archived (Yes) or only active (No) tags. Empty = both.": "Optional: only archived (Yes) or only active (No) tags. Empty = both.",+ "Optional: only tasks whose name contains this text.": "Optional: only tasks whose name contains this text.",+ "Optional: only active (Yes) or only done (No) tasks. Empty = both.": "Optional: only active (Yes) or only done (No) tasks. Empty = both.",+ "Optional: only templates whose name contains this text.": "Optional: only templates whose name contains this text.",+ "Optional: only entries starting at or after this ISO 8601 datetime.": "Optional: only entries starting at or after this ISO 8601 datetime.",+ "Optional: only entries starting before this ISO 8601 datetime.": "Optional: only entries starting before this ISO 8601 datetime.",+ "Optional: only entries whose description contains this text.": "Optional: only entries whose description contains this text.",+ "Optional: only entries on this project.": "Optional: only entries on this project.",+ "Optional: only entries on this task.": "Optional: only entries on this task.",+ "Optional: only entries with these tags.": "Optional: only entries with these tags.",+ "Only the running entry. Default false.": "Only the running entry. Default false.",+ "Optional: only groups whose name contains this text.": "Optional: only groups whose name contains this text.",+ "Optional: only groups that are members of this project. Use List Projects to find it.": "Optional: only groups that are members of this project. Use List Projects to find it.",+ "Also return each group team managers. Default false.": "Also return each group team managers. Default false.",+ "Optional: only users whose email contains this text.": "Optional: only users whose email contains this text.",+ "Optional: only users whose name contains this text.": "Optional: only users whose name contains this text.",+ "Optional: only users with this status.": "Optional: only users with this status.",+ "Optional: only members of this project. Use List Projects to find it.": "Optional: only members of this project. Use List Projects to find it.",+ "Optional: only members of these user groups. Use List User Groups to find them.": "Optional: only members of these user groups. Use List User Groups to find them.",+ "Optional: only users with one of these roles.": "Optional: only users with one of these roles.",+ "Also return each user role. Default false.": "Also return each user role. Default false.",+ "Optional: only workspaces where the connected user has this role.": "Optional: only workspaces where the connected user has this role.",+ "true = invoiced, false = not invoiced.": "true = invoiced, false = not invoiced.",+ "ISO 8601 stop time. Empty = now.": "ISO 8601 stop time. Empty = now.",+ "Archive (Yes) or unarchive (No) the client. Empty = unchanged.": "Archive (Yes) or unarchive (No) the client. Empty = unchanged.",+ "When archiving, also archive the client projects. Default false.": "When archiving, also archive the client projects. Default false.",+ "When archiving with its projects, also mark their tasks done. Default false.": "When archiving with its projects, also mark their tasks done. Default false.",+ "Applies to all members (Yes) or only the listed ones (No). Empty = unchanged.": "Applies to all members (Yes) or only the listed ones (No). Empty = unchanged.",+ "Empty = unchanged.": "Empty = unchanged.",+ "Daily work capacity as an ISO 8601 duration, for example PT8H.": "Daily work capacity as an ISO 8601 duration, for example PT8H.",+ "Replaces the member working days.": "Replaces the member working days.",+ "Total time estimate as an ISO 8601 duration, for example PT120H.": "Total time estimate as an ISO 8601 duration, for example PT120H.",+ "Budget estimate in cents, for example 500000 for 5000.00.": "Budget estimate in cents, for example 500000 for 5000.00.",+ "Optional: restart the estimate every period.": "Optional: restart the estimate every period.",+ "Turn the time estimate off. Default false.": "Turn the time estimate off. Default false.",+ "Turn the budget estimate off. Default false.": "Turn the budget estimate off. Default false.",+ "The full list of user IDs that should be members. Use List Users to find them.": "The full list of user IDs that should be members. Use List Users to find them.",+ "true = make it a template, false = a regular project.": "true = make it a template, false = a regular project.",+ "Rate in cents, for example 2500 for 25.00.": "Rate in cents, for example 2500 for 25.00.",+ "Optional ISO 8601 datetime, for example 2026-01-01T00:00:00Z. Time entries from this moment on get the new rate. Empty = only new time entries.": "Optional ISO 8601 datetime, for example 2026-01-01T00:00:00Z. Time entries from this moment on get the new rate. Empty = only new time entries.",+ "When Apply Since is set, also re-rate time entries that were already approved. Default false.": "When Apply Since is set, also re-rate time entries that were already approved. Default false.",+ "Make the project billable (Yes) or not (No). Empty = unchanged.": "Make the project billable (Yes) or not (No). Empty = unchanged.",+ "Make the project public (Yes) or members-only (No). Empty = unchanged.": "Make the project public (Yes) or members-only (No). Empty = unchanged.",+ "Archive (Yes) or unarchive (No). Empty = unchanged.": "Archive (Yes) or unarchive (No). Empty = unchanged.",+ "Anyone with the link can view it; replaces the list. Empty = unchanged.": "Anyone with the link can view it; replaces the list. Empty = unchanged.",+ "Viewers cannot change the period. Empty = unchanged.": "Viewers cannot change the period. Empty = unchanged.",+ "User IDs that can view it; replaces the list.": "User IDs that can view it; replaces the list.",+ "User group IDs that can view it; replaces the list.": "User group IDs that can view it; replaces the list.",+ "Archive (Yes) or unarchive (No) the tag. Empty = unchanged.": "Archive (Yes) or unarchive (No) the tag. Empty = unchanged.",+ "Active or Done. Empty = unchanged.": "Active or Done. Empty = unchanged.",+ "New ISO 8601 start. Empty = unchanged.": "New ISO 8601 start. Empty = unchanged.",+ "New ISO 8601 end. Empty = unchanged.": "New ISO 8601 end. Empty = unchanged.",+ "Custom field ID. Use List Custom Fields to find it.": "Custom field ID. Use List Custom Fields to find it.",+ "The new value of the field.": "The new value of the field.",+ "New name of the group.": "New name of the group.",+ "Currency code, for example USD.": "Currency code, for example USD.","Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.","Appended to the URL as ?key=value.": "Appended to the URL as ?key=value.","Enable for files like PDFs, images, etc.": "Enable for files like PDFs, images, etc.","On a failed request, output the error instead of failing the step.": "On a failed request, output the error instead of failing the step.","Seconds to wait for a response. Empty: up to the flow limit (10 min).": "Seconds to wait for a response. Empty: up to the flow limit (10 min).","Follow 3xx redirects instead of returning them as the response.": "Follow 3xx redirects instead of returning them as the response.",- "Active": "Active","Done": "Done","All": "All",+ "Workspace Admin": "Workspace Admin",+ "Team Manager": "Team Manager",+ "Project Manager": "Project Manager",+ "Yes": "Yes",+ "No": "No",+ "Detailed": "Detailed",+ "Summary": "Summary",+ "Weekly": "Weekly",+ "Client": "Client",+ "User": "User",+ "User Group": "User Group",+ "Tag": "Tag",+ "Date": "Date",+ "Week": "Week",+ "Month": "Month",+ "TIME_ENTRY": "TIME_ENTRY",+ "PROJECTS": "PROJECTS",+ "TASKS": "TASKS",+ "CLIENTS": "CLIENTS",+ "TAGS": "TAGS",+ "USER": "USER",+ "USER_GROUPS": "USER_GROUPS",+ "CUSTOM_FIELDS": "CUSTOM_FIELDS",+ "TIME_ENTRY_CUSTOM_FIELD_VALUE": "TIME_ENTRY_CUSTOM_FIELD_VALUE",+ "TIME_ENTRY_RATE": "TIME_ENTRY_RATE",+ "HOLIDAYS": "HOLIDAYS",+ "INVOICES": "INVOICES",+ "APPROVAL_REQUESTS": "APPROVAL_REQUESTS",+ "SCHEDULED_ASSIGNMENT": "SCHEDULED_ASSIGNMENT",+ "TIME_OFF_REQUEST": "TIME_OFF_REQUEST",+ "PTO_POLICY": "PTO_POLICY",+ "BALANCE": "BALANCE",+ "Visible": "Visible",+ "Invisible": "Invisible",+ "Inactive": "Inactive",+ "Time entries": "Time entries",+ "Users": "Users",+ "All (as admin)": "All (as admin)",+ "Created by me": "Created by me",+ "Shared with me": "Shared with me",+ "Pending": "Pending",+ "Declined": "Declined",+ "Owner": "Owner",+ "Monday": "Monday",+ "Tuesday": "Tuesday",+ "Wednesday": "Wednesday",+ "Thursday": "Thursday",+ "Friday": "Friday",+ "Saturday": "Saturday",+ "Sunday": "Sunday",+ "Monthly": "Monthly",+ "Yearly": "Yearly","GET": "GET","POST": "POST","PATCH": "PATCH","PUT": "PUT","DELETE": "DELETE","HEAD": "HEAD",+ "Request": "Request",+ "Data to send": "Data to send","New Task": "New Task","New Time Entry": "New Time Entry","New Timer Started": "New Timer Started",diff --git a/packages/pieces/community/clockify/src/index.ts b/packages/pieces/community/clockify/src/index.tsindex c2410890cb9..4e6fdd9f5bb 100644--- a/packages/pieces/community/clockify/src/index.ts+++ b/packages/pieces/community/clockify/src/index.ts@@ -1,5 +1,5 @@-import { createCustomApiCallAction, HttpMethod } from '@activepieces/pieces-common';-import { createPiece, PieceAuth } from '@activepieces/pieces-framework';+import { createCustomApiCallAction } from '@activepieces/pieces-common';+import { createPiece } from '@activepieces/pieces-framework';import { createTaskAction } from './lib/actions/create-task';import { createTimeEntryAction } from './lib/actions/create-time-entry';import { findRunningTimerAction } from './lib/actions/find-running-timer';@@ -7,16 +7,17 @@ import { findTaskAction } from './lib/actions/find-task';import { findTimeEntryAction } from './lib/actions/find-time-entry';import { startTimerAction } from './lib/actions/start-timer';import { stopTimerAction } from './lib/actions/stop-timer';-import { BASE_URL, clockifyApiCall } from './lib/common/client';+import { clockifyClient } from './lib/common/client';import { newTaskTrigger } from './lib/triggers/new-task';import { newTimeEntryTrigger } from './lib/triggers/new-time-entry';import { newTimerStartedTrigger } from './lib/triggers/new-timer-started';+import { clockifyAiActions } from './lib/actions/ai';import { clockifyAuth } from './lib/auth';export const clockify = createPiece({displayName: 'Clockify',auth: clockifyAuth,- minimumSupportedRelease: '0.36.1',+ minimumSupportedRelease: '0.88.2',logoUrl: 'https://cdn.activepieces.com/pieces/clockify.png',authors: ['rimjhimyadav', 'kishanprmr'],actions: [@@ -27,9 +28,10 @@ export const clockify = createPiece({findTaskAction,findTimeEntryAction,findRunningTimerAction,+ ...clockifyAiActions,createCustomApiCallAction({auth: clockifyAuth,- baseUrl: () => BASE_URL,+ baseUrl: () => clockifyClient.baseUrl(),authMapping: async (auth) => {return {'X-Api-Key': auth.secret_text,diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/add-user-role.ts b/packages/pieces/community/clockify/src/lib/actions/ai/add-user-role.tsnew file mode 100644index 00000000000..9cac408b294--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/add-user-role.ts@@ -0,0 +1,59 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { userRolesOutputSchema } from '../../output-schemas';++export const addUserRoleAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_add_user_role',+ outputSchema: userRolesOutputSchema,+ displayName: 'Add User Role',+ description: 'Gives a user an admin or manager role.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Gives a workspace member the Workspace Admin, Team Manager or Project Manager role over an entity (see Entity ID). Workspace Admin grants full control of the workspace. Needs workspace admin. Returns the user roles after the change.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ userId: clockifyAiProps.userId({ required: true }),+ role: Property.StaticDropdown({+ displayName: 'Role',+ required: true,+ options: {+ disabled: false,+ options: [+ { label: 'Workspace Admin', value: 'WORKSPACE_ADMIN' },+ { label: 'Team Manager', value: 'TEAM_MANAGER' },+ { label: 'Project Manager', value: 'PROJECT_MANAGER' },+ ],+ },+ }),+ entityId: Property.ShortText({+ displayName: 'Entity ID',+ description:+ 'What the role applies to. Workspace Admin: the workspace ID. Team Manager: the ID of the user (or user group) to manage. Project Manager: the project ID.',+ required: true,+ }),+ entityIsUserGroup: Property.Checkbox({+ displayName: 'Entity Is a User Group',+ description:+ 'Team Manager only: set when Entity ID is a user group ID rather than a user ID. Default false.',+ required: false,+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.addUserRole({+ auth,+ workspaceId: propsValue.workspaceId,+ userId: propsValue.userId,+ role: propsValue.role,+ entityId: propsValue.entityId,+ sourceType: propsValue.entityIsUserGroup ? 'USER_GROUP' : undefined,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/add-user-to-group.ts b/packages/pieces/community/clockify/src/lib/actions/ai/add-user-to-group.tsnew file mode 100644index 00000000000..09f2d6c29c8--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/add-user-to-group.ts@@ -0,0 +1,34 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { userGroupOutputSchema } from '../../output-schemas';++export const addUserToGroupAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_add_user_to_group',+ outputSchema: userGroupOutputSchema,+ displayName: 'Add User to Group',+ description: 'Adds a workspace member to a user group.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Adds one workspace member to a user group and returns the group with its member IDs. Needs workspace admin.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ userGroupId: clockifyAiProps.userGroupId({ required: true }),+ userId: clockifyAiProps.userId({ required: true }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.addUserToGroup({+ auth,+ workspaceId: propsValue.workspaceId,+ userGroupId: propsValue.userGroupId,+ userId: propsValue.userId,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/assign-project-users.ts b/packages/pieces/community/clockify/src/lib/actions/ai/assign-project-users.tsnew file mode 100644index 00000000000..1db2f0d9649--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/assign-project-users.ts@@ -0,0 +1,44 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { projectOutputSchema } from '../../output-schemas';++export const assignProjectUsersAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_assign_project_users',+ outputSchema: projectOutputSchema,+ displayName: 'Assign Project Users',+ description: 'Adds or removes users on a project.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Adds the given users to a project as members, or removes them when Remove is set. Other members are untouched. Returns the updated project.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ projectId: clockifyAiProps.projectId({ required: true }),+ userIds: Property.Array({+ displayName: 'User IDs',+ description: 'User IDs to add or remove. Use List Users to find them.',+ required: true,+ }),+ remove: Property.Checkbox({+ displayName: 'Remove',+ description: 'Remove these users instead of adding them. Default false.',+ required: false,+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.assignProjectUsers({+ auth,+ workspaceId: propsValue.workspaceId,+ projectId: propsValue.projectId,+ userIds: propsValue.userIds.map(String),+ remove: propsValue.remove ?? false,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/bulk-delete-time-entries.ts b/packages/pieces/community/clockify/src/lib/actions/ai/bulk-delete-time-entries.tsnew file mode 100644index 00000000000..164438321a3--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/bulk-delete-time-entries.ts@@ -0,0 +1,39 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { changedTimeEntriesOutputSchema } from '../../output-schemas';++export const bulkDeleteTimeEntriesAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_bulk_delete_time_entries',+ outputSchema: changedTimeEntriesOutputSchema,+ displayName: 'Bulk Delete Time Entries',+ description: "Deletes several of a user's time entries.",+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently deletes several time entries of one user in one call and returns the deleted entries. All IDs must belong to that user. Defaults to the connected user.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ userId: clockifyAiProps.userId({+ required: false,+ description: 'User ID. Empty = the connected user. Another user needs workspace admin.',+ }),+ timeEntryIds: clockifyAiProps.timeEntryIds({ required: true }),+ },+ async run({ auth, propsValue }) {+ const userId = propsValue.userId ?? (await clockifyApi.getCurrentUser({ auth })).id;+ const timeEntries = await clockifyApi.bulkDeleteTimeEntries({+ auth,+ workspaceId: propsValue.workspaceId,+ userId,+ timeEntryIds: propsValue.timeEntryIds.map(String),+ });+ return { timeEntries, count: timeEntries.length };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/bulk-update-time-entries.ts b/packages/pieces/community/clockify/src/lib/actions/ai/bulk-update-time-entries.tsnew file mode 100644index 00000000000..2ab68763939--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/bulk-update-time-entries.ts@@ -0,0 +1,99 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { changedTimeEntriesOutputSchema } from '../../output-schemas';++export const bulkUpdateTimeEntriesAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_bulk_update_time_entries',+ outputSchema: changedTimeEntriesOutputSchema,+ displayName: 'Bulk Update Time Entries',+ description: "Applies the same change to several of a user's time entries.",+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Applies the same project, task, tags, description or billable change to several time entries of one user in one call. Each entry keeps its own times and every field you leave empty: the action reads the entries and sends them back with only your changes. Defaults to the connected user.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ userId: clockifyAiProps.userId({+ required: false,+ description: 'User ID. Empty = the connected user. Another user needs workspace admin.',+ }),+ timeEntryIds: clockifyAiProps.timeEntryIds({+ required: true,+ description:+ 'IDs of the entries to change, all belonging to the user. Use List Time Entries to find them.',+ }),+ description: clockifyAiProps.entryDescription({ required: false }),+ projectId: clockifyAiProps.projectId({+ required: false,+ description: 'New project ID. Empty = unchanged.',+ }),+ taskId: clockifyAiProps.taskId({+ required: false,+ description: 'New task ID. Empty = unchanged.',+ }),+ tagIds: clockifyAiProps.tagIds({+ required: false,+ description: 'Replaces the tags. Empty = unchanged.',+ }),+ billable: Property.StaticDropdown({+ displayName: 'Billable',+ description: 'Billable (Yes) or not (No). Empty = unchanged.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ }),+ },+ async run({ auth, propsValue }) {+ const userId = propsValue.userId ?? (await clockifyApi.getCurrentUser({ auth })).id;+ const current = await clockifyApi.getTimeEntriesByIds({+ auth,+ workspaceId: propsValue.workspaceId,+ timeEntryIds: propsValue.timeEntryIds.map(String),+ });+ const billable = clockifyUtils.toOptionalBoolean({+ value: propsValue.billable,+ });+ const timeEntries = await clockifyApi.bulkUpdateTimeEntries({+ auth,+ workspaceId: propsValue.workspaceId,+ userId,+ entries: current.flatMap((entry) => {+ const start = entry.timeInterval?.start;+ if (!start) {+ return [];+ }+ return [+ {+ id: entry.id,+ start,+ end: entry.timeInterval?.end,+ description: propsValue.description ?? entry.description,+ projectId: propsValue.projectId ?? entry.projectId,+ taskId: propsValue.taskId ?? entry.taskId,+ tagIds: clockifyUtils.nonEmptyIds({ values: propsValue.tagIds }) ?? entry.tagIds,+ billable: billable ?? entry.billable,+ type: entry.type,+ customFields: entry.customFieldValues?.map((field) => ({+ customFieldId: field.customFieldId,+ value: field.value,+ })),+ },+ ];+ }),+ });+ return { timeEntries, count: timeEntries.length };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/create-client.ts b/packages/pieces/community/clockify/src/lib/actions/ai/create-client.tsnew file mode 100644index 00000000000..d102ac2107a--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/create-client.ts@@ -0,0 +1,44 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clientOutputSchema } from '../../output-schemas';++export const createClientAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_create_client',+ outputSchema: clientOutputSchema,+ displayName: 'Create Client',+ description: 'Creates a client in a workspace.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Creates a client in a Clockify workspace and returns it with its ID, to attach projects to. Not idempotent: client names must be unique, so a repeat fails.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ name: Property.ShortText({+ displayName: 'Name',+ description: 'Client name, unique in the workspace.',+ required: true,+ }),+ email: Property.ShortText({ displayName: 'Email', required: false }),+ address: Property.LongText({ displayName: 'Address', required: false }),+ note: Property.LongText({ displayName: 'Note', required: false }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.createClient({+ auth,+ workspaceId: propsValue.workspaceId,+ client: {+ name: propsValue.name,+ email: propsValue.email,+ address: propsValue.address,+ note: propsValue.note,+ },+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/create-holiday.ts b/packages/pieces/community/clockify/src/lib/actions/ai/create-holiday.tsnew file mode 100644index 00000000000..dd8e512a814--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/create-holiday.ts@@ -0,0 +1,72 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { holidayOutputSchema } from '../../output-schemas';++export const createHolidayAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_create_holiday',+ outputSchema: holidayOutputSchema,+ displayName: 'Create Holiday',+ description: 'Adds a holiday to a workspace.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Adds a holiday (one day or a date range) for everyone or for chosen users and groups, optionally repeating every year. Needs workspace admin and a Clockify plan with time off (Standard or higher). Not idempotent.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ name: Property.ShortText({ displayName: 'Name', required: true }),+ startDate: Property.ShortText({+ displayName: 'Start Date',+ description: 'First day, YYYY-MM-DD.',+ required: true,+ }),+ endDate: Property.ShortText({+ displayName: 'End Date',+ description: 'Last day, YYYY-MM-DD. Same as Start Date for one day.',+ required: true,+ }),+ userIds: clockifyAiProps.idList({+ required: false,+ displayName: 'User IDs',+ description: 'Users it applies to. Use List Users.',+ }),+ userGroupIds: clockifyAiProps.idList({+ required: false,+ displayName: 'User Group IDs',+ description: 'User groups it applies to. Use List User Groups.',+ }),+ everyone: Property.Checkbox({+ displayName: 'Everyone',+ description:+ 'Applies to all current and future members; User IDs and User Group IDs are then ignored. Default true.',+ required: false,+ defaultValue: true,+ }),+ occursAnnually: Property.Checkbox({+ displayName: 'Repeats Yearly',+ description: 'Default false.',+ required: false,+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.createHoliday({+ auth,+ workspaceId: propsValue.workspaceId,+ holiday: {+ name: propsValue.name,+ datePeriod: { startDate: propsValue.startDate, endDate: propsValue.endDate },+ occursAnnually: propsValue.occursAnnually ?? false,+ everyoneIncludingNew: propsValue.everyone ?? true,+ users: clockifyUtils.entityFilter({ ids: propsValue.userIds }),+ userGroups: clockifyUtils.entityFilter({ ids: propsValue.userGroupIds }),+ },+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/create-project-from-template.ts b/packages/pieces/community/clockify/src/lib/actions/ai/create-project-from-template.tsnew file mode 100644index 00000000000..4d12293711c--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/create-project-from-template.ts@@ -0,0 +1,57 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { projectOutputSchema } from '../../output-schemas';++export const createProjectFromTemplateAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_create_project_from_template',+ outputSchema: projectOutputSchema,+ displayName: 'Create Project from Template',+ description: 'Creates a project from a template project.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Creates a project copied from a template project (its tasks, rates and settings). Template projects are found with List Projects and Template = Yes, and made with Update Project Template. Needs a Clockify plan with project templates (Pro or higher). Not idempotent.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ templateProjectId: clockifyAiProps.projectId({+ required: true,+ displayName: 'Template Project ID',+ description: 'ID of a template project. Use List Projects with Template = Yes.',+ }),+ name: Property.ShortText({ displayName: 'Name', required: true }),+ clientId: clockifyAiProps.clientId({+ required: false,+ description: 'Optional client ID. Use List Clients to find it.',+ }),+ color: Property.ShortText({+ displayName: 'Color',+ description: 'Hex color, for example #03A9F4.',+ required: false,+ }),+ isPublic: Property.Checkbox({+ displayName: 'Public',+ description: 'Every workspace member can track time on it. Default false.',+ required: false,+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.createProjectFromTemplate({+ auth,+ workspaceId: propsValue.workspaceId,+ project: {+ templateProjectId: propsValue.templateProjectId,+ name: propsValue.name,+ clientId: propsValue.clientId,+ color: propsValue.color,+ isPublic: propsValue.isPublic,+ },+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/create-project.ts b/packages/pieces/community/clockify/src/lib/actions/ai/create-project.tsnew file mode 100644index 00000000000..920f19c6109--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/create-project.ts@@ -0,0 +1,66 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { projectOutputSchema } from '../../output-schemas';++export const createProjectAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_create_project',+ outputSchema: projectOutputSchema,+ displayName: 'Create Project',+ description: 'Creates a project in a workspace.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Creates a project in a Clockify workspace, optionally for a client, and returns it with its ID. Not idempotent: project names must be unique per client, so a repeat fails.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ name: Property.ShortText({ displayName: 'Name', required: true }),+ clientId: clockifyAiProps.clientId({+ required: false,+ description: 'Optional client ID. Use List Clients to find it.',+ }),+ color: Property.ShortText({+ displayName: 'Color',+ description: 'Hex color, for example #03A9F4.',+ required: false,+ }),+ note: Property.LongText({ displayName: 'Note', required: false }),+ billable: Property.Checkbox({+ displayName: 'Billable',+ description: 'Time on this project is billable by default. Default false.',+ required: false,+ }),+ isPublic: Property.Checkbox({+ displayName: 'Public',+ description: 'Every workspace member can track time on it. Default false (only members).',+ required: false,+ }),+ billableRate: Property.Number({+ displayName: 'Billable Rate',+ description: 'Optional project billable rate in cents, for example 5000 for 50.00.',+ required: false,+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.createProject({+ auth,+ workspaceId: propsValue.workspaceId,+ project: {+ name: propsValue.name,+ clientId: propsValue.clientId,+ color: propsValue.color,+ note: propsValue.note,+ billable: propsValue.billable,+ isPublic: propsValue.isPublic,+ hourlyRate:+ propsValue.billableRate === undefined ? undefined : { amount: propsValue.billableRate },+ },+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/create-shared-report.ts b/packages/pieces/community/clockify/src/lib/actions/ai/create-shared-report.tsnew file mode 100644index 00000000000..d168dd850d6--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/create-shared-report.ts@@ -0,0 +1,98 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { sharedReportOutputSchema } from '../../output-schemas';++export const createSharedReportAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_create_shared_report',+ outputSchema: sharedReportOutputSchema,+ displayName: 'Create Shared Report',+ description: 'Saves a detailed, summary or weekly report as a shareable link.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Saves a detailed, summary or weekly report for a period (optionally filtered by project or user) as a shared report, and returns it with its ID. Share it publicly or with chosen users. Not idempotent.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ name: Property.ShortText({ displayName: 'Name', required: true }),+ type: Property.StaticDropdown({+ displayName: 'Type',+ required: true,+ options: {+ disabled: false,+ options: [+ { label: 'Detailed', value: 'DETAILED' },+ { label: 'Summary', value: 'SUMMARY' },+ { label: 'Weekly', value: 'WEEKLY' },+ ],+ },+ }),+ dateRangeStart: clockifyAiProps.dateRangeStart({ required: true }),+ dateRangeEnd: clockifyAiProps.dateRangeEnd({ required: true }),+ projectIds: clockifyAiProps.idList({+ required: false,+ displayName: 'Project IDs',+ description: 'Optional: only these projects.',+ }),+ userIds: clockifyAiProps.idList({+ required: false,+ displayName: 'User IDs',+ description: 'Optional: only these users.',+ }),+ isPublic: Property.Checkbox({+ displayName: 'Public',+ description: 'Anyone with the link can view it. Default false.',+ required: false,+ }),+ fixedDate: Property.Checkbox({+ displayName: 'Fixed Period',+ description: 'Viewers cannot change the period. Default false.',+ required: false,+ }),+ visibleToUsers: clockifyAiProps.idList({+ required: false,+ displayName: 'Visible to Users',+ description: 'User IDs that can view it.',+ }),+ visibleToUserGroups: clockifyAiProps.idList({+ required: false,+ displayName: 'Visible to User Groups',+ description: 'User group IDs that can view it.',+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.createSharedReport({+ auth,+ workspaceId: propsValue.workspaceId,+ sharedReport: {+ name: propsValue.name,+ type: propsValue.type,+ isPublic: propsValue.isPublic,+ fixedDate: propsValue.fixedDate,+ visibleToUsers: propsValue.visibleToUsers?.map(String),+ visibleToUserGroups: propsValue.visibleToUserGroups?.map(String),+ filter: {+ dateRangeStart: propsValue.dateRangeStart,+ dateRangeEnd: propsValue.dateRangeEnd,+ exportType: 'JSON',+ projects: clockifyUtils.entityFilter({ ids: propsValue.projectIds }),+ users: clockifyUtils.entityFilter({ ids: propsValue.userIds }),+ detailedFilter:+ propsValue.type === 'DETAILED'+ ? { page: 1, pageSize: 50, sortColumn: 'DATE' }+ : undefined,+ summaryFilter: propsValue.type === 'SUMMARY' ? { groups: ['PROJECT'] } : undefined,+ weeklyFilter:+ propsValue.type === 'WEEKLY' ? { group: 'PROJECT', subgroup: 'TIME' } : undefined,+ },+ },+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/create-tag.ts b/packages/pieces/community/clockify/src/lib/actions/ai/create-tag.tsnew file mode 100644index 00000000000..7aa79fe905a--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/create-tag.ts@@ -0,0 +1,36 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { tagOutputSchema } from '../../output-schemas';++export const createTagAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_create_tag',+ outputSchema: tagOutputSchema,+ displayName: 'Create Tag',+ description: 'Creates a tag in a workspace.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Creates a tag in a Clockify workspace and returns it with its ID. Not idempotent: tag names must be unique, so a repeat fails; use List Tags with Exact Name Match to check first.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ name: Property.ShortText({+ displayName: 'Name',+ description: 'Tag name, unique in the workspace.',+ required: true,+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.createTag({+ auth,+ workspaceId: propsValue.workspaceId,+ name: propsValue.name,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/create-task.ts b/packages/pieces/community/clockify/src/lib/actions/ai/create-task.tsnew file mode 100644index 00000000000..05995716139--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/create-task.ts@@ -0,0 +1,65 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { taskOutputSchema } from '../../output-schemas';++export const createTaskAiAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_create_task',+ outputSchema: taskOutputSchema,+ displayName: 'Create Task',+ description: 'Creates a task in a project.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Creates a task in a Clockify project, optionally assigned to users or user groups with a time estimate, and returns it with its ID. Not idempotent: task names must be unique per project, so a repeat fails; use List Tasks with Exact Name Match to check first.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ projectId: clockifyAiProps.projectId({ required: true }),+ name: Property.ShortText({ displayName: 'Name', required: true }),+ status: Property.StaticDropdown({+ displayName: 'Status',+ description: 'Default Active.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Active', value: 'ACTIVE' },+ { label: 'Done', value: 'DONE' },+ ],+ },+ }),+ assigneeIds: Property.Array({+ displayName: 'Assignee IDs',+ description: 'User IDs to assign. Use List Users to find them.',+ required: false,+ }),+ userGroupIds: Property.Array({+ displayName: 'User Group IDs',+ description: 'User group IDs to assign. Use List User Groups to find them.',+ required: false,+ }),+ estimate: Property.ShortText({+ displayName: 'Estimate',+ description: 'Time estimate as an ISO 8601 duration, for example PT8H.',+ required: false,+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.createTask({+ auth,+ workspaceId: propsValue.workspaceId,+ projectId: propsValue.projectId,+ name: propsValue.name,+ status: propsValue.status,+ assigneeIds: propsValue.assigneeIds?.map(String) ?? [],+ userGroupIds: propsValue.userGroupIds?.map(String),+ estimate: propsValue.estimate,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/create-template.ts b/packages/pieces/community/clockify/src/lib/actions/ai/create-template.tsnew file mode 100644index 00000000000..5df651e0aad--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/create-template.ts@@ -0,0 +1,45 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { templateOutputSchema } from '../../output-schemas';++export const createTemplateAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_create_template',+ outputSchema: templateOutputSchema,+ displayName: 'Create Template',+ description: 'Creates a timesheet template.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Creates a timesheet template: a named set of project rows that can be loaded into a weekly timesheet. Returns the new template with its ID. Not idempotent.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ name: Property.ShortText({ displayName: 'Name', required: true }),+ projectIds: clockifyAiProps.idList({+ required: true,+ displayName: 'Project IDs',+ description: 'Projects to put on the template, one row each. Use List Projects.',+ }),+ },+ async run({ auth, propsValue }) {+ const [template] = await clockifyApi.createTemplates({+ auth,+ workspaceId: propsValue.workspaceId,+ templates: [+ {+ name: propsValue.name,+ projectsAndTasks: propsValue.projectIds.map((projectId) => ({+ projectId: String(projectId),+ })),+ },+ ],+ });+ return template;+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/create-time-entry.ts b/packages/pieces/community/clockify/src/lib/actions/ai/create-time-entry.tsnew file mode 100644index 00000000000..4174c994b79--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/create-time-entry.ts@@ -0,0 +1,62 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { timeEntryOutputSchema } from '../../output-schemas';++export const createTimeEntryAiAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_create_time_entry',+ outputSchema: timeEntryOutputSchema,+ displayName: 'Create Time Entry',+ description: 'Logs a finished time entry for yourself.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Logs a finished time entry for the connected user from Start to End, optionally on a project, task and tags. To log time for another user use Create User Time Entry; to start a running timer use Start Timer. Not idempotent: each call adds an entry.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ start: Property.DateTime({+ displayName: 'Start',+ description: 'ISO 8601 start datetime, for example 2026-10-21T09:00:00Z.',+ required: true,+ }),+ end: Property.DateTime({+ displayName: 'End',+ description: 'ISO 8601 end datetime, after Start.',+ required: true,+ }),+ description: clockifyAiProps.entryDescription({ required: false }),+ projectId: clockifyAiProps.projectId({+ required: false,+ description: 'Optional project ID. Use List Projects to find it.',+ }),+ taskId: clockifyAiProps.taskId({+ required: false,+ description: 'Optional task ID in that project. Use List Tasks to find it.',+ }),+ tagIds: clockifyAiProps.tagIds({ required: false }),+ billable: Property.Checkbox({+ displayName: 'Billable',+ description: 'Default false.',+ required: false,+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.createTimeEntry({+ auth,+ workspaceId: propsValue.workspaceId,+ start: propsValue.start,+ end: propsValue.end,+ description: propsValue.description,+ projectId: propsValue.projectId,+ taskId: propsValue.taskId,+ tagIds: propsValue.tagIds?.map(String) ?? [],+ billable: propsValue.billable,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/create-user-group.ts b/packages/pieces/community/clockify/src/lib/actions/ai/create-user-group.tsnew file mode 100644index 00000000000..3c26efe6ca5--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/create-user-group.ts@@ -0,0 +1,36 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { userGroupOutputSchema } from '../../output-schemas';++export const createUserGroupAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_create_user_group',+ outputSchema: userGroupOutputSchema,+ displayName: 'Create User Group',+ description: 'Creates a user group in a workspace.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Creates an empty user group (team) in a Clockify workspace and returns it with its ID. Add members with Add User to Group. Needs workspace admin. Not idempotent: names must be unique, so a repeat fails.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ name: Property.ShortText({+ displayName: 'Name',+ description: 'Name of the group, unique in the workspace.',+ required: true,+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.createUserGroup({+ auth,+ workspaceId: propsValue.workspaceId,+ name: propsValue.name,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/create-user-time-entry.ts b/packages/pieces/community/clockify/src/lib/actions/ai/create-user-time-entry.tsnew file mode 100644index 00000000000..a4d7f54ef21--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/create-user-time-entry.ts@@ -0,0 +1,67 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { timeEntryOutputSchema } from '../../output-schemas';++export const createUserTimeEntryAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_create_user_time_entry',+ outputSchema: timeEntryOutputSchema,+ displayName: 'Create User Time Entry',+ description: 'Logs time for another workspace member.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Logs a time entry for another workspace member from Start to End (omit End to start a running timer for them), optionally on a project, task and tags. Needs workspace admin. Not idempotent: each call adds an entry.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ userId: clockifyAiProps.userId({ required: true }),+ start: Property.DateTime({+ displayName: 'Start',+ description: 'ISO 8601 start datetime, for example 2026-10-21T09:00:00Z.',+ required: true,+ }),+ end: Property.DateTime({+ displayName: 'End',+ description: 'ISO 8601 end datetime. Empty = start a running timer.',+ required: false,+ }),+ description: clockifyAiProps.entryDescription({ required: false }),+ projectId: clockifyAiProps.projectId({+ required: false,+ description: 'Optional project ID. Use List Projects to find it.',+ }),+ taskId: clockifyAiProps.taskId({+ required: false,+ description: 'Optional task ID in that project. Use List Tasks to find it.',+ }),+ tagIds: clockifyAiProps.tagIds({ required: false }),+ billable: Property.Checkbox({+ displayName: 'Billable',+ description: 'Default false.',+ required: false,+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.createUserTimeEntry({+ auth,+ workspaceId: propsValue.workspaceId,+ userId: propsValue.userId,+ entry: {+ start: propsValue.start,+ end: propsValue.end,+ description: propsValue.description,+ projectId: propsValue.projectId,+ taskId: propsValue.taskId,+ tagIds: propsValue.tagIds?.map(String),+ billable: propsValue.billable,+ type: 'REGULAR',+ },+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/create-workspace.ts b/packages/pieces/community/clockify/src/lib/actions/ai/create-workspace.tsnew file mode 100644index 00000000000..7ef26f8fca9--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/create-workspace.ts@@ -0,0 +1,59 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyApi } from '../../common/api';+import { workspaceOutputSchema } from '../../output-schemas';++import type { ClockifyAuthValue } from '../../common/types';++export const createWorkspaceAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_create_workspace',+ outputSchema: workspaceOutputSchema,+ displayName: 'Create Workspace',+ description: 'Creates a new workspace.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Creates a new Clockify workspace owned by the connected user, in the same organization as the active workspace unless Organization ID is set, and returns it with its new ID. Clockify has no API to delete a workspace, so only call this when a new workspace is really wanted. Not idempotent: each call creates another workspace.',+ idempotent: false,+ },+ props: {+ name: Property.ShortText({+ displayName: 'Name',+ description: 'Name of the new workspace.',+ required: true,+ }),+ organizationId: Property.ShortText({+ displayName: 'Organization ID',+ description:+ 'Optional organization to create the workspace in: the cakeOrganizationId of an existing workspace (Get Workspace). Empty = the organization of your active workspace.',+ required: false,+ }),+ },+ async run({ auth, propsValue }) {+ const organizationId = propsValue.organizationId ?? (await activeOrganizationId({ auth }));+ return await clockifyApi.createWorkspace({+ auth,+ name: propsValue.name,+ organizationId,+ });+ },+});++async function activeOrganizationId({+ auth,+}: {+ auth: ClockifyAuthValue;+}): Promise<string | undefined> {+ const user = await clockifyApi.getCurrentUser({ auth });+ if (!user.activeWorkspace) {+ return undefined;+ }+ const workspace = await clockifyApi.getWorkspace({+ auth,+ workspaceId: user.activeWorkspace,+ });+ return workspace.cakeOrganizationId;+}diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/delete-client.ts b/packages/pieces/community/clockify/src/lib/actions/ai/delete-client.tsnew file mode 100644index 00000000000..e5ced3986b5--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/delete-client.ts@@ -0,0 +1,32 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { changedClientOutputSchema } from '../../output-schemas';++export const deleteClientAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_delete_client',+ outputSchema: changedClientOutputSchema,+ displayName: 'Delete Client',+ description: 'Deletes an archived client.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently deletes a client. Clockify only deletes archived clients, so archive it first with Update Client. Its projects stay, without a client.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ clientId: clockifyAiProps.clientId({ required: true }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.deleteClient({+ auth,+ workspaceId: propsValue.workspaceId,+ clientId: propsValue.clientId,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/delete-holiday.ts b/packages/pieces/community/clockify/src/lib/actions/ai/delete-holiday.tsnew file mode 100644index 00000000000..dadb6c5d042--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/delete-holiday.ts@@ -0,0 +1,32 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { holidayOutputSchema } from '../../output-schemas';++export const deleteHolidayAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_delete_holiday',+ outputSchema: holidayOutputSchema,+ displayName: 'Delete Holiday',+ description: 'Deletes a holiday.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently deletes a holiday from the workspace. Needs workspace admin and a Clockify plan with time off (Standard or higher).',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ holidayId: clockifyAiProps.holidayId({ required: true }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.deleteHoliday({+ auth,+ workspaceId: propsValue.workspaceId,+ holidayId: propsValue.holidayId,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/delete-project.ts b/packages/pieces/community/clockify/src/lib/actions/ai/delete-project.tsnew file mode 100644index 00000000000..9b84a9baab6--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/delete-project.ts@@ -0,0 +1,32 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { projectOutputSchema } from '../../output-schemas';++export const deleteProjectAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_delete_project',+ outputSchema: projectOutputSchema,+ displayName: 'Delete Project',+ description: 'Deletes an archived project.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently deletes a project with its tasks. Clockify only deletes archived projects, so archive it first with Update Project. Time entries on it lose their project.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ projectId: clockifyAiProps.projectId({ required: true }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.deleteProject({+ auth,+ workspaceId: propsValue.workspaceId,+ projectId: propsValue.projectId,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/delete-shared-report.ts b/packages/pieces/community/clockify/src/lib/actions/ai/delete-shared-report.tsnew file mode 100644index 00000000000..448be9e189e--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/delete-shared-report.ts@@ -0,0 +1,33 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { deletedOutputSchema } from '../../output-schemas';++export const deleteSharedReportAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_delete_shared_report',+ outputSchema: deletedOutputSchema,+ displayName: 'Delete Shared Report',+ description: 'Deletes a shared report.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently deletes a shared report; its link stops working. The time data it showed is untouched.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ sharedReportId: clockifyAiProps.sharedReportId({ required: true }),+ },+ async run({ auth, propsValue }) {+ await clockifyApi.deleteSharedReport({+ auth,+ workspaceId: propsValue.workspaceId,+ sharedReportId: propsValue.sharedReportId,+ });+ return { deleted: true, id: propsValue.sharedReportId };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/delete-tag.ts b/packages/pieces/community/clockify/src/lib/actions/ai/delete-tag.tsnew file mode 100644index 00000000000..eb1d0f596ee--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/delete-tag.ts@@ -0,0 +1,31 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { tagOutputSchema } from '../../output-schemas';++export const deleteTagAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_delete_tag',+ outputSchema: tagOutputSchema,+ displayName: 'Delete Tag',+ description: 'Deletes a tag.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description: 'Permanently deletes a tag and removes it from every time entry that used it.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ tagId: clockifyAiProps.tagId({ required: true }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.deleteTag({+ auth,+ workspaceId: propsValue.workspaceId,+ tagId: propsValue.tagId,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/delete-task.ts b/packages/pieces/community/clockify/src/lib/actions/ai/delete-task.tsnew file mode 100644index 00000000000..f149ed7fb54--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/delete-task.ts@@ -0,0 +1,34 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { taskOutputSchema } from '../../output-schemas';++export const deleteTaskAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_delete_task',+ outputSchema: taskOutputSchema,+ displayName: 'Delete Task',+ description: 'Deletes a task marked Done.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently deletes a task from a project. Clockify only deletes tasks marked Done, so set its status to Done with Update Task first. Time entries on it keep their project but lose the task.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ projectId: clockifyAiProps.projectId({ required: true }),+ taskId: clockifyAiProps.taskId({ required: true }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.deleteTask({+ auth,+ workspaceId: propsValue.workspaceId,+ projectId: propsValue.projectId,+ taskId: propsValue.taskId,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/delete-template.ts b/packages/pieces/community/clockify/src/lib/actions/ai/delete-template.tsnew file mode 100644index 00000000000..91ce4800379--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/delete-template.ts@@ -0,0 +1,32 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { templateOutputSchema } from '../../output-schemas';++export const deleteTemplateAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_delete_template',+ outputSchema: templateOutputSchema,+ displayName: 'Delete Template',+ description: 'Deletes a timesheet template.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently deletes a timesheet template. Time entries made from it are untouched.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ templateId: clockifyAiProps.templateId({ required: true }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.deleteTemplate({+ auth,+ workspaceId: propsValue.workspaceId,+ templateId: propsValue.templateId,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/delete-time-entry.ts b/packages/pieces/community/clockify/src/lib/actions/ai/delete-time-entry.tsnew file mode 100644index 00000000000..2c963bc38cf--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/delete-time-entry.ts@@ -0,0 +1,32 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { deletedOutputSchema } from '../../output-schemas';++export const deleteTimeEntryAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_delete_time_entry',+ outputSchema: deletedOutputSchema,+ displayName: 'Delete Time Entry',+ description: 'Deletes a time entry.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description: 'Permanently deletes one time entry. Locked (approved) entries cannot be deleted.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ timeEntryId: clockifyAiProps.timeEntryId({ required: true }),+ },+ async run({ auth, propsValue }) {+ await clockifyApi.deleteTimeEntry({+ auth,+ workspaceId: propsValue.workspaceId,+ timeEntryId: propsValue.timeEntryId,+ });+ return { deleted: true, id: propsValue.timeEntryId };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/delete-user-group.ts b/packages/pieces/community/clockify/src/lib/actions/ai/delete-user-group.tsnew file mode 100644index 00000000000..69a9bce34e4--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/delete-user-group.ts@@ -0,0 +1,32 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { userGroupOutputSchema } from '../../output-schemas';++export const deleteUserGroupAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_delete_user_group',+ outputSchema: userGroupOutputSchema,+ displayName: 'Delete User Group',+ description: 'Deletes a user group.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Permanently deletes a user group. Its members stay in the workspace; only the grouping and its project memberships go. Needs workspace admin.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ userGroupId: clockifyAiProps.userGroupId({ required: true }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.deleteUserGroup({+ auth,+ workspaceId: propsValue.workspaceId,+ userGroupId: propsValue.userGroupId,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/duplicate-time-entry.ts b/packages/pieces/community/clockify/src/lib/actions/ai/duplicate-time-entry.tsnew file mode 100644index 00000000000..c6919ee3b7f--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/duplicate-time-entry.ts@@ -0,0 +1,38 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { timeEntryOutputSchema } from '../../output-schemas';++export const duplicateTimeEntryAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_duplicate_time_entry',+ outputSchema: timeEntryOutputSchema,+ displayName: 'Duplicate Time Entry',+ description: 'Copies a time entry.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Creates a copy of an existing time entry of a user (same times, project, task, tags and description) and returns the new entry. Defaults to the connected user. Not idempotent.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ userId: clockifyAiProps.userId({+ required: false,+ description: 'User ID. Empty = the connected user. Another user needs workspace admin.',+ }),+ timeEntryId: clockifyAiProps.timeEntryId({ required: true }),+ },+ async run({ auth, propsValue }) {+ const userId = propsValue.userId ?? (await clockifyApi.getCurrentUser({ auth })).id;+ return await clockifyApi.duplicateTimeEntry({+ auth,+ workspaceId: propsValue.workspaceId,+ userId,+ timeEntryId: propsValue.timeEntryId,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/generate-attendance-report.ts b/packages/pieces/community/clockify/src/lib/actions/ai/generate-attendance-report.tsnew file mode 100644index 00000000000..6042ca6b6fa--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/generate-attendance-report.ts@@ -0,0 +1,79 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { attendanceReportOutputSchema } from '../../output-schemas';++export const generateAttendanceReportAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_generate_attendance_report',+ outputSchema: attendanceReportOutputSchema,+ displayName: 'Generate Attendance Report',+ description: 'Daily first-in, last-out and break times per user.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Returns per-user, per-day attendance in a period: first start, last end, tracked time, breaks and overtime. Needs a Clockify plan with attendance (Standard or higher). Clockify counts whole days: From is moved to the start of its day and To to the end of its day (UTC). Returns one page.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ dateRangeStart: clockifyAiProps.dateRangeStart({ required: true }),+ dateRangeEnd: clockifyAiProps.dateRangeEnd({ required: true }),+ projectIds: clockifyAiProps.idList({+ required: false,+ displayName: 'Project IDs',+ description: 'Optional: only these projects. Use List Projects.',+ }),+ userIds: clockifyAiProps.idList({+ required: false,+ displayName: 'User IDs',+ description: 'Optional: only these users. Use List Users.',+ }),+ clientIds: clockifyAiProps.idList({+ required: false,+ displayName: 'Client IDs',+ description: 'Optional: only these clients. Use List Clients.',+ }),+ tagIds: clockifyAiProps.idList({+ required: false,+ displayName: 'Tag IDs',+ description: 'Optional: only entries with these tags. Use List Tags.',+ }),+ billable: Property.StaticDropdown({+ displayName: 'Billable',+ description: 'Optional: only billable (Yes) or non-billable (No) time. Empty = both.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ }),+ page: clockifyAiProps.page({ required: false }),+ pageSize: clockifyAiProps.pageSize({ required: false }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.generateReport({+ auth,+ workspaceId: propsValue.workspaceId,+ kind: 'attendance',+ report: {+ dateRangeStart: `${propsValue.dateRangeStart.slice(0, 10)}T00:00:00.000Z`,+ dateRangeEnd: `${propsValue.dateRangeEnd.slice(0, 10)}T23:59:59.999Z`,+ exportType: 'JSON',+ projects: clockifyUtils.entityFilter({ ids: propsValue.projectIds }),+ users: clockifyUtils.entityFilter({ ids: propsValue.userIds }),+ clients: clockifyUtils.entityFilter({ ids: propsValue.clientIds }),+ tags: clockifyUtils.entityFilter({ ids: propsValue.tagIds }),+ billable: clockifyUtils.toOptionalBoolean({ value: propsValue.billable }),+ attendanceFilter: { page: propsValue.page ?? 1, pageSize: propsValue.pageSize ?? 50 },+ },+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/generate-detailed-report.ts b/packages/pieces/community/clockify/src/lib/actions/ai/generate-detailed-report.tsnew file mode 100644index 00000000000..ba556d4d40f--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/generate-detailed-report.ts@@ -0,0 +1,83 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { detailedReportOutputSchema } from '../../output-schemas';++export const generateDetailedReportAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_generate_detailed_report',+ outputSchema: detailedReportOutputSchema,+ displayName: 'Generate Detailed Report',+ description: 'Lists every time entry in a period across the workspace.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Returns the time entries of the whole workspace (all users) in a period, with totals, optionally filtered by project, user, client, tag or billable. Use it for timesheets and exports; for one user List Time Entries is enough. Returns one page; ask for the next page while there are more.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ dateRangeStart: clockifyAiProps.dateRangeStart({ required: true }),+ dateRangeEnd: clockifyAiProps.dateRangeEnd({ required: true }),+ projectIds: clockifyAiProps.idList({+ required: false,+ displayName: 'Project IDs',+ description: 'Optional: only these projects. Use List Projects.',+ }),+ userIds: clockifyAiProps.idList({+ required: false,+ displayName: 'User IDs',+ description: 'Optional: only these users. Use List Users.',+ }),+ clientIds: clockifyAiProps.idList({+ required: false,+ displayName: 'Client IDs',+ description: 'Optional: only these clients. Use List Clients.',+ }),+ tagIds: clockifyAiProps.idList({+ required: false,+ displayName: 'Tag IDs',+ description: 'Optional: only entries with these tags. Use List Tags.',+ }),+ billable: Property.StaticDropdown({+ displayName: 'Billable',+ description: 'Optional: only billable (Yes) or non-billable (No) time. Empty = both.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ }),+ page: clockifyAiProps.page({ required: false }),+ pageSize: clockifyAiProps.pageSize({ required: false }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.generateReport({+ auth,+ workspaceId: propsValue.workspaceId,+ kind: 'detailed',+ report: {+ dateRangeStart: propsValue.dateRangeStart,+ dateRangeEnd: propsValue.dateRangeEnd,+ exportType: 'JSON',+ projects: clockifyUtils.entityFilter({ ids: propsValue.projectIds }),+ users: clockifyUtils.entityFilter({ ids: propsValue.userIds }),+ clients: clockifyUtils.entityFilter({ ids: propsValue.clientIds }),+ tags: clockifyUtils.entityFilter({ ids: propsValue.tagIds }),+ billable: clockifyUtils.toOptionalBoolean({ value: propsValue.billable }),+ detailedFilter: {+ page: propsValue.page ?? 1,+ pageSize: propsValue.pageSize ?? 50,+ sortColumn: 'DATE',+ },+ },+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/generate-expense-report.ts b/packages/pieces/community/clockify/src/lib/actions/ai/generate-expense-report.tsnew file mode 100644index 00000000000..782b7d43932--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/generate-expense-report.ts@@ -0,0 +1,55 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { expenseReportOutputSchema } from '../../output-schemas';++export const generateExpenseReportAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_generate_expense_report',+ outputSchema: expenseReportOutputSchema,+ displayName: 'Generate Expense Report',+ description: 'Lists expenses in a period.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Returns the expenses of the workspace in a period with totals, optionally filtered by project or user. Needs a Clockify plan with expenses (Pro or higher). Returns one page.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ dateRangeStart: clockifyAiProps.dateRangeStart({ required: true }),+ dateRangeEnd: clockifyAiProps.dateRangeEnd({ required: true }),+ projectIds: clockifyAiProps.idList({+ required: false,+ displayName: 'Project IDs',+ description: 'Optional: only these projects. Use List Projects.',+ }),+ userIds: clockifyAiProps.idList({+ required: false,+ displayName: 'User IDs',+ description: 'Optional: only these users. Use List Users.',+ }),+ page: clockifyAiProps.page({ required: false }),+ pageSize: clockifyAiProps.pageSize({ required: false }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.generateReport({+ auth,+ workspaceId: propsValue.workspaceId,+ kind: 'expenses/detailed',+ report: {+ dateRangeStart: propsValue.dateRangeStart,+ dateRangeEnd: propsValue.dateRangeEnd,+ exportType: 'JSON',+ projects: clockifyUtils.entityFilter({ ids: propsValue.projectIds }),+ users: clockifyUtils.entityFilter({ ids: propsValue.userIds }),+ page: propsValue.page ?? 1,+ pageSize: propsValue.pageSize ?? 50,+ },+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/generate-summary-report.ts b/packages/pieces/community/clockify/src/lib/actions/ai/generate-summary-report.tsnew file mode 100644index 00000000000..969300f3ac5--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/generate-summary-report.ts@@ -0,0 +1,99 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { summaryReportOutputSchema } from '../../output-schemas';++export const generateSummaryReportAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_generate_summary_report',+ outputSchema: summaryReportOutputSchema,+ displayName: 'Generate Summary Report',+ description: 'Totals tracked time in a period, grouped.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Returns total tracked time and amounts in a period, grouped by up to three levels (project, client, user, task, tag, date...), optionally filtered by project, user, client, tag or billable. Use it for "how much time did we spend on X".',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ dateRangeStart: clockifyAiProps.dateRangeStart({ required: true }),+ dateRangeEnd: clockifyAiProps.dateRangeEnd({ required: true }),+ projectIds: clockifyAiProps.idList({+ required: false,+ displayName: 'Project IDs',+ description: 'Optional: only these projects. Use List Projects.',+ }),+ userIds: clockifyAiProps.idList({+ required: false,+ displayName: 'User IDs',+ description: 'Optional: only these users. Use List Users.',+ }),+ clientIds: clockifyAiProps.idList({+ required: false,+ displayName: 'Client IDs',+ description: 'Optional: only these clients. Use List Clients.',+ }),+ tagIds: clockifyAiProps.idList({+ required: false,+ displayName: 'Tag IDs',+ description: 'Optional: only entries with these tags. Use List Tags.',+ }),+ billable: Property.StaticDropdown({+ displayName: 'Billable',+ description: 'Optional: only billable (Yes) or non-billable (No) time. Empty = both.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ }),+ groups: Property.StaticMultiSelectDropdown({+ displayName: 'Group By',+ description: 'Up to three levels of grouping, in order. Default Project.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Project', value: 'PROJECT' },+ { label: 'Client', value: 'CLIENT' },+ { label: 'User', value: 'USER' },+ { label: 'User Group', value: 'USER_GROUP' },+ { label: 'Task', value: 'TASK' },+ { label: 'Tag', value: 'TAG' },+ { label: 'Date', value: 'DATE' },+ { label: 'Week', value: 'WEEK' },+ { label: 'Month', value: 'MONTH' },+ ],+ },+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.generateReport({+ auth,+ workspaceId: propsValue.workspaceId,+ kind: 'summary',+ report: {+ dateRangeStart: propsValue.dateRangeStart,+ dateRangeEnd: propsValue.dateRangeEnd,+ exportType: 'JSON',+ projects: clockifyUtils.entityFilter({ ids: propsValue.projectIds }),+ users: clockifyUtils.entityFilter({ ids: propsValue.userIds }),+ clients: clockifyUtils.entityFilter({ ids: propsValue.clientIds }),+ tags: clockifyUtils.entityFilter({ ids: propsValue.tagIds }),+ billable: clockifyUtils.toOptionalBoolean({ value: propsValue.billable }),+ summaryFilter: {+ groups:+ propsValue.groups && propsValue.groups.length > 0 ? propsValue.groups : ['PROJECT'],+ },+ },+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/generate-weekly-report.ts b/packages/pieces/community/clockify/src/lib/actions/ai/generate-weekly-report.tsnew file mode 100644index 00000000000..f1b350b00d8--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/generate-weekly-report.ts@@ -0,0 +1,92 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { weeklyReportOutputSchema } from '../../output-schemas';++export const generateWeeklyReportAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_generate_weekly_report',+ outputSchema: weeklyReportOutputSchema,+ displayName: 'Generate Weekly Report',+ description: 'Tracked time per day of the week, by project or user.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Returns tracked time per day for a period, as a grid by project or by user, with daily totals. Use it for weekly timesheet overviews.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ dateRangeStart: clockifyAiProps.dateRangeStart({ required: true }),+ dateRangeEnd: clockifyAiProps.dateRangeEnd({ required: true }),+ projectIds: clockifyAiProps.idList({+ required: false,+ displayName: 'Project IDs',+ description: 'Optional: only these projects. Use List Projects.',+ }),+ userIds: clockifyAiProps.idList({+ required: false,+ displayName: 'User IDs',+ description: 'Optional: only these users. Use List Users.',+ }),+ clientIds: clockifyAiProps.idList({+ required: false,+ displayName: 'Client IDs',+ description: 'Optional: only these clients. Use List Clients.',+ }),+ tagIds: clockifyAiProps.idList({+ required: false,+ displayName: 'Tag IDs',+ description: 'Optional: only entries with these tags. Use List Tags.',+ }),+ billable: Property.StaticDropdown({+ displayName: 'Billable',+ description: 'Optional: only billable (Yes) or non-billable (No) time. Empty = both.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ }),+ group: Property.StaticDropdown({+ displayName: 'Group By',+ description: 'Rows of the weekly grid. Default Project.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Project', value: 'PROJECT' },+ { label: 'User', value: 'USER' },+ ],+ },+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.generateReport({+ auth,+ workspaceId: propsValue.workspaceId,+ kind: 'weekly',+ report: {+ dateRangeStart: propsValue.dateRangeStart,+ dateRangeEnd: propsValue.dateRangeEnd,+ exportType: 'JSON',+ projects: clockifyUtils.entityFilter({ ids: propsValue.projectIds }),+ users: clockifyUtils.entityFilter({ ids: propsValue.userIds }),+ clients: clockifyUtils.entityFilter({ ids: propsValue.clientIds }),+ tags: clockifyUtils.entityFilter({ ids: propsValue.tagIds }),+ billable: clockifyUtils.toOptionalBoolean({ value: propsValue.billable }),+ weeklyFilter: {+ group: propsValue.group ?? 'PROJECT',+ subgroup: 'TIME',+ },+ },+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/get-client.ts b/packages/pieces/community/clockify/src/lib/actions/ai/get-client.tsnew file mode 100644index 00000000000..9a2caa0af09--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/get-client.ts@@ -0,0 +1,32 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clientOutputSchema } from '../../output-schemas';++export const getClientAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_get_client',+ outputSchema: clientOutputSchema,+ displayName: 'Get Client',+ description: 'Gets a client by ID.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Returns one Clockify client by ID: name, email, address, note, currency and archived state.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ clientId: clockifyAiProps.clientId({ required: true }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.getClient({+ auth,+ workspaceId: propsValue.workspaceId,+ clientId: propsValue.clientId,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/get-current-user.ts b/packages/pieces/community/clockify/src/lib/actions/ai/get-current-user.tsnew file mode 100644index 00000000000..a2490722eb0--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/get-current-user.ts@@ -0,0 +1,34 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyApi } from '../../common/api';+import { currentUserOutputSchema } from '../../output-schemas';++export const getCurrentUserAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_get_current_user',+ outputSchema: currentUserOutputSchema,+ displayName: 'Get Current User',+ description: 'Gets the user the connection belongs to.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Returns the connected Clockify user: ID, name, email, active and default workspace IDs and settings. Use it to get your own user ID for actions that take one.',+ idempotent: true,+ },+ props: {+ includeMemberships: Property.Checkbox({+ displayName: 'Include Memberships',+ description:+ 'Also return the user memberships (workspaces and projects the user belongs to). Default false.',+ required: false,+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.getCurrentUser({+ auth,+ query: propsValue.includeMemberships ? { 'include-memberships': 'true' } : {},+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/get-member-profile.ts b/packages/pieces/community/clockify/src/lib/actions/ai/get-member-profile.tsnew file mode 100644index 00000000000..6b2e76cbda5--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/get-member-profile.ts@@ -0,0 +1,32 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { memberProfileOutputSchema } from '../../output-schemas';++export const getMemberProfileAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_get_member_profile',+ outputSchema: memberProfileOutputSchema,+ displayName: 'Get Member Profile',+ description: "Gets a workspace member's profile.",+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ "Returns a workspace member's profile: name, email, week start, daily work capacity, working days and user custom field values.",+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ userId: clockifyAiProps.userId({ required: true }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.getMemberProfile({+ auth,+ workspaceId: propsValue.workspaceId,+ userId: propsValue.userId,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/get-project.ts b/packages/pieces/community/clockify/src/lib/actions/ai/get-project.tsnew file mode 100644index 00000000000..6536219a723--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/get-project.ts@@ -0,0 +1,32 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { projectOutputSchema } from '../../output-schemas';++export const getProjectAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_get_project',+ outputSchema: projectOutputSchema,+ displayName: 'Get Project',+ description: 'Gets a project by ID.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Returns one Clockify project by ID: name, client, color, billable and archived state, rates, estimates and memberships.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ projectId: clockifyAiProps.projectId({ required: true }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.getProject({+ auth,+ workspaceId: propsValue.workspaceId,+ projectId: propsValue.projectId,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/get-shared-report.ts b/packages/pieces/community/clockify/src/lib/actions/ai/get-shared-report.tsnew file mode 100644index 00000000000..1d377fa0e9e--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/get-shared-report.ts@@ -0,0 +1,50 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { sharedReportDataOutputSchema } from '../../output-schemas';++export const getSharedReportAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_get_shared_report',+ outputSchema: sharedReportDataOutputSchema,+ displayName: 'Get Shared Report',+ description: 'Runs a shared report and returns its data.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Runs a shared report by ID and returns its data (totals and rows, in the shape of its type), optionally for a different period than it was saved with.',+ idempotent: true,+ },+ props: {+ sharedReportId: clockifyAiProps.sharedReportId({ required: true }),+ dateRangeStart: clockifyAiProps.dateRangeStart({+ required: false,+ description: 'Optional start of the period, ISO 8601. Empty = the saved period.',+ }),+ dateRangeEnd: clockifyAiProps.dateRangeEnd({+ required: false,+ description: 'Optional end of the period, ISO 8601. Empty = the saved period.',+ }),+ page: clockifyAiProps.page({ required: false }),+ pageSize: clockifyAiProps.pageSize({ required: false }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.getSharedReport({+ auth,+ sharedReportId: propsValue.sharedReportId,+ query: clockifyUtils.toQuery({+ params: {+ dateRangeStart: propsValue.dateRangeStart,+ dateRangeEnd: propsValue.dateRangeEnd,+ exportType: 'JSON',+ page: propsValue.page ?? 1,+ pageSize: propsValue.pageSize ?? 50,+ },+ }),+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/get-tag.ts b/packages/pieces/community/clockify/src/lib/actions/ai/get-tag.tsnew file mode 100644index 00000000000..45334758d91--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/get-tag.ts@@ -0,0 +1,31 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { tagOutputSchema } from '../../output-schemas';++export const getTagAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_get_tag',+ outputSchema: tagOutputSchema,+ displayName: 'Get Tag',+ description: 'Gets a tag by ID.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description: 'Returns one Clockify tag by ID: name and archived state.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ tagId: clockifyAiProps.tagId({ required: true }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.getTag({+ auth,+ workspaceId: propsValue.workspaceId,+ tagId: propsValue.tagId,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/get-task.ts b/packages/pieces/community/clockify/src/lib/actions/ai/get-task.tsnew file mode 100644index 00000000000..48d987bb81b--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/get-task.ts@@ -0,0 +1,34 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { taskOutputSchema } from '../../output-schemas';++export const getTaskAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_get_task',+ outputSchema: taskOutputSchema,+ displayName: 'Get Task',+ description: 'Gets a task by ID.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Returns one task of a Clockify project by ID: name, status, assignees, estimate, billable flag and rates.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ projectId: clockifyAiProps.projectId({ required: true }),+ taskId: clockifyAiProps.taskId({ required: true }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.getTask({+ auth,+ workspaceId: propsValue.workspaceId,+ projectId: propsValue.projectId,+ taskId: propsValue.taskId,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/get-template.ts b/packages/pieces/community/clockify/src/lib/actions/ai/get-template.tsnew file mode 100644index 00000000000..d52ae72a236--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/get-template.ts@@ -0,0 +1,39 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { hydratedTemplateOutputSchema } from '../../output-schemas';++export const getTemplateAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_get_template',+ outputSchema: hydratedTemplateOutputSchema,+ displayName: 'Get Template',+ description: 'Gets a timesheet template by ID.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Returns one timesheet template by ID, with its project and task rows when Include Details is set.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ templateId: clockifyAiProps.templateId({ required: true }),+ hydrated: Property.Checkbox({+ displayName: 'Include Details',+ description: 'Return the template projects, tasks and entries. Default false.',+ required: false,+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.getTemplate({+ auth,+ workspaceId: propsValue.workspaceId,+ templateId: propsValue.templateId,+ query: clockifyUtils.toQuery({ params: { hydrated: propsValue.hydrated } }),+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/get-time-entries-by-ids.ts b/packages/pieces/community/clockify/src/lib/actions/ai/get-time-entries-by-ids.tsnew file mode 100644index 00000000000..7ea2408056e--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/get-time-entries-by-ids.ts@@ -0,0 +1,39 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { hydratedTimeEntriesOutputSchema } from '../../output-schemas';++export const getTimeEntriesByIdsAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_get_time_entries_by_ids',+ outputSchema: hydratedTimeEntriesOutputSchema,+ displayName: 'Get Time Entries by IDs',+ description: 'Gets several time entries by ID.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Returns several time entries of a workspace in one call, by their IDs. Use it instead of repeating Get Time Entry.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ timeEntryIds: clockifyAiProps.timeEntryIds({ required: true }),+ hydrated: Property.Checkbox({+ displayName: 'Include Details',+ description: 'Return project, task and tag objects instead of only their IDs. Default false.',+ required: false,+ }),+ },+ async run({ auth, propsValue }) {+ const timeEntries = await clockifyApi.getTimeEntriesByIds({+ auth,+ workspaceId: propsValue.workspaceId,+ timeEntryIds: propsValue.timeEntryIds.map(String),+ hydrated: propsValue.hydrated,+ });+ return { timeEntries, count: timeEntries.length };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/get-time-entry.ts b/packages/pieces/community/clockify/src/lib/actions/ai/get-time-entry.tsnew file mode 100644index 00000000000..abdd388e3df--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/get-time-entry.ts@@ -0,0 +1,39 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { hydratedTimeEntryOutputSchema } from '../../output-schemas';++export const getTimeEntryAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_get_time_entry',+ outputSchema: hydratedTimeEntryOutputSchema,+ displayName: 'Get Time Entry',+ description: 'Gets a time entry by ID.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Returns one Clockify time entry by ID: description, start, end and duration, user, project, task, tags and billable flag.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ timeEntryId: clockifyAiProps.timeEntryId({ required: true }),+ hydrated: Property.Checkbox({+ displayName: 'Include Details',+ description: 'Return project, task and tag objects instead of only their IDs. Default false.',+ required: false,+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.getTimeEntry({+ auth,+ workspaceId: propsValue.workspaceId,+ timeEntryId: propsValue.timeEntryId,+ query: clockifyUtils.toQuery({ params: { hydrated: propsValue.hydrated } }),+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/get-workspace.ts b/packages/pieces/community/clockify/src/lib/actions/ai/get-workspace.tsnew file mode 100644index 00000000000..0fcb2dcef4f--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/get-workspace.ts@@ -0,0 +1,27 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { workspaceOutputSchema } from '../../output-schemas';++export const getWorkspaceAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_get_workspace',+ outputSchema: workspaceOutputSchema,+ displayName: 'Get Workspace',+ description: 'Gets a workspace by ID.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description:+ 'Returns one Clockify workspace by ID: name, billable and cost rates, currencies, members and workspace settings (time rounding, feature flags, plan features).',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.getWorkspace({ auth, workspaceId: propsValue.workspaceId });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/index.ts b/packages/pieces/community/clockify/src/lib/actions/ai/index.tsnew file mode 100644index 00000000000..b02482407de--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/index.ts@@ -0,0 +1,181 @@+import { addUserRoleAction } from './add-user-role';+import { addUserToGroupAction } from './add-user-to-group';+import { assignProjectUsersAction } from './assign-project-users';+import { bulkDeleteTimeEntriesAction } from './bulk-delete-time-entries';+import { bulkUpdateTimeEntriesAction } from './bulk-update-time-entries';+import { createClientAction } from './create-client';+import { createHolidayAction } from './create-holiday';+import { createProjectAction } from './create-project';+import { createProjectFromTemplateAction } from './create-project-from-template';+import { createSharedReportAction } from './create-shared-report';+import { createTagAction } from './create-tag';+import { createTaskAiAction } from './create-task';+import { createTemplateAction } from './create-template';+import { createTimeEntryAiAction } from './create-time-entry';+import { createUserGroupAction } from './create-user-group';+import { createUserTimeEntryAction } from './create-user-time-entry';+import { createWorkspaceAction } from './create-workspace';+import { deleteClientAction } from './delete-client';+import { deleteHolidayAction } from './delete-holiday';+import { deleteProjectAction } from './delete-project';+import { deleteSharedReportAction } from './delete-shared-report';+import { deleteTagAction } from './delete-tag';+import { deleteTaskAction } from './delete-task';+import { deleteTemplateAction } from './delete-template';+import { deleteTimeEntryAction } from './delete-time-entry';+import { deleteUserGroupAction } from './delete-user-group';+import { duplicateTimeEntryAction } from './duplicate-time-entry';+import { generateAttendanceReportAction } from './generate-attendance-report';+import { generateDetailedReportAction } from './generate-detailed-report';+import { generateExpenseReportAction } from './generate-expense-report';+import { generateSummaryReportAction } from './generate-summary-report';+import { generateWeeklyReportAction } from './generate-weekly-report';+import { getClientAction } from './get-client';+import { getCurrentUserAction } from './get-current-user';+import { getMemberProfileAction } from './get-member-profile';+import { getProjectAction } from './get-project';+import { getSharedReportAction } from './get-shared-report';+import { getTagAction } from './get-tag';+import { getTaskAction } from './get-task';+import { getTemplateAction } from './get-template';+import { getTimeEntriesByIdsAction } from './get-time-entries-by-ids';+import { getTimeEntryAction } from './get-time-entry';+import { getWorkspaceAction } from './get-workspace';+import { listAssignmentsAction } from './list-assignments';+import { listClientsAction } from './list-clients';+import { listCreatedEntitiesAction } from './list-created-entities';+import { listCustomFieldsAction } from './list-custom-fields';+import { listHolidaysAction } from './list-holidays';+import { listHolidaysInPeriodAction } from './list-holidays-in-period';+import { listProjectCustomFieldsAction } from './list-project-custom-fields';+import { listProjectsAction } from './list-projects';+import { listRunningTimeEntriesAction } from './list-running-time-entries';+import { listSharedReportsAction } from './list-shared-reports';+import { listTagsAction } from './list-tags';+import { listTasksAction } from './list-tasks';+import { listTemplatesAction } from './list-templates';+import { listTimeEntriesAction } from './list-time-entries';+import { listUserGroupsAction } from './list-user-groups';+import { listUserManagersAction } from './list-user-managers';+import { listUsersAction } from './list-users';+import { listWorkspacesAction } from './list-workspaces';+import { markTimeEntriesInvoicedAction } from './mark-time-entries-invoiced';+import { removeUserFromGroupAction } from './remove-user-from-group';+import { removeUserRoleAction } from './remove-user-role';+import { startTimerAiAction } from './start-timer';+import { stopTimerAiAction } from './stop-timer';+import { updateClientAction } from './update-client';+import { updateHolidayAction } from './update-holiday';+import { updateMemberProfileAction } from './update-member-profile';+import { updateProjectAction } from './update-project';+import { updateProjectEstimateAction } from './update-project-estimate';+import { updateProjectMembershipsAction } from './update-project-memberships';+import { updateProjectTemplateAction } from './update-project-template';+import { updateProjectUserBillableRateAction } from './update-project-user-billable-rate';+import { updateProjectUserCostRateAction } from './update-project-user-cost-rate';+import { updateSharedReportAction } from './update-shared-report';+import { updateTagAction } from './update-tag';+import { updateTaskAction } from './update-task';+import { updateTaskBillableRateAction } from './update-task-billable-rate';+import { updateTaskCostRateAction } from './update-task-cost-rate';+import { updateTemplateAction } from './update-template';+import { updateTimeEntryAction } from './update-time-entry';+import { updateUserBillableRateAction } from './update-user-billable-rate';+import { updateUserCostRateAction } from './update-user-cost-rate';+import { updateUserCustomFieldAction } from './update-user-custom-field';+import { updateUserGroupAction } from './update-user-group';+import { updateUserStatusAction } from './update-user-status';+import { updateWorkspaceBillableRateAction } from './update-workspace-billable-rate';+import { updateWorkspaceCostRateAction } from './update-workspace-cost-rate';++export const clockifyAiActions = [+ addUserRoleAction,+ addUserToGroupAction,+ assignProjectUsersAction,+ bulkDeleteTimeEntriesAction,+ bulkUpdateTimeEntriesAction,+ createClientAction,+ createHolidayAction,+ createProjectFromTemplateAction,+ createProjectAction,+ createSharedReportAction,+ createTagAction,+ createTaskAiAction,+ createTemplateAction,+ createTimeEntryAiAction,+ createUserGroupAction,+ createUserTimeEntryAction,+ createWorkspaceAction,+ deleteClientAction,+ deleteHolidayAction,+ deleteProjectAction,+ deleteSharedReportAction,+ deleteTagAction,+ deleteTaskAction,+ deleteTemplateAction,+ deleteTimeEntryAction,+ deleteUserGroupAction,+ duplicateTimeEntryAction,+ generateAttendanceReportAction,+ generateDetailedReportAction,+ generateExpenseReportAction,+ generateSummaryReportAction,+ generateWeeklyReportAction,+ getClientAction,+ getCurrentUserAction,+ getMemberProfileAction,+ getProjectAction,+ getSharedReportAction,+ getTagAction,+ getTaskAction,+ getTemplateAction,+ getTimeEntriesByIdsAction,+ getTimeEntryAction,+ getWorkspaceAction,+ listAssignmentsAction,+ listClientsAction,+ listCreatedEntitiesAction,+ listCustomFieldsAction,+ listHolidaysInPeriodAction,+ listHolidaysAction,+ listProjectCustomFieldsAction,+ listProjectsAction,+ listRunningTimeEntriesAction,+ listSharedReportsAction,+ listTagsAction,+ listTasksAction,+ listTemplatesAction,+ listTimeEntriesAction,+ listUserGroupsAction,+ listUserManagersAction,+ listUsersAction,+ listWorkspacesAction,+ markTimeEntriesInvoicedAction,+ removeUserFromGroupAction,+ removeUserRoleAction,+ startTimerAiAction,+ stopTimerAiAction,+ updateClientAction,+ updateHolidayAction,+ updateMemberProfileAction,+ updateProjectEstimateAction,+ updateProjectMembershipsAction,+ updateProjectTemplateAction,+ updateProjectUserBillableRateAction,+ updateProjectUserCostRateAction,+ updateProjectAction,+ updateSharedReportAction,+ updateTagAction,+ updateTaskBillableRateAction,+ updateTaskCostRateAction,+ updateTaskAction,+ updateTemplateAction,+ updateTimeEntryAction,+ updateUserBillableRateAction,+ updateUserCostRateAction,+ updateUserCustomFieldAction,+ updateUserGroupAction,+ updateUserStatusAction,+ updateWorkspaceBillableRateAction,+ updateWorkspaceCostRateAction,+];diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/list-assignments.ts b/packages/pieces/community/clockify/src/lib/actions/ai/list-assignments.tsnew file mode 100644index 00000000000..f0573661b3d--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/list-assignments.ts@@ -0,0 +1,58 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { assignmentsOutputSchema } from '../../output-schemas';++export const listAssignmentsAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_list_assignments',+ outputSchema: assignmentsOutputSchema,+ displayName: 'List Assignments',+ description: 'Lists scheduled assignments in a period.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists scheduled assignments (who is planned on which project, hours per day) in a period across the workspace, optionally filtered by name. Needs a Clockify plan with scheduling (Pro or higher). Returns one page.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ start: Property.DateTime({+ displayName: 'From',+ description: 'Start of the period, ISO 8601.',+ required: true,+ }),+ end: Property.DateTime({+ displayName: 'To',+ description: 'End of the period, ISO 8601.',+ required: true,+ }),+ name: Property.ShortText({+ displayName: 'Name',+ description: 'Optional: only assignments whose project or user name contains this text.',+ required: false,+ }),+ page: clockifyAiProps.page({ required: false }),+ pageSize: clockifyAiProps.pageSize({ required: false }),+ },+ async run({ auth, propsValue }) {+ const assignments = await clockifyApi.listAssignments({+ auth,+ workspaceId: propsValue.workspaceId,+ query: clockifyUtils.toQuery({+ params: {+ start: propsValue.start,+ end: propsValue.end,+ name: propsValue.name,+ page: propsValue.page ?? 1,+ 'page-size': propsValue.pageSize ?? 50,+ },+ }),+ });+ return { assignments, count: assignments.length };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/list-clients.ts b/packages/pieces/community/clockify/src/lib/actions/ai/list-clients.tsnew file mode 100644index 00000000000..547b26e4b01--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/list-clients.ts@@ -0,0 +1,59 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { clientsOutputSchema } from '../../output-schemas';++export const listClientsAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_list_clients',+ outputSchema: clientsOutputSchema,+ displayName: 'List Clients',+ description: 'Lists or searches the clients of a workspace.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists the clients of a Clockify workspace, optionally filtered by name or archived state. Use it to find a client ID. Returns one page.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ name: Property.ShortText({+ displayName: 'Name',+ description: 'Optional: only clients whose name contains this text.',+ required: false,+ }),+ archived: Property.StaticDropdown({+ displayName: 'Archived',+ description: 'Optional: only archived (Yes) or only active (No) clients. Empty = both.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ }),+ page: clockifyAiProps.page({ required: false }),+ pageSize: clockifyAiProps.pageSize({ required: false }),+ },+ async run({ auth, propsValue }) {+ const clients = await clockifyApi.listClients({+ auth,+ workspaceId: propsValue.workspaceId,+ query: clockifyUtils.toQuery({+ params: {+ name: propsValue.name,+ archived: propsValue.archived,+ page: propsValue.page ?? 1,+ 'page-size': propsValue.pageSize ?? 50,+ },+ }),+ });+ return { clients, count: clients.length };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/list-created-entities.ts b/packages/pieces/community/clockify/src/lib/actions/ai/list-created-entities.tsnew file mode 100644index 00000000000..4736621d9b5--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/list-created-entities.ts@@ -0,0 +1,57 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { createdEntitiesOutputSchema } from '../../output-schemas';++export const listCreatedEntitiesAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_list_created_entities',+ outputSchema: createdEntitiesOutputSchema,+ displayName: 'List Created Entities',+ description: 'Lists records of one type created in a period.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists records of one type (for example TIME_ENTRY or PROJECTS) created in a workspace within a period: a change feed for syncing Clockify to another system. Set From and To to the period you need; without them Clockify only looks at a short recent window. Experimental Clockify endpoint. Returns one page.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ entityType: clockifyAiProps.changeFeedEntityType({ required: true }),+ start: Property.DateTime({+ displayName: 'From',+ description: 'Optional start of the period, ISO 8601.',+ required: false,+ }),+ end: Property.DateTime({+ displayName: 'To',+ description: 'Optional end of the period, ISO 8601.',+ required: false,+ }),+ page: clockifyAiProps.page({ required: false }),+ limit: Property.Number({+ displayName: 'Limit',+ description: 'Items per page. Default 50.',+ required: false,+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.listCreatedEntities({+ auth,+ workspaceId: propsValue.workspaceId,+ query: clockifyUtils.toQuery({+ params: {+ type: propsValue.entityType,+ start: propsValue.start,+ end: propsValue.end,+ page: propsValue.page ?? 1,+ limit: propsValue.limit ?? 50,+ },+ }),+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/list-custom-fields.ts b/packages/pieces/community/clockify/src/lib/actions/ai/list-custom-fields.tsnew file mode 100644index 00000000000..50ee466ce8d--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/list-custom-fields.ts@@ -0,0 +1,67 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { customFieldsOutputSchema } from '../../output-schemas';++export const listCustomFieldsAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_list_custom_fields',+ outputSchema: customFieldsOutputSchema,+ displayName: 'List Custom Fields',+ description: 'Lists the custom fields of a workspace.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists the custom fields defined in a workspace with their IDs, types, allowed values and defaults, optionally filtered by name, status or entity type (TIMEENTRY or USER). Needs a Clockify plan with custom fields (Pro or higher).',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ name: Property.ShortText({+ displayName: 'Name',+ description: 'Optional: only fields whose name contains this text.',+ required: false,+ }),+ status: Property.StaticDropdown({+ displayName: 'Status',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Visible', value: 'VISIBLE' },+ { label: 'Invisible', value: 'INVISIBLE' },+ { label: 'Inactive', value: 'INACTIVE' },+ ],+ },+ }),+ entityType: Property.StaticDropdown({+ displayName: 'Applies To',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Time entries', value: 'TIMEENTRY' },+ { label: 'Users', value: 'USER' },+ ],+ },+ }),+ },+ async run({ auth, propsValue }) {+ const customFields = await clockifyApi.listCustomFields({+ auth,+ workspaceId: propsValue.workspaceId,+ query: clockifyUtils.toQuery({+ params: {+ name: propsValue.name,+ status: propsValue.status,+ 'entity-type': propsValue.entityType,+ },+ }),+ });+ return { customFields, count: customFields.length };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/list-holidays-in-period.ts b/packages/pieces/community/clockify/src/lib/actions/ai/list-holidays-in-period.tsnew file mode 100644index 00000000000..18988f3292c--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/list-holidays-in-period.ts@@ -0,0 +1,48 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { holidaysOutputSchema } from '../../output-schemas';++export const listHolidaysInPeriodAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_list_holidays_in_period',+ outputSchema: holidaysOutputSchema,+ displayName: 'List Holidays in Period',+ description: 'Lists the holidays of a user between two dates.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists the holidays that fall between two dates for one user (default: the connected user), including yearly repeats. Use it to check days off before planning or logging time.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ assignedTo: clockifyAiProps.userId({+ required: false,+ displayName: 'User ID',+ description: 'User whose holidays to return. Empty = the connected user.',+ }),+ start: Property.DateTime({+ displayName: 'From',+ description: 'Start of the period, ISO 8601.',+ required: true,+ }),+ end: Property.DateTime({+ displayName: 'To',+ description: 'End of the period, ISO 8601.',+ required: true,+ }),+ },+ async run({ auth, propsValue }) {+ const assignedTo = propsValue.assignedTo ?? (await clockifyApi.getCurrentUser({ auth })).id;+ const holidays = await clockifyApi.listHolidaysInPeriod({+ auth,+ workspaceId: propsValue.workspaceId,+ query: { 'assigned-to': assignedTo, start: propsValue.start, end: propsValue.end },+ });+ return { holidays, count: holidays.length };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/list-holidays.ts b/packages/pieces/community/clockify/src/lib/actions/ai/list-holidays.tsnew file mode 100644index 00000000000..97392687df5--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/list-holidays.ts@@ -0,0 +1,38 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { holidaysOutputSchema } from '../../output-schemas';++export const listHolidaysAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_list_holidays',+ outputSchema: holidaysOutputSchema,+ displayName: 'List Holidays',+ description: 'Lists the holidays of a workspace.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists the holidays set up in a workspace with their dates, who they apply to and whether they repeat yearly. Optionally only holidays assigned to one user. Use it to find a holiday ID.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ assignedTo: clockifyAiProps.userId({+ required: false,+ displayName: 'Assigned To',+ description: 'Optional: only holidays that apply to this user ID.',+ }),+ },+ async run({ auth, propsValue }) {+ const holidays = await clockifyApi.listHolidays({+ auth,+ workspaceId: propsValue.workspaceId,+ query: clockifyUtils.toQuery({ params: { 'assigned-to': propsValue.assignedTo } }),+ });+ return { holidays, count: holidays.length };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/list-project-custom-fields.ts b/packages/pieces/community/clockify/src/lib/actions/ai/list-project-custom-fields.tsnew file mode 100644index 00000000000..f19dc9dce1b--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/list-project-custom-fields.ts@@ -0,0 +1,48 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { projectCustomFieldsOutputSchema } from '../../output-schemas';++export const listProjectCustomFieldsAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_list_project_custom_fields',+ outputSchema: projectCustomFieldsOutputSchema,+ displayName: 'List Project Custom Fields',+ description: 'Lists the custom fields of a project.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists the custom fields that apply to one project, with their IDs, types, allowed values and project default values. Needs a Clockify plan with custom fields (Pro or higher).',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ projectId: clockifyAiProps.projectId({ required: true }),+ status: Property.StaticDropdown({+ displayName: 'Status',+ description: 'Optional: only fields with this status.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Visible', value: 'VISIBLE' },+ { label: 'Invisible', value: 'INVISIBLE' },+ { label: 'Inactive', value: 'INACTIVE' },+ ],+ },+ }),+ },+ async run({ auth, propsValue }) {+ const customFields = await clockifyApi.listProjectCustomFields({+ auth,+ workspaceId: propsValue.workspaceId,+ projectId: propsValue.projectId,+ query: clockifyUtils.toQuery({ params: { status: propsValue.status } }),+ });+ return { customFields, count: customFields.length };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/list-projects.ts b/packages/pieces/community/clockify/src/lib/actions/ai/list-projects.tsnew file mode 100644index 00000000000..eb86bcba07f--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/list-projects.ts@@ -0,0 +1,96 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { projectsOutputSchema } from '../../output-schemas';++export const listProjectsAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_list_projects',+ outputSchema: projectsOutputSchema,+ displayName: 'List Projects',+ description: 'Lists or searches the projects of a workspace.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists the projects of a Clockify workspace, optionally filtered by name, client, billable, archived or template state. Use it to find a project ID. Returns one page.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ name: Property.ShortText({+ displayName: 'Name',+ description: 'Optional: only projects whose name contains this text.',+ required: false,+ }),+ exactMatch: Property.Checkbox({+ displayName: 'Exact Name Match',+ description: 'Match Name exactly instead of contains. Default false.',+ required: false,+ }),+ clientId: clockifyAiProps.clientId({+ required: false,+ description: 'Optional: only projects of this client. Use List Clients to find it.',+ }),+ archived: Property.StaticDropdown({+ displayName: 'Archived',+ description: 'Optional: only archived (Yes) or only active (No) projects. Empty = both.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ }),+ billable: Property.StaticDropdown({+ displayName: 'Billable',+ description: 'Optional: only billable (Yes) or non-billable (No) projects. Empty = both.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ }),+ isTemplate: Property.StaticDropdown({+ displayName: 'Template',+ description: 'Optional: only template (Yes) or regular (No) projects. Empty = both.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ }),+ page: clockifyAiProps.page({ required: false }),+ pageSize: clockifyAiProps.pageSize({ required: false }),+ },+ async run({ auth, propsValue }) {+ const projects = await clockifyApi.listProjects({+ auth,+ workspaceId: propsValue.workspaceId,+ query: clockifyUtils.toQuery({+ params: {+ name: propsValue.name,+ 'strict-name-search': propsValue.exactMatch,+ clients: propsValue.clientId,+ archived: propsValue.archived,+ billable: propsValue.billable,+ 'is-template': propsValue.isTemplate,+ page: propsValue.page ?? 1,+ 'page-size': propsValue.pageSize ?? 50,+ },+ }),+ });+ return { projects, count: projects.length };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/list-running-time-entries.ts b/packages/pieces/community/clockify/src/lib/actions/ai/list-running-time-entries.tsnew file mode 100644index 00000000000..a8577d41fc5--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/list-running-time-entries.ts@@ -0,0 +1,40 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { timeEntriesOutputSchema } from '../../output-schemas';++export const listRunningTimeEntriesAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_list_running_time_entries',+ outputSchema: timeEntriesOutputSchema,+ displayName: 'List Running Time Entries',+ description: 'Lists every running timer in a workspace.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists every running timer in a workspace, for all members. Needs workspace admin; for only your own running timer use List Time Entries with Running Only. Returns one page.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ page: clockifyAiProps.page({ required: false }),+ pageSize: clockifyAiProps.pageSize({ required: false }),+ },+ async run({ auth, propsValue }) {+ const timeEntries = await clockifyApi.listInProgressTimeEntries({+ auth,+ workspaceId: propsValue.workspaceId,+ query: clockifyUtils.toQuery({+ params: {+ page: propsValue.page ?? 1,+ 'page-size': propsValue.pageSize ?? 50,+ },+ }),+ });+ return { timeEntries, count: timeEntries.length };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/list-shared-reports.ts b/packages/pieces/community/clockify/src/lib/actions/ai/list-shared-reports.tsnew file mode 100644index 00000000000..f050ec77a64--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/list-shared-reports.ts@@ -0,0 +1,54 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { sharedReportsOutputSchema } from '../../output-schemas';++export const listSharedReportsAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_list_shared_reports',+ outputSchema: sharedReportsOutputSchema,+ displayName: 'List Shared Reports',+ description: 'Lists the shared reports of a workspace.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists shared (saved) reports of a workspace with their IDs, names, types and visibility. Use it to find a shared report ID for Get Shared Report. Returns one page with the total count.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ filter: Property.StaticDropdown({+ displayName: 'Which Reports',+ description: 'Default All.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'All', value: 'ALL' },+ { label: 'All (as admin)', value: 'ALL_ADMIN' },+ { label: 'Created by me', value: 'CREATED_BY_ME' },+ { label: 'Shared with me', value: 'SHARED_WITH_ME' },+ ],+ },+ }),+ page: clockifyAiProps.page({ required: false }),+ pageSize: clockifyAiProps.pageSize({ required: false }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.listSharedReports({+ auth,+ workspaceId: propsValue.workspaceId,+ query: clockifyUtils.toQuery({+ params: {+ sharedReportsFilter: propsValue.filter,+ page: propsValue.page ?? 1,+ pageSize: propsValue.pageSize ?? 50,+ },+ }),+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/list-tags.ts b/packages/pieces/community/clockify/src/lib/actions/ai/list-tags.tsnew file mode 100644index 00000000000..a6c5afdcf85--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/list-tags.ts@@ -0,0 +1,65 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { tagsOutputSchema } from '../../output-schemas';++export const listTagsAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_list_tags',+ outputSchema: tagsOutputSchema,+ displayName: 'List Tags',+ description: 'Lists or searches the tags of a workspace.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists the tags of a Clockify workspace, optionally filtered by name (exact or contains) or archived state. Use it to find tag IDs for time entries. Returns one page.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ name: Property.ShortText({+ displayName: 'Name',+ description: 'Optional: only tags whose name contains this text.',+ required: false,+ }),+ exactMatch: Property.Checkbox({+ displayName: 'Exact Name Match',+ description: 'Match Name exactly instead of contains. Default false.',+ required: false,+ }),+ archived: Property.StaticDropdown({+ displayName: 'Archived',+ description: 'Optional: only archived (Yes) or only active (No) tags. Empty = both.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ }),+ page: clockifyAiProps.page({ required: false }),+ pageSize: clockifyAiProps.pageSize({ required: false }),+ },+ async run({ auth, propsValue }) {+ const tags = await clockifyApi.listTags({+ auth,+ workspaceId: propsValue.workspaceId,+ query: clockifyUtils.toQuery({+ params: {+ name: propsValue.name,+ 'strict-name-search': propsValue.exactMatch,+ archived: propsValue.archived,+ page: propsValue.page ?? 1,+ 'page-size': propsValue.pageSize ?? 50,+ },+ }),+ });+ return { tags, count: tags.length };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/list-tasks.ts b/packages/pieces/community/clockify/src/lib/actions/ai/list-tasks.tsnew file mode 100644index 00000000000..456449f0be0--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/list-tasks.ts@@ -0,0 +1,67 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { tasksOutputSchema } from '../../output-schemas';++export const listTasksAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_list_tasks',+ outputSchema: tasksOutputSchema,+ displayName: 'List Tasks',+ description: 'Lists or searches the tasks of a project.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists the tasks of one Clockify project, optionally filtered by name (exact or contains) or active state. Use it to find a task ID for time entries. Returns one page.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ projectId: clockifyAiProps.projectId({ required: true }),+ name: Property.ShortText({+ displayName: 'Name',+ description: 'Optional: only tasks whose name contains this text.',+ required: false,+ }),+ exactMatch: Property.Checkbox({+ displayName: 'Exact Name Match',+ description: 'Match Name exactly instead of contains. Default false.',+ required: false,+ }),+ isActive: Property.StaticDropdown({+ displayName: 'Active',+ description: 'Optional: only active (Yes) or only done (No) tasks. Empty = both.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ }),+ page: clockifyAiProps.page({ required: false }),+ pageSize: clockifyAiProps.pageSize({ required: false }),+ },+ async run({ auth, propsValue }) {+ const tasks = await clockifyApi.listTasks({+ auth,+ workspaceId: propsValue.workspaceId,+ projectId: propsValue.projectId,+ query: clockifyUtils.toQuery({+ params: {+ name: propsValue.name,+ 'strict-name-search': propsValue.exactMatch,+ 'is-active': propsValue.isActive,+ page: propsValue.page ?? 1,+ 'page-size': propsValue.pageSize ?? 50,+ },+ }),+ });+ return { tasks, count: tasks.length };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/list-templates.ts b/packages/pieces/community/clockify/src/lib/actions/ai/list-templates.tsnew file mode 100644index 00000000000..f14e24855a2--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/list-templates.ts@@ -0,0 +1,52 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { templatesOutputSchema } from '../../output-schemas';++export const listTemplatesAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_list_templates',+ outputSchema: templatesOutputSchema,+ displayName: 'List Templates',+ description: 'Lists the timesheet templates of a workspace.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists the timesheet templates (saved sets of project/task rows) in a workspace, optionally filtered by name. Use it to find a template ID. Returns one page.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ name: Property.ShortText({+ displayName: 'Name',+ description: 'Optional: only templates whose name contains this text.',+ required: false,+ }),+ hydrated: Property.Checkbox({+ displayName: 'Include Details',+ description: 'Return the template projects, tasks and entries. Default false.',+ required: false,+ }),+ page: clockifyAiProps.page({ required: false }),+ pageSize: clockifyAiProps.pageSize({ required: false }),+ },+ async run({ auth, propsValue }) {+ const templates = await clockifyApi.listTemplates({+ auth,+ workspaceId: propsValue.workspaceId,+ query: clockifyUtils.toQuery({+ params: {+ name: propsValue.name,+ hydrated: propsValue.hydrated,+ page: propsValue.page ?? 1,+ 'page-size': propsValue.pageSize ?? 50,+ },+ }),+ });+ return { templates, count: templates.length };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/list-time-entries.ts b/packages/pieces/community/clockify/src/lib/actions/ai/list-time-entries.tsnew file mode 100644index 00000000000..d513768b3cd--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/list-time-entries.ts@@ -0,0 +1,91 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { hydratedTimeEntriesOutputSchema } from '../../output-schemas';++export const listTimeEntriesAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_list_time_entries',+ outputSchema: hydratedTimeEntriesOutputSchema,+ displayName: 'List Time Entries',+ description: "Lists or searches a user's time entries.",+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ "Lists one user's time entries in a workspace, newest first, optionally filtered by date range, description, project, task, tags or running state. Defaults to the connected user. Returns one page.",+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ userId: clockifyAiProps.userId({+ required: false,+ description: 'User ID. Empty = the connected user. Another user needs workspace admin.',+ }),+ start: Property.DateTime({+ displayName: 'From',+ description: 'Optional: only entries starting at or after this ISO 8601 datetime.',+ required: false,+ }),+ end: Property.DateTime({+ displayName: 'To',+ description: 'Optional: only entries starting before this ISO 8601 datetime.',+ required: false,+ }),+ description: Property.ShortText({+ displayName: 'Description',+ description: 'Optional: only entries whose description contains this text.',+ required: false,+ }),+ projectId: clockifyAiProps.projectId({+ required: false,+ description: 'Optional: only entries on this project.',+ }),+ taskId: clockifyAiProps.taskId({+ required: false,+ description: 'Optional: only entries on this task.',+ }),+ tagIds: clockifyAiProps.tagIds({+ required: false,+ description: 'Optional: only entries with these tags.',+ }),+ inProgress: Property.Checkbox({+ displayName: 'Running Only',+ description: 'Only the running entry. Default false.',+ required: false,+ }),+ hydrated: Property.Checkbox({+ displayName: 'Include Details',+ description: 'Return project, task and tag objects instead of only their IDs. Default false.',+ required: false,+ }),+ page: clockifyAiProps.page({ required: false }),+ pageSize: clockifyAiProps.pageSize({ required: false }),+ },+ async run({ auth, propsValue }) {+ const userId = propsValue.userId ?? (await clockifyApi.getCurrentUser({ auth })).id;+ const timeEntries = await clockifyApi.listUserTimeEntries({+ auth,+ workspaceId: propsValue.workspaceId,+ userId,+ query: clockifyUtils.toQuery({+ params: {+ start: propsValue.start,+ end: propsValue.end,+ description: propsValue.description,+ project: propsValue.projectId,+ task: propsValue.taskId,+ tags: propsValue.tagIds?.map(String).join(','),+ 'in-progress': propsValue.inProgress ? true : undefined,+ hydrated: propsValue.hydrated,+ page: propsValue.page ?? 1,+ 'page-size': propsValue.pageSize ?? 50,+ },+ }),+ });+ return { timeEntries, count: timeEntries.length };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/list-user-groups.ts b/packages/pieces/community/clockify/src/lib/actions/ai/list-user-groups.tsnew file mode 100644index 00000000000..5f21bc89881--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/list-user-groups.ts@@ -0,0 +1,58 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { userGroupsOutputSchema } from '../../output-schemas';++export const listUserGroupsAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_list_user_groups',+ outputSchema: userGroupsOutputSchema,+ displayName: 'List User Groups',+ description: 'Lists or searches the user groups of a workspace.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists the user groups (teams) of a Clockify workspace with their member IDs, optionally filtered by name or by project. Use it to find a user group ID. Returns one page.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ name: Property.ShortText({+ displayName: 'Name',+ description: 'Optional: only groups whose name contains this text.',+ required: false,+ }),+ projectId: clockifyAiProps.projectId({+ required: false,+ description:+ 'Optional: only groups that are members of this project. Use List Projects to find it.',+ }),+ includeTeamManagers: Property.Checkbox({+ displayName: 'Include Team Managers',+ description: 'Also return each group team managers. Default false.',+ required: false,+ }),+ page: clockifyAiProps.page({ required: false }),+ pageSize: clockifyAiProps.pageSize({ required: false }),+ },+ async run({ auth, propsValue }) {+ const userGroups = await clockifyApi.listUserGroups({+ auth,+ workspaceId: propsValue.workspaceId,+ query: clockifyUtils.toQuery({+ params: {+ name: propsValue.name,+ 'project-id': propsValue.projectId,+ includeTeamManagers: propsValue.includeTeamManagers,+ page: propsValue.page ?? 1,+ 'page-size': propsValue.pageSize ?? 50,+ },+ }),+ });+ return { userGroups, count: userGroups.length };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/list-user-managers.ts b/packages/pieces/community/clockify/src/lib/actions/ai/list-user-managers.tsnew file mode 100644index 00000000000..3a58860ae24--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/list-user-managers.ts@@ -0,0 +1,36 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { managersOutputSchema } from '../../output-schemas';++export const listUserManagersAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_list_user_managers',+ outputSchema: managersOutputSchema,+ displayName: 'List User Managers',+ description: "Lists a user's team managers.",+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists the team managers of one workspace member, for example to find who approves their timesheets. Returns one page of users.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ userId: clockifyAiProps.userId({ required: true }),+ page: clockifyAiProps.page({ required: false }),+ pageSize: clockifyAiProps.pageSize({ required: false }),+ },+ async run({ auth, propsValue }) {+ const managers = await clockifyApi.listUserManagers({+ auth,+ workspaceId: propsValue.workspaceId,+ userId: propsValue.userId,+ query: { page: String(propsValue.page ?? 1), 'page-size': String(propsValue.pageSize ?? 50) },+ });+ return { managers, count: managers.length };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/list-users.ts b/packages/pieces/community/clockify/src/lib/actions/ai/list-users.tsnew file mode 100644index 00000000000..67a42a24df5--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/list-users.ts@@ -0,0 +1,96 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { usersOutputSchema } from '../../output-schemas';++const STATUS_OPTIONS = [+ { label: 'Active', value: 'ACTIVE' },+ { label: 'Pending', value: 'PENDING' },+ { label: 'Declined', value: 'DECLINED' },+ { label: 'Inactive', value: 'INACTIVE' },+ { label: 'All', value: 'ALL' },+];++const ROLE_OPTIONS = [+ { label: 'Owner', value: 'OWNER' },+ { label: 'Workspace Admin', value: 'WORKSPACE_ADMIN' },+ { label: 'Team Manager', value: 'TEAM_MANAGER' },+ { label: 'Project Manager', value: 'PROJECT_MANAGER' },+];++export const listUsersAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_list_users',+ outputSchema: usersOutputSchema,+ displayName: 'List Users',+ description: 'Lists or searches the members of a workspace.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists the members of a Clockify workspace, optionally filtered by email, name, status, project, user groups or roles. Use it to find a user ID by email or name. Returns one page; ask for the next page while count equals the page size.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ email: Property.ShortText({+ displayName: 'Email',+ description: 'Optional: only users whose email contains this text.',+ required: false,+ }),+ name: Property.ShortText({+ displayName: 'Name',+ description: 'Optional: only users whose name contains this text.',+ required: false,+ }),+ status: Property.StaticDropdown({+ displayName: 'Status',+ description: 'Optional: only users with this status.',+ required: false,+ options: { disabled: false, options: STATUS_OPTIONS },+ }),+ projectId: clockifyAiProps.projectId({+ required: false,+ description: 'Optional: only members of this project. Use List Projects to find it.',+ }),+ userGroupIds: Property.Array({+ displayName: 'User Group IDs',+ description:+ 'Optional: only members of these user groups. Use List User Groups to find them.',+ required: false,+ }),+ roles: Property.StaticMultiSelectDropdown({+ displayName: 'Roles',+ description: 'Optional: only users with one of these roles.',+ required: false,+ options: { disabled: false, options: ROLE_OPTIONS },+ }),+ includeRoles: Property.Checkbox({+ displayName: 'Include Roles',+ description: 'Also return each user role. Default false.',+ required: false,+ }),+ page: clockifyAiProps.page({ required: false }),+ pageSize: clockifyAiProps.pageSize({ required: false }),+ },+ async run({ auth, propsValue }) {+ const users = await clockifyApi.filterUsers({+ auth,+ workspaceId: propsValue.workspaceId,+ filter: {+ email: propsValue.email,+ name: propsValue.name,+ status: propsValue.status,+ projectId: propsValue.projectId,+ userGroups: propsValue.userGroupIds?.map(String),+ roles: propsValue.roles,+ includeRoles: propsValue.includeRoles,+ page: propsValue.page ?? 1,+ pageSize: propsValue.pageSize ?? 50,+ },+ });+ return { users, count: users.length };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/list-workspaces.ts b/packages/pieces/community/clockify/src/lib/actions/ai/list-workspaces.tsnew file mode 100644index 00000000000..805edd04a37--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/list-workspaces.ts@@ -0,0 +1,42 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyApi } from '../../common/api';+import { workspacesOutputSchema } from '../../output-schemas';++const ROLE_OPTIONS = [+ { label: 'Owner', value: 'OWNER' },+ { label: 'Workspace Admin', value: 'WORKSPACE_ADMIN' },+ { label: 'Team Manager', value: 'TEAM_MANAGER' },+ { label: 'Project Manager', value: 'PROJECT_MANAGER' },+];++export const listWorkspacesAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_list_workspaces',+ outputSchema: workspacesOutputSchema,+ displayName: 'List Workspaces',+ description: 'Lists the workspaces you belong to.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description:+ 'Lists every Clockify workspace the connected user belongs to, with id, name, rates and settings. Call this first to get the workspace ID that every other Clockify action needs. Optionally keep only workspaces where the user has a given role.',+ idempotent: true,+ },+ props: {+ role: Property.StaticDropdown({+ displayName: 'Role',+ description: 'Optional: only workspaces where the connected user has this role.',+ required: false,+ options: { disabled: false, options: ROLE_OPTIONS },+ }),+ },+ async run({ auth, propsValue }) {+ const workspaces = await clockifyApi.listWorkspaces({+ auth,+ query: propsValue.role ? { roles: propsValue.role } : {},+ });+ return { workspaces, count: workspaces.length };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/mark-time-entries-invoiced.ts b/packages/pieces/community/clockify/src/lib/actions/ai/mark-time-entries-invoiced.tsnew file mode 100644index 00000000000..ea4ba6c5725--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/mark-time-entries-invoiced.ts@@ -0,0 +1,43 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { invoicedOutputSchema } from '../../output-schemas';++export const markTimeEntriesInvoicedAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_mark_time_entries_invoiced',+ outputSchema: invoicedOutputSchema,+ displayName: 'Mark Time Entries Invoiced',+ description: 'Marks time entries as invoiced or not invoiced.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Marks time entries as invoiced (or back to not invoiced when Invoiced is false), for example after billing them outside Clockify. Needs workspace admin and a Clockify plan with invoicing (Standard or higher).',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ timeEntryIds: clockifyAiProps.timeEntryIds({ required: true }),+ invoiced: Property.Checkbox({+ displayName: 'Invoiced',+ description: 'true = invoiced, false = not invoiced.',+ required: true,+ }),+ },+ async run({ auth, propsValue }) {+ await clockifyApi.markTimeEntriesInvoiced({+ auth,+ workspaceId: propsValue.workspaceId,+ timeEntryIds: propsValue.timeEntryIds.map(String),+ invoiced: propsValue.invoiced,+ });+ return {+ success: true,+ invoiced: propsValue.invoiced,+ timeEntryIds: propsValue.timeEntryIds.map(String),+ };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/remove-user-from-group.ts b/packages/pieces/community/clockify/src/lib/actions/ai/remove-user-from-group.tsnew file mode 100644index 00000000000..dc0c57c75ff--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/remove-user-from-group.ts@@ -0,0 +1,34 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { userGroupOutputSchema } from '../../output-schemas';++export const removeUserFromGroupAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_remove_user_from_group',+ outputSchema: userGroupOutputSchema,+ displayName: 'Remove User from Group',+ description: 'Removes a member from a user group.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Removes one member from a user group (they stay in the workspace) and returns the group. Needs workspace admin.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ userGroupId: clockifyAiProps.userGroupId({ required: true }),+ userId: clockifyAiProps.userId({ required: true }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.removeUserFromGroup({+ auth,+ workspaceId: propsValue.workspaceId,+ userGroupId: propsValue.userGroupId,+ userId: propsValue.userId,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/remove-user-role.ts b/packages/pieces/community/clockify/src/lib/actions/ai/remove-user-role.tsnew file mode 100644index 00000000000..1a0568b25c2--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/remove-user-role.ts@@ -0,0 +1,65 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { removedUserRoleOutputSchema } from '../../output-schemas';++export const removeUserRoleAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_remove_user_role',+ outputSchema: removedUserRoleOutputSchema,+ displayName: 'Remove User Role',+ description: 'Removes an admin or manager role from a user.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Removes a Workspace Admin, Team Manager or Project Manager role from a workspace member, for the same Entity ID it was given on. Removing Workspace Admin takes away their control of the workspace. Needs workspace admin.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ userId: clockifyAiProps.userId({ required: true }),+ role: Property.StaticDropdown({+ displayName: 'Role',+ required: true,+ options: {+ disabled: false,+ options: [+ { label: 'Workspace Admin', value: 'WORKSPACE_ADMIN' },+ { label: 'Team Manager', value: 'TEAM_MANAGER' },+ { label: 'Project Manager', value: 'PROJECT_MANAGER' },+ ],+ },+ }),+ entityId: Property.ShortText({+ displayName: 'Entity ID',+ description:+ 'What the role applies to. Workspace Admin: the workspace ID. Team Manager: the ID of the user (or user group) to manage. Project Manager: the project ID.',+ required: true,+ }),+ entityIsUserGroup: Property.Checkbox({+ displayName: 'Entity Is a User Group',+ description:+ 'Team Manager only: set when Entity ID is a user group ID rather than a user ID. Default false.',+ required: false,+ }),+ },+ async run({ auth, propsValue }) {+ await clockifyApi.removeUserRole({+ auth,+ workspaceId: propsValue.workspaceId,+ userId: propsValue.userId,+ role: propsValue.role,+ entityId: propsValue.entityId,+ sourceType: propsValue.entityIsUserGroup ? 'USER_GROUP' : undefined,+ });+ return {+ removed: true,+ userId: propsValue.userId,+ role: propsValue.role,+ entityId: propsValue.entityId,+ };+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/start-timer.ts b/packages/pieces/community/clockify/src/lib/actions/ai/start-timer.tsnew file mode 100644index 00000000000..4108344e691--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/start-timer.ts@@ -0,0 +1,51 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { timeEntryOutputSchema } from '../../output-schemas';++export const startTimerAiAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_start_timer',+ outputSchema: timeEntryOutputSchema,+ displayName: 'Start Timer',+ description: 'Starts a running timer for yourself.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Starts a running timer for the connected user from now, optionally on a project, task and tags. Clockify allows one running timer per user, so any timer already running is stopped first. End it with Stop Timer. Not idempotent.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ description: clockifyAiProps.entryDescription({ required: false }),+ projectId: clockifyAiProps.projectId({+ required: false,+ description: 'Optional project ID. Use List Projects to find it.',+ }),+ taskId: clockifyAiProps.taskId({+ required: false,+ description: 'Optional task ID in that project. Use List Tasks to find it.',+ }),+ tagIds: clockifyAiProps.tagIds({ required: false }),+ billable: Property.Checkbox({+ displayName: 'Billable',+ description: 'Default false.',+ required: false,+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.createTimeEntry({+ auth,+ workspaceId: propsValue.workspaceId,+ start: new Date().toISOString(),+ description: propsValue.description,+ projectId: propsValue.projectId,+ taskId: propsValue.taskId,+ tagIds: propsValue.tagIds?.map(String) ?? [],+ billable: propsValue.billable,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/stop-timer.ts b/packages/pieces/community/clockify/src/lib/actions/ai/stop-timer.tsnew file mode 100644index 00000000000..8d3d2db6b5e--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/stop-timer.ts@@ -0,0 +1,42 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { timeEntryOutputSchema } from '../../output-schemas';++export const stopTimerAiAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_stop_timer',+ outputSchema: timeEntryOutputSchema,+ displayName: 'Stop Timer',+ description: "Stops a user's running timer.",+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Stops the running timer of a user (default: the connected user) at End, or now. Fails if no timer is running. Stopping another user needs workspace admin. Returns the stopped entry.',+ idempotent: false,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ userId: clockifyAiProps.userId({+ required: false,+ description: 'User ID. Empty = the connected user. Another user needs workspace admin.',+ }),+ end: Property.DateTime({+ displayName: 'End',+ description: 'ISO 8601 stop time. Empty = now.',+ required: false,+ }),+ },+ async run({ auth, propsValue }) {+ const userId = propsValue.userId ?? (await clockifyApi.getCurrentUser({ auth })).id;+ return await clockifyApi.stopUserTimer({+ auth,+ workspaceId: propsValue.workspaceId,+ userId,+ end: propsValue.end ?? new Date().toISOString(),+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-client.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-client.tsnew file mode 100644index 00000000000..57318ba0a2f--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-client.ts@@ -0,0 +1,80 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { changedClientOutputSchema } from '../../output-schemas';++export const updateClientAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_client',+ outputSchema: changedClientOutputSchema,+ displayName: 'Update Client',+ description: 'Updates or archives a client.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Updates a client name, email, address or note, or archives / unarchives it. Only the fields you set change: the action reads the client and sends the rest back unchanged. Archiving is required before Delete Client. Not safe against a concurrent edit of the same client.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ clientId: clockifyAiProps.clientId({ required: true }),+ name: Property.ShortText({ displayName: 'Name', required: false }),+ email: Property.ShortText({ displayName: 'Email', required: false }),+ address: Property.LongText({ displayName: 'Address', required: false }),+ note: Property.LongText({ displayName: 'Note', required: false }),+ archived: Property.StaticDropdown({+ displayName: 'Archived',+ description: 'Archive (Yes) or unarchive (No) the client. Empty = unchanged.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ }),+ archiveProjects: Property.Checkbox({+ displayName: 'Archive Projects Too',+ description: 'When archiving, also archive the client projects. Default false.',+ required: false,+ }),+ markTasksAsDone: Property.Checkbox({+ displayName: 'Mark Tasks as Done',+ description: 'When archiving with its projects, also mark their tasks done. Default false.',+ required: false,+ }),+ },+ async run({ auth, propsValue }) {+ const current = await clockifyApi.getClient({+ auth,+ workspaceId: propsValue.workspaceId,+ clientId: propsValue.clientId,+ });+ return await clockifyApi.updateClient({+ auth,+ workspaceId: propsValue.workspaceId,+ clientId: propsValue.clientId,+ client: {+ name: propsValue.name ?? current.name,+ email: propsValue.email ?? current.email,+ address: propsValue.address ?? current.address,+ note: propsValue.note ?? current.note,+ archived:+ clockifyUtils.toOptionalBoolean({ value: propsValue.archived }) ?? current.archived,+ currencyId: current.currencyId,+ ccEmails: current.ccEmails,+ },+ query: clockifyUtils.toQuery({+ params: {+ 'archive-projects': propsValue.archiveProjects,+ 'mark-tasks-as-done': propsValue.markTasksAsDone,+ },+ }),+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-holiday.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-holiday.tsnew file mode 100644index 00000000000..f9180dca6e6--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-holiday.ts@@ -0,0 +1,116 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { holidayOutputSchema } from '../../output-schemas';++export const updateHolidayAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_holiday',+ outputSchema: holidayOutputSchema,+ displayName: 'Update Holiday',+ description: 'Changes a holiday.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Changes a holiday name, dates, who it applies to or whether it repeats yearly. Only the fields you set change: the action reads the holiday and sends the rest back. User and group lists you set replace the current ones. Needs workspace admin and a Clockify plan with time off (Standard or higher).',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ holidayId: clockifyAiProps.holidayId({ required: true }),+ name: Property.ShortText({ displayName: 'Name', required: false }),+ startDate: Property.ShortText({+ displayName: 'Start Date',+ description: 'First day, YYYY-MM-DD.',+ required: false,+ }),+ endDate: Property.ShortText({+ displayName: 'End Date',+ description: 'Last day, YYYY-MM-DD. Same as Start Date for one day.',+ required: false,+ }),+ userIds: clockifyAiProps.idList({+ required: false,+ displayName: 'User IDs',+ description: 'Replaces the users it applies to. Use List Users. Empty = unchanged.',+ }),+ userGroupIds: clockifyAiProps.idList({+ required: false,+ displayName: 'User Group IDs',+ description:+ 'Replaces the user groups it applies to. Use List User Groups. Empty = unchanged.',+ }),+ everyone: Property.StaticDropdown({+ displayName: 'Everyone',+ description: 'Applies to all members (Yes) or only the listed ones (No). Empty = unchanged.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ }),+ occursAnnually: Property.StaticDropdown({+ displayName: 'Repeats Yearly',+ description: 'Empty = unchanged.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ }),+ },+ async run({ auth, propsValue }) {+ const holidays = await clockifyApi.listHolidays({+ auth,+ workspaceId: propsValue.workspaceId,+ query: {},+ });+ const current = holidays.find((holiday) => holiday.id === propsValue.holidayId);+ if (!current) {+ throw new Error(+ `Holiday ${propsValue.holidayId} not found in this workspace. Use List Holidays to find it.`,+ );+ }+ return await clockifyApi.updateHoliday({+ auth,+ workspaceId: propsValue.workspaceId,+ holidayId: propsValue.holidayId,+ holiday: {+ name: propsValue.name ?? current.name,+ datePeriod: {+ startDate: propsValue.startDate ?? current.datePeriod.startDate,+ endDate: propsValue.endDate ?? current.datePeriod.endDate,+ },+ occursAnnually:+ clockifyUtils.toOptionalBoolean({ value: propsValue.occursAnnually }) ??+ current.occursAnnually ??+ false,+ everyoneIncludingNew:+ clockifyUtils.toOptionalBoolean({ value: propsValue.everyone }) ??+ current.everyoneIncludingNew ??+ false,+ users: clockifyUtils.entityFilter({+ ids: clockifyUtils.nonEmptyIds({ values: propsValue.userIds }) ?? current.userIds,+ }),+ userGroups: clockifyUtils.entityFilter({+ ids:+ clockifyUtils.nonEmptyIds({ values: propsValue.userGroupIds }) ?? current.userGroupIds,+ }),+ automaticTimeEntryCreation:+ typeof current.automaticTimeEntryCreation === 'object'+ ? current.automaticTimeEntryCreation+ : undefined,+ },+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-member-profile.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-member-profile.tsnew file mode 100644index 00000000000..c2f8c71be04--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-member-profile.ts@@ -0,0 +1,65 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { memberProfileOutputSchema } from '../../output-schemas';++const DAY_OPTIONS = [+ { label: 'Monday', value: 'MONDAY' },+ { label: 'Tuesday', value: 'TUESDAY' },+ { label: 'Wednesday', value: 'WEDNESDAY' },+ { label: 'Thursday', value: 'THURSDAY' },+ { label: 'Friday', value: 'FRIDAY' },+ { label: 'Saturday', value: 'SATURDAY' },+ { label: 'Sunday', value: 'SUNDAY' },+];++export const updateMemberProfileAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_member_profile',+ outputSchema: memberProfileOutputSchema,+ displayName: 'Update Member Profile',+ description: "Updates a workspace member's profile.",+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ "Updates a workspace member's name, week start, daily work capacity or working days. Only the fields you set change. Needs workspace admin (or the member themself). Returns the updated profile.",+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ userId: clockifyAiProps.userId({ required: true }),+ name: Property.ShortText({ displayName: 'Name', required: false }),+ weekStart: Property.StaticDropdown({+ displayName: 'Week Start',+ required: false,+ options: { disabled: false, options: DAY_OPTIONS },+ }),+ workCapacity: Property.ShortText({+ displayName: 'Work Capacity',+ description: 'Daily work capacity as an ISO 8601 duration, for example PT8H.',+ required: false,+ }),+ workingDays: Property.StaticMultiSelectDropdown({+ displayName: 'Working Days',+ description: 'Replaces the member working days.',+ required: false,+ options: { disabled: false, options: DAY_OPTIONS },+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.updateMemberProfile({+ auth,+ workspaceId: propsValue.workspaceId,+ userId: propsValue.userId,+ changes: {+ name: propsValue.name,+ weekStart: propsValue.weekStart,+ workCapacity: propsValue.workCapacity,+ workingDays: propsValue.workingDays,+ },+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-project-estimate.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-project-estimate.tsnew file mode 100644index 00000000000..13807b4ea0f--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-project-estimate.ts@@ -0,0 +1,94 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { projectOutputSchema } from '../../output-schemas';++export const updateProjectEstimateAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_project_estimate',+ outputSchema: projectOutputSchema,+ displayName: 'Update Project Estimate',+ description: 'Sets the time or budget estimate of a project.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Sets a manual time estimate (ISO 8601 duration) and/or budget estimate (in cents) on a project, optionally resetting every week, month or year. Set Disable to turn an estimate off. Returns the updated project.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ projectId: clockifyAiProps.projectId({ required: true }),+ timeEstimate: Property.ShortText({+ displayName: 'Time Estimate',+ description: 'Total time estimate as an ISO 8601 duration, for example PT120H.',+ required: false,+ }),+ budgetEstimate: Property.Number({+ displayName: 'Budget Estimate',+ description: 'Budget estimate in cents, for example 500000 for 5000.00.',+ required: false,+ }),+ resetOption: Property.StaticDropdown({+ displayName: 'Reset',+ description: 'Optional: restart the estimate every period.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Weekly', value: 'WEEKLY' },+ { label: 'Monthly', value: 'MONTHLY' },+ { label: 'Yearly', value: 'YEARLY' },+ ],+ },+ }),+ disableTimeEstimate: Property.Checkbox({+ displayName: 'Disable Time Estimate',+ description: 'Turn the time estimate off. Default false.',+ required: false,+ }),+ disableBudgetEstimate: Property.Checkbox({+ displayName: 'Disable Budget Estimate',+ description: 'Turn the budget estimate off. Default false.',+ required: false,+ }),+ },+ async run({ auth, propsValue }) {+ if (propsValue.disableTimeEstimate && propsValue.timeEstimate !== undefined) {+ throw new Error('Set either Time Estimate or Disable Time Estimate, not both.');+ }+ if (propsValue.disableBudgetEstimate && propsValue.budgetEstimate !== undefined) {+ throw new Error('Set either Budget Estimate or Disable Budget Estimate, not both.');+ }+ return await clockifyApi.updateProjectEstimate({+ auth,+ workspaceId: propsValue.workspaceId,+ projectId: propsValue.projectId,+ estimate: {+ timeEstimate: propsValue.disableTimeEstimate+ ? { active: false, type: 'MANUAL' }+ : propsValue.timeEstimate === undefined+ ? undefined+ : {+ active: true,+ estimate: propsValue.timeEstimate,+ type: 'MANUAL',+ resetOption: propsValue.resetOption,+ includeNonBillable: true,+ },+ budgetEstimate: propsValue.disableBudgetEstimate+ ? { active: false, type: 'MANUAL' }+ : propsValue.budgetEstimate === undefined+ ? undefined+ : {+ active: true,+ estimate: propsValue.budgetEstimate,+ type: 'MANUAL',+ resetOption: propsValue.resetOption,+ },+ },+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-project-memberships.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-project-memberships.tsnew file mode 100644index 00000000000..1682f52521a--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-project-memberships.ts@@ -0,0 +1,38 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { projectOutputSchema } from '../../output-schemas';++export const updateProjectMembershipsAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_project_memberships',+ outputSchema: projectOutputSchema,+ displayName: 'Replace Project Members',+ description: 'Replaces the whole member list of a project.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Replaces the member list of a project with exactly the given users: anyone left out loses access to the project. To add or remove a few users without touching the rest, use Assign Project Users instead.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ projectId: clockifyAiProps.projectId({ required: true }),+ userIds: Property.Array({+ displayName: 'User IDs',+ description: 'The full list of user IDs that should be members. Use List Users to find them.',+ required: true,+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.replaceProjectMemberships({+ auth,+ workspaceId: propsValue.workspaceId,+ projectId: propsValue.projectId,+ userIds: propsValue.userIds.map(String),+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-project-template.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-project-template.tsnew file mode 100644index 00000000000..a7fec1255c3--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-project-template.ts@@ -0,0 +1,38 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { projectOutputSchema } from '../../output-schemas';++export const updateProjectTemplateAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_project_template',+ outputSchema: projectOutputSchema,+ displayName: 'Update Project Template',+ description: 'Marks a project as a template or not.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Marks a project as a template (Is Template = true) so Create Project from Template can copy it, or turns that off. Needs a Clockify plan with project templates (Pro or higher).',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ projectId: clockifyAiProps.projectId({ required: true }),+ isTemplate: Property.Checkbox({+ displayName: 'Is Template',+ description: 'true = make it a template, false = a regular project.',+ required: true,+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.updateProjectTemplate({+ auth,+ workspaceId: propsValue.workspaceId,+ projectId: propsValue.projectId,+ isTemplate: propsValue.isTemplate,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-project-user-billable-rate.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-project-user-billable-rate.tsnew file mode 100644index 00000000000..1565a591a33--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-project-user-billable-rate.ts@@ -0,0 +1,40 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { projectOutputSchema } from '../../output-schemas';++export const updateProjectUserBillableRateAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_project_user_billable_rate',+ outputSchema: projectOutputSchema,+ displayName: 'Update Project User Billable Rate',+ description: 'Sets a member billable rate on one project.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Sets the billable rate, in cents, of one member on one project, overriding their workspace rate there. Needs workspace admin. Returns the updated project.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ projectId: clockifyAiProps.projectId({ required: true }),+ userId: clockifyAiProps.userId({ required: true }),+ amount: clockifyAiProps.rateAmount({ required: true }),+ since: clockifyAiProps.rateSince({ required: false }),+ includeApproved: clockifyAiProps.includeApproved({ required: false }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.updateProjectUserBillableRate({+ auth,+ workspaceId: propsValue.workspaceId,+ projectId: propsValue.projectId,+ userId: propsValue.userId,+ amount: propsValue.amount,+ since: propsValue.since,+ includeApproved: propsValue.includeApproved,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-project-user-cost-rate.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-project-user-cost-rate.tsnew file mode 100644index 00000000000..984979410d8--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-project-user-cost-rate.ts@@ -0,0 +1,40 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { projectOutputSchema } from '../../output-schemas';++export const updateProjectUserCostRateAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_project_user_cost_rate',+ outputSchema: projectOutputSchema,+ displayName: 'Update Project User Cost Rate',+ description: 'Sets a member cost rate on one project.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Sets the cost rate, in cents, of one member on one project, overriding their workspace rate there. Needs workspace admin and a Clockify plan with cost rates (Pro or higher). Returns the updated project.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ projectId: clockifyAiProps.projectId({ required: true }),+ userId: clockifyAiProps.userId({ required: true }),+ amount: clockifyAiProps.rateAmount({ required: true }),+ since: clockifyAiProps.rateSince({ required: false }),+ includeApproved: clockifyAiProps.includeApproved({ required: false }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.updateProjectUserCostRate({+ auth,+ workspaceId: propsValue.workspaceId,+ projectId: propsValue.projectId,+ userId: propsValue.userId,+ amount: propsValue.amount,+ since: propsValue.since,+ includeApproved: propsValue.includeApproved,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-project.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-project.tsnew file mode 100644index 00000000000..14a16d5a276--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-project.ts@@ -0,0 +1,96 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { projectOutputSchema } from '../../output-schemas';++export const updateProjectAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_project',+ outputSchema: projectOutputSchema,+ displayName: 'Update Project',+ description: 'Updates or archives a project.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Updates a project name, client, color, note, billable or public flag, or archives / unarchives it. Only the fields you set change: the action reads the project and sends the rest back unchanged. Archiving is required before Delete Project.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ projectId: clockifyAiProps.projectId({ required: true }),+ name: Property.ShortText({ displayName: 'Name', required: false }),+ clientId: clockifyAiProps.clientId({+ required: false,+ description: 'Optional client ID. Use List Clients to find it.',+ }),+ color: Property.ShortText({+ displayName: 'Color',+ description: 'Hex color, for example #03A9F4.',+ required: false,+ }),+ note: Property.LongText({ displayName: 'Note', required: false }),+ billable: Property.StaticDropdown({+ displayName: 'Billable',+ description: 'Make the project billable (Yes) or not (No). Empty = unchanged.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ }),+ isPublic: Property.StaticDropdown({+ displayName: 'Public',+ description: 'Make the project public (Yes) or members-only (No). Empty = unchanged.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ }),+ archived: Property.StaticDropdown({+ displayName: 'Archived',+ description: 'Archive (Yes) or unarchive (No). Empty = unchanged.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ }),+ },+ async run({ auth, propsValue }) {+ const current = await clockifyApi.getProject({+ auth,+ workspaceId: propsValue.workspaceId,+ projectId: propsValue.projectId,+ });+ return await clockifyApi.updateProject({+ auth,+ workspaceId: propsValue.workspaceId,+ projectId: propsValue.projectId,+ project: {+ name: propsValue.name ?? current.name,+ clientId: propsValue.clientId ?? current.clientId,+ color: propsValue.color ?? current.color,+ note: propsValue.note ?? current.note,+ billable:+ clockifyUtils.toOptionalBoolean({ value: propsValue.billable }) ?? current.billable,+ isPublic: clockifyUtils.toOptionalBoolean({ value: propsValue.isPublic }) ?? current.public,+ archived:+ clockifyUtils.toOptionalBoolean({ value: propsValue.archived }) ?? current.archived,+ },+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-shared-report.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-shared-report.tsnew file mode 100644index 00000000000..2577b0fe331--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-shared-report.ts@@ -0,0 +1,117 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { sharedReportOutputSchema } from '../../output-schemas';++import type { ClockifyAuthValue, ClockifySharedReportListItem } from '../../common/types';++const YES_NO = [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+];++export const updateSharedReportAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_shared_report',+ outputSchema: sharedReportOutputSchema,+ displayName: 'Update Shared Report',+ description: 'Renames a shared report or changes who can see it.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Changes a shared report name, public flag, fixed period or the users and groups it is visible to. Only the fields you set change: the action reads the report and sends the rest back. Its filters and type cannot be changed.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ sharedReportId: clockifyAiProps.sharedReportId({ required: true }),+ name: Property.ShortText({ displayName: 'Name', required: false }),+ isPublic: Property.StaticDropdown({+ displayName: 'Public',+ description: 'Anyone with the link can view it. Empty = unchanged.',+ required: false,+ options: { disabled: false, options: YES_NO },+ }),+ fixedDate: Property.StaticDropdown({+ displayName: 'Fixed Period',+ description: 'Viewers cannot change the period. Empty = unchanged.',+ required: false,+ options: { disabled: false, options: YES_NO },+ }),+ visibleToUsers: clockifyAiProps.idList({+ required: false,+ displayName: 'Visible to Users',+ description: 'User IDs that can view it; replaces the list. Empty = unchanged.',+ }),+ visibleToUserGroups: clockifyAiProps.idList({+ required: false,+ displayName: 'Visible to User Groups',+ description: 'User group IDs that can view it; replaces the list. Empty = unchanged.',+ }),+ },+ async run({ auth, propsValue }) {+ const current = await findSharedReport({+ auth,+ workspaceId: propsValue.workspaceId,+ sharedReportId: propsValue.sharedReportId,+ page: 1,+ });+ if (!current) {+ throw new Error(+ `Shared report ${propsValue.sharedReportId} not found in this workspace. Use List Shared Reports to find it.`,+ );+ }+ return await clockifyApi.updateSharedReport({+ auth,+ workspaceId: propsValue.workspaceId,+ sharedReportId: propsValue.sharedReportId,+ sharedReport: {+ name: propsValue.name ?? current.name,+ isPublic:+ clockifyUtils.toOptionalBoolean({ value: propsValue.isPublic }) ?? current.isPublic,+ fixedDate:+ clockifyUtils.toOptionalBoolean({ value: propsValue.fixedDate }) ?? current.fixedDate,+ visibleToUsers:+ clockifyUtils.nonEmptyIds({ values: propsValue.visibleToUsers }) ??+ current.visibleToUsers?.map((user) => user.id),+ visibleToUserGroups:+ clockifyUtils.nonEmptyIds({ values: propsValue.visibleToUserGroups }) ??+ current.visibleToUserGroups?.map((group) => group.id),+ },+ });+ },+});++async function findSharedReport({+ auth,+ workspaceId,+ sharedReportId,+ page,+}: {+ auth: ClockifyAuthValue;+ workspaceId: string;+ sharedReportId: string;+ page: number;+}): Promise<ClockifySharedReportListItem | undefined> {+ const result = await clockifyApi.listSharedReports({+ auth,+ workspaceId,+ query: {+ sharedReportsFilter: 'ALL',+ page: String(page),+ pageSize: String(SHARED_REPORTS_PAGE_SIZE),+ },+ });+ const reports = result.reports ?? [];+ const match = reports.find((report) => report.id === sharedReportId);+ if (match || reports.length < SHARED_REPORTS_PAGE_SIZE) {+ return match;+ }+ return await findSharedReport({ auth, workspaceId, sharedReportId, page: page + 1 });+}++const SHARED_REPORTS_PAGE_SIZE = 1000;diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-tag.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-tag.tsnew file mode 100644index 00000000000..eb63e43e0db--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-tag.ts@@ -0,0 +1,56 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { tagOutputSchema } from '../../output-schemas';++export const updateTagAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_tag',+ outputSchema: tagOutputSchema,+ displayName: 'Update Tag',+ description: 'Renames, archives or unarchives a tag.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Renames a tag or archives / unarchives it. Only the fields you set change: the action reads the tag and sends the rest back unchanged. Archiving is required before Delete Tag.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ tagId: clockifyAiProps.tagId({ required: true }),+ name: Property.ShortText({ displayName: 'Name', required: false }),+ archived: Property.StaticDropdown({+ displayName: 'Archived',+ description: 'Archive (Yes) or unarchive (No) the tag. Empty = unchanged.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ }),+ },+ async run({ auth, propsValue }) {+ const current = await clockifyApi.getTag({+ auth,+ workspaceId: propsValue.workspaceId,+ tagId: propsValue.tagId,+ });+ return await clockifyApi.updateTag({+ auth,+ workspaceId: propsValue.workspaceId,+ tagId: propsValue.tagId,+ name: propsValue.name ?? current.name,+ archived:+ clockifyUtils.toOptionalBoolean({ value: propsValue.archived }) ??+ current.archived ??+ false,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-task-billable-rate.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-task-billable-rate.tsnew file mode 100644index 00000000000..0280fe2052d--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-task-billable-rate.ts@@ -0,0 +1,40 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { taskOutputSchema } from '../../output-schemas';++export const updateTaskBillableRateAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_task_billable_rate',+ outputSchema: taskOutputSchema,+ displayName: 'Update Task Billable Rate',+ description: 'Sets the billable rate of a task.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Sets the billable rate of one task, in cents, overriding the project and user rates for time on that task. Needs workspace admin. Returns the updated task.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ projectId: clockifyAiProps.projectId({ required: true }),+ taskId: clockifyAiProps.taskId({ required: true }),+ amount: clockifyAiProps.rateAmount({ required: true }),+ since: clockifyAiProps.rateSince({ required: false }),+ includeApproved: clockifyAiProps.includeApproved({ required: false }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.updateTaskBillableRate({+ auth,+ workspaceId: propsValue.workspaceId,+ projectId: propsValue.projectId,+ taskId: propsValue.taskId,+ amount: propsValue.amount,+ since: propsValue.since,+ includeApproved: propsValue.includeApproved,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-task-cost-rate.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-task-cost-rate.tsnew file mode 100644index 00000000000..c348fc79aa5--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-task-cost-rate.ts@@ -0,0 +1,40 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { taskOutputSchema } from '../../output-schemas';++export const updateTaskCostRateAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_task_cost_rate',+ outputSchema: taskOutputSchema,+ displayName: 'Update Task Cost Rate',+ description: 'Sets the cost rate of a task.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Sets the cost rate of one task, in cents, overriding the project and user rates for time on that task. Needs workspace admin and a Clockify plan with cost rates (Pro or higher). Returns the updated task.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ projectId: clockifyAiProps.projectId({ required: true }),+ taskId: clockifyAiProps.taskId({ required: true }),+ amount: clockifyAiProps.rateAmount({ required: true }),+ since: clockifyAiProps.rateSince({ required: false }),+ includeApproved: clockifyAiProps.includeApproved({ required: false }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.updateTaskCostRate({+ auth,+ workspaceId: propsValue.workspaceId,+ projectId: propsValue.projectId,+ taskId: propsValue.taskId,+ amount: propsValue.amount,+ since: propsValue.since,+ includeApproved: propsValue.includeApproved,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-task.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-task.tsnew file mode 100644index 00000000000..fa4d61fa948--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-task.ts@@ -0,0 +1,93 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { taskOutputSchema } from '../../output-schemas';++export const updateTaskAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_task',+ outputSchema: taskOutputSchema,+ displayName: 'Update Task',+ description: 'Updates, completes or reopens a task.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Updates a task name, status (mark Done or reopen as Active), assignees, user groups, estimate or billable flag. Only the fields you set change: the action reads the task and sends the rest back unchanged. Assignee and group lists you set replace the current ones.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ projectId: clockifyAiProps.projectId({ required: true }),+ taskId: clockifyAiProps.taskId({ required: true }),+ name: Property.ShortText({ displayName: 'Name', required: false }),+ status: Property.StaticDropdown({+ displayName: 'Status',+ description: 'Active or Done. Empty = unchanged.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Active', value: 'ACTIVE' },+ { label: 'Done', value: 'DONE' },+ ],+ },+ }),+ assigneeIds: Property.Array({+ displayName: 'Assignee IDs',+ description: 'Replaces the assignees. Use List Users to find them. Empty = unchanged.',+ required: false,+ }),+ userGroupIds: Property.Array({+ displayName: 'User Group IDs',+ description: 'Replaces the assigned user groups. Use List User Groups. Empty = unchanged.',+ required: false,+ }),+ estimate: Property.ShortText({+ displayName: 'Estimate',+ description: 'Time estimate as an ISO 8601 duration, for example PT8H.',+ required: false,+ }),+ billable: Property.StaticDropdown({+ displayName: 'Billable',+ description: 'Billable (Yes) or not (No). Empty = unchanged.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ }),+ },+ async run({ auth, propsValue }) {+ const current = await clockifyApi.getTask({+ auth,+ workspaceId: propsValue.workspaceId,+ projectId: propsValue.projectId,+ taskId: propsValue.taskId,+ });+ return await clockifyApi.updateTask({+ auth,+ workspaceId: propsValue.workspaceId,+ projectId: propsValue.projectId,+ taskId: propsValue.taskId,+ task: {+ name: propsValue.name ?? current.name,+ status: propsValue.status ?? current.status,+ assigneeIds:+ clockifyUtils.nonEmptyIds({ values: propsValue.assigneeIds }) ?? current.assigneeIds,+ userGroupIds:+ clockifyUtils.nonEmptyIds({ values: propsValue.userGroupIds }) ?? current.userGroupIds,+ estimate: propsValue.estimate ?? current.estimate,+ billable:+ clockifyUtils.toOptionalBoolean({ value: propsValue.billable }) ?? current.billable,+ budgetEstimate: current.budgetEstimate,+ },+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-template.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-template.tsnew file mode 100644index 00000000000..539c912b203--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-template.ts@@ -0,0 +1,34 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { templateOutputSchema } from '../../output-schemas';++export const updateTemplateAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_template',+ outputSchema: templateOutputSchema,+ displayName: 'Update Template',+ description: 'Renames a timesheet template.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Renames a timesheet template (the name is the only field Clockify lets you change).',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ templateId: clockifyAiProps.templateId({ required: true }),+ name: Property.ShortText({ displayName: 'Name', required: true }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.renameTemplate({+ auth,+ workspaceId: propsValue.workspaceId,+ templateId: propsValue.templateId,+ name: propsValue.name,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-time-entry.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-time-entry.tsnew file mode 100644index 00000000000..a8284785c0b--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-time-entry.ts@@ -0,0 +1,89 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { clockifyUtils } from '../../common/utils';+import { timeEntryOutputSchema } from '../../output-schemas';++export const updateTimeEntryAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_time_entry',+ outputSchema: timeEntryOutputSchema,+ displayName: 'Update Time Entry',+ description: 'Updates a time entry.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Updates a time entry start, end, description, project, task, tags or billable flag. Only the fields you set change: the action reads the entry and sends the rest back, because Clockify clears any field left out. Locked (approved) entries cannot be changed.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ timeEntryId: clockifyAiProps.timeEntryId({ required: true }),+ start: Property.DateTime({+ displayName: 'Start',+ description: 'New ISO 8601 start. Empty = unchanged.',+ required: false,+ }),+ end: Property.DateTime({+ displayName: 'End',+ description: 'New ISO 8601 end. Empty = unchanged.',+ required: false,+ }),+ description: clockifyAiProps.entryDescription({ required: false }),+ projectId: clockifyAiProps.projectId({+ required: false,+ description: 'New project ID. Empty = unchanged.',+ }),+ taskId: clockifyAiProps.taskId({+ required: false,+ description: 'New task ID. Empty = unchanged.',+ }),+ tagIds: clockifyAiProps.tagIds({+ required: false,+ description: 'Replaces the tags. Empty = unchanged.',+ }),+ billable: Property.StaticDropdown({+ displayName: 'Billable',+ description: 'Billable (Yes) or not (No). Empty = unchanged.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ }),+ },+ async run({ auth, propsValue }) {+ const current = await clockifyApi.getTimeEntry({+ auth,+ workspaceId: propsValue.workspaceId,+ timeEntryId: propsValue.timeEntryId,+ query: {},+ });+ return await clockifyApi.updateTimeEntry({+ auth,+ workspaceId: propsValue.workspaceId,+ timeEntryId: propsValue.timeEntryId,+ entry: {+ start: propsValue.start ?? current.timeInterval?.start ?? '',+ end: propsValue.end ?? current.timeInterval?.end,+ description: propsValue.description ?? current.description,+ projectId: propsValue.projectId ?? current.projectId,+ taskId: propsValue.taskId ?? current.taskId,+ tagIds: clockifyUtils.nonEmptyIds({ values: propsValue.tagIds }) ?? current.tagIds,+ billable:+ clockifyUtils.toOptionalBoolean({ value: propsValue.billable }) ?? current.billable,+ type: current.type,+ customFields: current.customFieldValues?.map((field) => ({+ customFieldId: field.customFieldId,+ value: field.value,+ })),+ },+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-user-billable-rate.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-user-billable-rate.tsnew file mode 100644index 00000000000..33e45a90cae--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-user-billable-rate.ts@@ -0,0 +1,38 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { workspaceOutputSchema } from '../../output-schemas';++export const updateUserBillableRateAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_user_billable_rate',+ outputSchema: workspaceOutputSchema,+ displayName: 'Update User Billable Rate',+ description: "Sets a user's billable rate in a workspace.",+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ "Sets a member's billable (hourly) rate in a workspace, in cents, overriding the workspace default. Needs workspace admin. Returns the updated workspace.",+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ userId: clockifyAiProps.userId({ required: true }),+ amount: clockifyAiProps.rateAmount({ required: true }),+ since: clockifyAiProps.rateSince({ required: false }),+ includeApproved: clockifyAiProps.includeApproved({ required: false }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.updateUserBillableRate({+ auth,+ workspaceId: propsValue.workspaceId,+ userId: propsValue.userId,+ amount: propsValue.amount,+ since: propsValue.since,+ includeApproved: propsValue.includeApproved,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-user-cost-rate.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-user-cost-rate.tsnew file mode 100644index 00000000000..365c0d16670--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-user-cost-rate.ts@@ -0,0 +1,38 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { workspaceOutputSchema } from '../../output-schemas';++export const updateUserCostRateAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_user_cost_rate',+ outputSchema: workspaceOutputSchema,+ displayName: 'Update User Cost Rate',+ description: "Sets a user's cost rate in a workspace.",+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ "Sets a member's cost (labour) rate in a workspace, in cents. Needs workspace admin and a Clockify plan with cost rates (Pro or higher). Returns the updated workspace.",+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ userId: clockifyAiProps.userId({ required: true }),+ amount: clockifyAiProps.rateAmount({ required: true }),+ since: clockifyAiProps.rateSince({ required: false }),+ includeApproved: clockifyAiProps.includeApproved({ required: false }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.updateUserCostRate({+ auth,+ workspaceId: propsValue.workspaceId,+ userId: propsValue.userId,+ amount: propsValue.amount,+ since: propsValue.since,+ includeApproved: propsValue.includeApproved,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-user-custom-field.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-user-custom-field.tsnew file mode 100644index 00000000000..7ae8bd55426--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-user-custom-field.ts@@ -0,0 +1,40 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { userCustomFieldValueOutputSchema } from '../../output-schemas';++export const updateUserCustomFieldAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_user_custom_field',+ outputSchema: userCustomFieldValueOutputSchema,+ displayName: 'Update User Custom Field',+ description: "Sets the value of a user's custom field.",+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Sets the value of a user-level custom field for one workspace member. Needs workspace admin and a Clockify plan with custom fields (Pro or higher). Get the field ID from List Custom Fields.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ userId: clockifyAiProps.userId({ required: true }),+ customFieldId: clockifyAiProps.customFieldId({ required: true }),+ value: Property.ShortText({+ displayName: 'Value',+ description: 'The new value of the field.',+ required: true,+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.updateUserCustomField({+ auth,+ workspaceId: propsValue.workspaceId,+ userId: propsValue.userId,+ customFieldId: propsValue.customFieldId,+ value: propsValue.value,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-user-group.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-user-group.tsnew file mode 100644index 00000000000..bc30ef1248e--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-user-group.ts@@ -0,0 +1,38 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { userGroupOutputSchema } from '../../output-schemas';++export const updateUserGroupAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_user_group',+ outputSchema: userGroupOutputSchema,+ displayName: 'Update User Group',+ description: 'Renames a user group.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Renames a user group (the name is its only editable field; members are changed with Add User to Group and Remove User from Group). Needs workspace admin.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ userGroupId: clockifyAiProps.userGroupId({ required: true }),+ name: Property.ShortText({+ displayName: 'Name',+ description: 'New name of the group.',+ required: true,+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.updateUserGroup({+ auth,+ workspaceId: propsValue.workspaceId,+ userGroupId: propsValue.userGroupId,+ name: propsValue.name,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-user-status.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-user-status.tsnew file mode 100644index 00000000000..3f068ce6b71--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-user-status.ts@@ -0,0 +1,44 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { workspaceOutputSchema } from '../../output-schemas';++export const updateUserStatusAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_user_status',+ outputSchema: workspaceOutputSchema,+ displayName: 'Update User Status',+ description: 'Activates or deactivates a workspace member.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description:+ 'Sets a workspace member to ACTIVE or INACTIVE. Inactive users keep their data but cannot track time in the workspace. Needs workspace admin. Returns the updated workspace.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ userId: clockifyAiProps.userId({ required: true }),+ status: Property.StaticDropdown({+ displayName: 'Status',+ required: true,+ options: {+ disabled: false,+ options: [+ { label: 'Active', value: 'ACTIVE' },+ { label: 'Inactive', value: 'INACTIVE' },+ ],+ },+ }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.updateUserStatus({+ auth,+ workspaceId: propsValue.workspaceId,+ userId: propsValue.userId,+ status: propsValue.status,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-workspace-billable-rate.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-workspace-billable-rate.tsnew file mode 100644index 00000000000..acfa3ad007b--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-workspace-billable-rate.ts@@ -0,0 +1,42 @@+import { createAction, Property } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { workspaceOutputSchema } from '../../output-schemas';++export const updateWorkspaceBillableRateAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_workspace_billable_rate',+ outputSchema: workspaceOutputSchema,+ displayName: 'Update Workspace Billable Rate',+ description: 'Sets the default billable rate of a workspace.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Sets the workspace default billable (hourly) rate, in cents, and its currency. Users, projects and tasks without their own rate inherit it. Needs workspace admin. Returns the updated workspace.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ amount: clockifyAiProps.rateAmount({ required: true }),+ currency: Property.ShortText({+ displayName: 'Currency',+ description: 'Currency code, for example USD.',+ required: true,+ }),+ since: clockifyAiProps.rateSince({ required: false }),+ includeApproved: clockifyAiProps.includeApproved({ required: false }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.updateWorkspaceBillableRate({+ auth,+ workspaceId: propsValue.workspaceId,+ amount: propsValue.amount,+ currency: propsValue.currency,+ since: propsValue.since,+ includeApproved: propsValue.includeApproved,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/ai/update-workspace-cost-rate.ts b/packages/pieces/community/clockify/src/lib/actions/ai/update-workspace-cost-rate.tsnew file mode 100644index 00000000000..76a753937a3--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/actions/ai/update-workspace-cost-rate.ts@@ -0,0 +1,36 @@+import { createAction } from '@activepieces/pieces-framework';++import { clockifyAuth } from '../../auth';+import { clockifyAiProps } from '../../common/ai-props';+import { clockifyApi } from '../../common/api';+import { workspaceOutputSchema } from '../../output-schemas';++export const updateWorkspaceCostRateAction = createAction({+ auth: clockifyAuth,+ name: 'clockify_update_workspace_cost_rate',+ outputSchema: workspaceOutputSchema,+ displayName: 'Update Workspace Cost Rate',+ description: 'Sets the default cost rate of a workspace.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description:+ 'Sets the workspace default cost (labour) rate, in cents. Needs workspace admin and a Clockify plan with cost rates (Pro or higher). Returns the updated workspace.',+ idempotent: true,+ },+ props: {+ workspaceId: clockifyAiProps.workspaceId({ required: true }),+ amount: clockifyAiProps.rateAmount({ required: true }),+ since: clockifyAiProps.rateSince({ required: false }),+ includeApproved: clockifyAiProps.includeApproved({ required: false }),+ },+ async run({ auth, propsValue }) {+ return await clockifyApi.updateWorkspaceCostRate({+ auth,+ workspaceId: propsValue.workspaceId,+ amount: propsValue.amount,+ since: propsValue.since,+ includeApproved: propsValue.includeApproved,+ });+ },+});diff --git a/packages/pieces/community/clockify/src/lib/actions/create-task.ts b/packages/pieces/community/clockify/src/lib/actions/create-task.tsindex f5917a27a76..6d329169736 100644--- a/packages/pieces/community/clockify/src/lib/actions/create-task.ts+++ b/packages/pieces/community/clockify/src/lib/actions/create-task.ts@@ -1,30 +1,25 @@-import { HttpMethod } from '@activepieces/pieces-common';import { createAction, Property } from '@activepieces/pieces-framework';import { clockifyAuth } from '../auth';-import { clockifyApiCall } from '../common/client';-import { assigneeIds, projectId, workspaceId } from '../common/props';+import { clockifyApi } from '../common/api';+import { clockifyProps } from '../common/props';+import { taskOutputSchema } from '../output-schemas';export const createTaskAction = createAction({auth: clockifyAuth,name: 'create-task',+ outputSchema: taskOutputSchema,classification: 'WRITE',displayName: 'Create Task',description: 'Creates a new in a specific project.',- audience: 'both',+ audience: 'human',aiMetadata: {description:'Creates a new task inside a specific Clockify project, optionally setting a status and assignees. Requires the workspace and project to target. Not idempotent: each call creates a separate task even with identical inputs.',idempotent: false,},props: {- workspaceId: workspaceId({- displayName: 'Workspace',- required: true,- }),- projectId: projectId({- displayName: 'Project',- required: true,- }),+ workspaceId: clockifyProps.workspaceId({ required: true }),+ projectId: clockifyProps.projectId({ required: true }),name: Property.ShortText({displayName: 'Task Name',required: true,@@ -50,26 +45,19 @@ export const createTaskAction = createAction({],},}),- assigneeIds: assigneeIds({- displayName: 'Assignee',- required: false,- }),+ assigneeIds: clockifyProps.assigneeIds({ required: false }),},async run(context) {const { workspaceId, projectId, name, status } = context.propsValue;const assigneeIds = context.propsValue.assigneeIds ?? [];- const response = await clockifyApiCall({- apiKey: context.auth.secret_text,- method: HttpMethod.POST,- resourceUri: `/workspaces/${workspaceId}/projects/${projectId}/tasks`,- body: {- name,- status,- assigneeIds,- },+ return await clockifyApi.createTask({+ auth: context.auth,+ workspaceId,+ projectId,+ name,+ status,+ assigneeIds,});-- return response;},});diff --git a/packages/pieces/community/clockify/src/lib/actions/create-time-entry.ts b/packages/pieces/community/clockify/src/lib/actions/create-time-entry.tsindex b8e2e542c09..4eadc082706 100644--- a/packages/pieces/community/clockify/src/lib/actions/create-time-entry.ts+++ b/packages/pieces/community/clockify/src/lib/actions/create-time-entry.ts@@ -1,26 +1,24 @@-import { HttpMethod } from '@activepieces/pieces-common';import { createAction, Property } from '@activepieces/pieces-framework';import { clockifyAuth } from '../auth';-import { clockifyApiCall } from '../common/client';-import { projectId, tagIds, taskId, workspaceId } from '../common/props';+import { clockifyApi } from '../common/api';+import { clockifyProps } from '../common/props';+import { timeEntryOutputSchema } from '../output-schemas';export const createTimeEntryAction = createAction({auth: clockifyAuth,name: 'create-time-entry',+ outputSchema: timeEntryOutputSchema,classification: 'WRITE',displayName: 'Create Time Entry',description: 'Creates a new time entry.',- audience: 'both',+ audience: 'human',aiMetadata: {description:'Logs a completed time entry on a Clockify workspace for an explicit start and end datetime, optionally tied to a project, task, tags, and billable flag. Use to record past or fixed-duration work rather than to start a live timer (use Start Timer for that). Not idempotent: each call adds a new entry.',idempotent: false,},props: {- workspaceId: workspaceId({- displayName: 'Workspace',- required: true,- }),+ workspaceId: clockifyProps.workspaceId({ required: true }),start: Property.DateTime({displayName: 'Start Datetime',required: true,@@ -33,44 +31,29 @@ export const createTimeEntryAction = createAction({displayName: 'Entry Description',required: false,}),- projectId: projectId({- displayName: 'Project',- required: false,- }),- taskId: taskId({- displayName: 'Task',- required: false,- }),+ projectId: clockifyProps.projectId({ required: false }),+ taskId: clockifyProps.taskId({ required: false }),billable: Property.Checkbox({displayName: 'Billable',required: false,}),- tagIds: tagIds({- displayName: 'Tags',- required: false,- }),+ tagIds: clockifyProps.tagIds({ required: false }),},async run(context) {const { workspaceId, projectId, start, end, description, billable, taskId } =context.propsValue;const tagIds = context.propsValue.tagIds ?? [];- const response = await clockifyApiCall({- apiKey: context.auth.secret_text,- method: HttpMethod.POST,- resourceUri: `/workspaces/${workspaceId}/time-entries`,- body: {- billable,- description,- start,- end,- projectId,- taskId,- tagIds,- type: 'REGULAR',- },+ return await clockifyApi.createTimeEntry({+ auth: context.auth,+ workspaceId,+ billable,+ description,+ start,+ end,+ projectId,+ taskId,+ tagIds,});-- return response;},});diff --git a/packages/pieces/community/clockify/src/lib/actions/find-running-timer.ts b/packages/pieces/community/clockify/src/lib/actions/find-running-timer.tsindex 36d05752107..f545c984cfd 100644--- a/packages/pieces/community/clockify/src/lib/actions/find-running-timer.ts+++ b/packages/pieces/community/clockify/src/lib/actions/find-running-timer.ts@@ -1,36 +1,28 @@-import { HttpMethod } from '@activepieces/pieces-common';import { createAction } from '@activepieces/pieces-framework';import { clockifyAuth } from '../auth';-import { clockifyApiCall } from '../common/client';-import { workspaceId } from '../common/props';+import { clockifyApi } from '../common/api';+import { clockifyProps } from '../common/props';+import { runningTimersOutputSchema } from '../output-schemas';export const findRunningTimerAction = createAction({auth: clockifyAuth,name: 'find-running-timer',+ outputSchema: runningTimersOutputSchema,classification: 'SEARCH',displayName: 'Find Running Timer',description: 'Finds currently running timer on specified workspace.',- audience: 'both',+ audience: 'human',aiMetadata: {description:'Returns the in-progress (currently running) time entries for the authenticated user on the given workspace. Use to check whether a timer is active before starting or stopping one. Read-only and idempotent.',idempotent: true,},props: {- workspaceId: workspaceId({- displayName: 'Workspace',- required: true,- }),+ workspaceId: clockifyProps.workspaceId({ required: true }),},async run(context) {const { workspaceId } = context.propsValue;- const response = await clockifyApiCall({- apiKey: context.auth.secret_text,- method: HttpMethod.GET,- resourceUri: `/workspaces/${workspaceId}/time-entries/status/in-progress`,- });-- return response;+ return await clockifyApi.listInProgressTimeEntries({ auth: context.auth, workspaceId });},});diff --git a/packages/pieces/community/clockify/src/lib/actions/find-task.ts b/packages/pieces/community/clockify/src/lib/actions/find-task.tsindex f54667da1aa..8bb8239a9c5 100644--- a/packages/pieces/community/clockify/src/lib/actions/find-task.ts+++ b/packages/pieces/community/clockify/src/lib/actions/find-task.ts@@ -1,30 +1,25 @@-import { HttpMethod } from '@activepieces/pieces-common';import { createAction, Property } from '@activepieces/pieces-framework';import { clockifyAuth } from '../auth';-import { clockifyApiCall } from '../common/client';-import { projectId, workspaceId } from '../common/props';+import { clockifyApi } from '../common/api';+import { clockifyProps } from '../common/props';+import { foundTasksOutputSchema } from '../output-schemas';export const findTaskAction = createAction({auth: clockifyAuth,name: 'find-task',+ outputSchema: foundTasksOutputSchema,classification: 'SEARCH',displayName: 'Find Task',description: 'Finds an existing task in a specific project.',- audience: 'both',+ audience: 'human',aiMetadata: {description:'Searches for tasks by name within a specific Clockify project and returns matches. Toggle Exact Match for strict name matching versus a looser substring search. Use to resolve a task id or confirm a task exists before creating time entries. Read-only and idempotent.',idempotent: true,},props: {- workspaceId: workspaceId({- displayName: 'Workspace',- required: true,- }),- projectId: projectId({- displayName: 'Project',- required: true,- }),+ workspaceId: clockifyProps.workspaceId({ required: true }),+ projectId: clockifyProps.projectId({ required: true }),name: Property.ShortText({displayName: 'Task Name',required: true,@@ -37,16 +32,14 @@ export const findTaskAction = createAction({async run(context) {const { workspaceId, projectId, name, exactMatch } = context.propsValue;- const response = await clockifyApiCall({- apiKey: context.auth.secret_text,- method: HttpMethod.GET,- resourceUri: `/workspaces/${workspaceId}/projects/${projectId}/tasks`,+ return await clockifyApi.listTasks({+ auth: context.auth,+ workspaceId,+ projectId,query: {name,'strict-name-search': exactMatch ? 'true' : 'false',},- });-- return response;+ });},});diff --git a/packages/pieces/community/clockify/src/lib/actions/find-time-entry.ts b/packages/pieces/community/clockify/src/lib/actions/find-time-entry.tsindex d5d51e0ed57..30136fe5a5d 100644--- a/packages/pieces/community/clockify/src/lib/actions/find-time-entry.ts+++ b/packages/pieces/community/clockify/src/lib/actions/find-time-entry.ts@@ -1,26 +1,25 @@-import { HttpMethod, QueryParams } from '@activepieces/pieces-common';+import { QueryParams } from '@activepieces/pieces-common';import { createAction, Property } from '@activepieces/pieces-framework';import { clockifyAuth } from '../auth';-import { clockifyApiCall } from '../common/client';-import { projectId, taskId, workspaceId } from '../common/props';+import { clockifyApi } from '../common/api';+import { clockifyProps } from '../common/props';+import { foundTimeEntriesOutputSchema } from '../output-schemas';export const findTimeEntryAction = createAction({auth: clockifyAuth,name: 'find-time-entry',+ outputSchema: foundTimeEntriesOutputSchema,classification: 'SEARCH',displayName: 'Find Time Entry',description: 'Finds a time entry by description, start datetime or end datetime.',- audience: 'both',+ audience: 'human',aiMetadata: {description:"Searches the authenticated user's time entries on a workspace, optionally filtered by description, start/end datetime, project, or task. With no filters it returns recent entries; supplied filters narrow the results. Use to locate an existing entry or verify logged time. Read-only and idempotent.",idempotent: true,},props: {- workspaceId: workspaceId({- displayName: 'Workspace',- required: true,- }),+ workspaceId: clockifyProps.workspaceId({ required: true }),start: Property.DateTime({displayName: 'Start Datetime',required: false,@@ -33,41 +32,27 @@ export const findTimeEntryAction = createAction({displayName: 'Entry Description',required: false,}),- projectId: projectId({- displayName: 'Project',- required: false,- }),- taskId: taskId({- displayName: 'Task',- required: false,- }),+ projectId: clockifyProps.projectId({ required: false }),+ taskId: clockifyProps.taskId({ required: false }),},async run(context) {const { workspaceId, projectId, start, end, description, taskId } = context.propsValue;- const currentUserResponse = await clockifyApiCall<{ id: string; email: string }>({- apiKey: context.auth.secret_text,- method: HttpMethod.GET,- resourceUri: `/user`,- });-- const userId = currentUserResponse.id;+ const currentUser = await clockifyApi.getCurrentUser({ auth: context.auth });const qs: QueryParams = { hydrated: 'true' };if (description) qs['description'] = description;if (start) qs['start'] = start;if (end) qs['end'] = end;- if (projectId) qs['project'] = projectId as string;- if (taskId) qs['task'] = taskId as string;+ if (projectId) qs['project'] = projectId;+ if (taskId) qs['task'] = taskId;- const response = await clockifyApiCall({- apiKey: context.auth.secret_text,- method: HttpMethod.GET,- resourceUri: `/workspaces/${workspaceId}/user/${userId}/time-entries`,+ return await clockifyApi.listUserTimeEntries({+ auth: context.auth,+ workspaceId,+ userId: currentUser.id,query: qs,});-- return response;},});diff --git a/packages/pieces/community/clockify/src/lib/actions/start-timer.ts b/packages/pieces/community/clockify/src/lib/actions/start-timer.tsindex 34bd5313b28..570ef0256cc 100644--- a/packages/pieces/community/clockify/src/lib/actions/start-timer.ts+++ b/packages/pieces/community/clockify/src/lib/actions/start-timer.ts@@ -1,66 +1,49 @@-import { HttpMethod } from '@activepieces/pieces-common';import { createAction, Property } from '@activepieces/pieces-framework';import { clockifyAuth } from '../auth';-import { clockifyApiCall } from '../common/client';-import { projectId, tagIds, taskId, workspaceId } from '../common/props';+import { clockifyApi } from '../common/api';+import { clockifyProps } from '../common/props';+import { timeEntryOutputSchema } from '../output-schemas';export const startTimerAction = createAction({auth: clockifyAuth,name: 'start-timer',+ outputSchema: timeEntryOutputSchema,classification: 'WRITE',displayName: 'Start Timer',description: 'Starts a new time entry.',- audience: 'both',+ audience: 'human',aiMetadata: {description:'Starts a live, currently-running timer on a Clockify workspace from the current moment, optionally tied to a project, task, tags, and billable flag. Use to begin tracking ongoing work; use Stop Timer to end it and Create Time Entry to log a finished interval. Not idempotent: each call starts a new running entry.',idempotent: false,},props: {- workspaceId: workspaceId({- displayName: 'Workspace',- required: true,- }),+ workspaceId: clockifyProps.workspaceId({ required: true }),description: Property.LongText({displayName: 'Entry Description',required: false,}),- projectId: projectId({- displayName: 'Project',- required: false,- }),- taskId: taskId({- displayName: 'Task',- required: false,- }),+ projectId: clockifyProps.projectId({ required: false }),+ taskId: clockifyProps.taskId({ required: false }),billable: Property.Checkbox({displayName: 'Billable',required: false,}),- tagIds: tagIds({- displayName: 'Tags',- required: false,- }),+ tagIds: clockifyProps.tagIds({ required: false }),},async run(context) {const { workspaceId, projectId, description, billable, taskId } = context.propsValue;const tagIds = context.propsValue.tagIds ?? [];- const response = await clockifyApiCall({- apiKey: context.auth.secret_text,- method: HttpMethod.POST,- resourceUri: `/workspaces/${workspaceId}/time-entries`,- body: {- billable,- description,- start: new Date().toISOString(),- projectId,- taskId,- tagIds,- type: 'REGULAR',- },+ return await clockifyApi.createTimeEntry({+ auth: context.auth,+ workspaceId,+ billable,+ description,+ start: new Date().toISOString(),+ projectId,+ taskId,+ tagIds,});-- return response;},});diff --git a/packages/pieces/community/clockify/src/lib/actions/stop-timer.ts b/packages/pieces/community/clockify/src/lib/actions/stop-timer.tsindex 84d2fc14fee..e66c0d7af46 100644--- a/packages/pieces/community/clockify/src/lib/actions/stop-timer.ts+++ b/packages/pieces/community/clockify/src/lib/actions/stop-timer.ts@@ -1,47 +1,35 @@-import { HttpMethod } from '@activepieces/pieces-common';import { createAction } from '@activepieces/pieces-framework';import { clockifyAuth } from '../auth';-import { clockifyApiCall } from '../common/client';-import { workspaceId } from '../common/props';+import { clockifyApi } from '../common/api';+import { clockifyProps } from '../common/props';+import { timeEntryOutputSchema } from '../output-schemas';export const stopTimerAction = createAction({auth: clockifyAuth,name: 'stop-timer',+ outputSchema: timeEntryOutputSchema,classification: 'WRITE',displayName: 'Stop Timer',description: 'Stops currently running timer on specified workspace.',- audience: 'both',+ audience: 'human',aiMetadata: {description:"Stops the authenticated user's currently running timer on the given workspace by setting its end time to now. Use after Start Timer to finalize tracked work. Not idempotent in effect: if no timer is running there is nothing to stop, and the stopped time depends on when it is called.",idempotent: false,},props: {- workspaceId: workspaceId({- displayName: 'Workspace',- required: true,- }),+ workspaceId: clockifyProps.workspaceId({ required: true }),},async run(context) {const { workspaceId } = context.propsValue;- const currentUserResponse = await clockifyApiCall<{ id: string; email: string }>({- apiKey: context.auth.secret_text,- method: HttpMethod.GET,- resourceUri: `/user`,- });-- const userId = currentUserResponse.id;+ const currentUser = await clockifyApi.getCurrentUser({ auth: context.auth });- const response = await clockifyApiCall({- apiKey: context.auth.secret_text,- method: HttpMethod.PATCH,- resourceUri: `/workspaces/${workspaceId}/user/${userId}/time-entries`,- body: {- end: new Date().toISOString(),- },+ return await clockifyApi.stopUserTimer({+ auth: context.auth,+ workspaceId,+ userId: currentUser.id,+ end: new Date().toISOString(),});-- return response;},});diff --git a/packages/pieces/community/clockify/src/lib/auth.ts b/packages/pieces/community/clockify/src/lib/auth.tsindex 22da9237400..848c9e64849 100644--- a/packages/pieces/community/clockify/src/lib/auth.ts+++ b/packages/pieces/community/clockify/src/lib/auth.ts@@ -1,17 +1,14 @@-import { PieceAuth } from '@activepieces/pieces-framework';-import { HttpMethod } from '@activepieces/pieces-common';-import { clockifyApiCall } from './common/client';+import { AppConnectionType, PieceAuth } from '@activepieces/pieces-framework';+import { clockifyApi } from './common/api';export const clockifyAuth = PieceAuth.SecretText({- displayName:'API Key',+ displayName: 'API Key',description: `You can obtain your API key by navigating to **Preferences->Advanced**.`,required: true,validate: async ({ auth }) => {try {- await clockifyApiCall({- apiKey: auth,- method: HttpMethod.GET,- resourceUri: '/user',+ await clockifyApi.getCurrentUser({+ auth: { type: AppConnectionType.SECRET_TEXT, secret_text: auth },});return {diff --git a/packages/pieces/community/clockify/src/lib/common/ai-props.ts b/packages/pieces/community/clockify/src/lib/common/ai-props.tsnew file mode 100644index 00000000000..72a70a7dc93--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/common/ai-props.ts@@ -0,0 +1,258 @@+import { Property } from '@activepieces/pieces-framework';++import type { PropParams } from './props';++const CHANGE_FEED_TYPES = [+ 'TIME_ENTRY',+ 'PROJECTS',+ 'TASKS',+ 'CLIENTS',+ 'TAGS',+ 'USER',+ 'USER_GROUPS',+ 'CUSTOM_FIELDS',+ 'TIME_ENTRY_CUSTOM_FIELD_VALUE',+ 'TIME_ENTRY_RATE',+ 'HOLIDAYS',+ 'INVOICES',+ 'APPROVAL_REQUESTS',+ 'SCHEDULED_ASSIGNMENT',+ 'TIME_OFF_REQUEST',+ 'PTO_POLICY',+ 'BALANCE',+];++function idProp<R extends boolean>({+ required,+ displayName,+ description,+}: PropParams<R> & { displayName: string }) {+ return Property.ShortText({ displayName, description, required });+}++function workspaceId<R extends boolean>({+ required,+ displayName = 'Workspace ID',+ description = 'Workspace ID. Use List Workspaces to find it.',+}: PropParams<R>) {+ return idProp({ required, displayName, description });+}++function userId<R extends boolean>({+ required,+ displayName = 'User ID',+ description = 'User ID. Use List Users, or Get Current User for yourself.',+}: PropParams<R>) {+ return idProp({ required, displayName, description });+}++function projectId<R extends boolean>({+ required,+ displayName = 'Project ID',+ description = 'Project ID. Use List Projects to find it.',+}: PropParams<R>) {+ return idProp({ required, displayName, description });+}++function taskId<R extends boolean>({+ required,+ displayName = 'Task ID',+ description = 'Task ID. Use List Tasks to find it.',+}: PropParams<R>) {+ return idProp({ required, displayName, description });+}++function clientId<R extends boolean>({+ required,+ displayName = 'Client ID',+ description = 'Client ID. Use List Clients to find it.',+}: PropParams<R>) {+ return idProp({ required, displayName, description });+}++function tagId<R extends boolean>({+ required,+ displayName = 'Tag ID',+ description = 'Tag ID. Use List Tags to find it.',+}: PropParams<R>) {+ return idProp({ required, displayName, description });+}++function userGroupId<R extends boolean>({+ required,+ displayName = 'User Group ID',+ description = 'User group ID. Use List User Groups to find it.',+}: PropParams<R>) {+ return idProp({ required, displayName, description });+}++function timeEntryId<R extends boolean>({+ required,+ displayName = 'Time Entry ID',+ description = 'Time entry ID. Use List Time Entries to find it.',+}: PropParams<R>) {+ return idProp({ required, displayName, description });+}++function templateId<R extends boolean>({+ required,+ displayName = 'Template ID',+ description = 'Timesheet template ID. Use List Templates to find it.',+}: PropParams<R>) {+ return idProp({ required, displayName, description });+}++function holidayId<R extends boolean>({+ required,+ displayName = 'Holiday ID',+ description = 'Holiday ID. Use List Holidays to find it.',+}: PropParams<R>) {+ return idProp({ required, displayName, description });+}++function sharedReportId<R extends boolean>({+ required,+ displayName = 'Shared Report ID',+ description = 'Shared report ID. Use List Shared Reports to find it.',+}: PropParams<R>) {+ return idProp({ required, displayName, description });+}++function customFieldId<R extends boolean>({+ required,+ displayName = 'Custom Field ID',+ description = 'Custom field ID. Use List Custom Fields to find it.',+}: PropParams<R>) {+ return idProp({ required, displayName, description });+}++function page<R extends boolean>({+ required,+ displayName = 'Page',+ description = 'Page number, starting at 1. Default 1.',+}: PropParams<R>) {+ return Property.Number({ displayName, description, required });+}++function pageSize<R extends boolean>({+ required,+ displayName = 'Page Size',+ description = 'Items per page, 1 to 5000. Default 50.',+}: PropParams<R>) {+ return Property.Number({ displayName, description, required });+}++function rateAmount<R extends boolean>({+ required,+ displayName = 'Amount',+ description = 'Rate in cents, for example 2500 for 25.00.',+}: PropParams<R>) {+ return Property.Number({ displayName, description, required });+}++function rateSince<R extends boolean>({+ required,+ displayName = 'Apply Since',+ description = 'Optional ISO 8601 datetime, for example 2026-01-01T00:00:00Z. Time entries from this moment on get the new rate. Empty = only new time entries.',+}: PropParams<R>) {+ return Property.DateTime({ displayName, description, required });+}++function includeApproved<R extends boolean>({+ required,+ displayName = 'Include Approved Entries',+ description = 'When Apply Since is set, also re-rate time entries that were already approved. Default false.',+}: PropParams<R>) {+ return Property.Checkbox({ displayName, description, required });+}++function tagIds<R extends boolean>({+ required,+ displayName = 'Tag IDs',+ description = 'Tag IDs to put on the time entry. Use List Tags to find them.',+}: PropParams<R>) {+ return Property.Array({ displayName, description, required });+}++function timeEntryIds<R extends boolean>({+ required,+ displayName = 'Time Entry IDs',+ description = 'Time entry IDs. Use List Time Entries to find them.',+}: PropParams<R>) {+ return Property.Array({ displayName, description, required });+}++function entryDescription<R extends boolean>({+ required,+ displayName = 'Description',+ description = 'What the time was spent on.',+}: PropParams<R>) {+ return Property.LongText({ displayName, description, required });+}++function dateRangeStart<R extends boolean>({+ required,+ displayName = 'From',+ description = 'Start of the report period, ISO 8601, for example 2026-10-01T00:00:00Z.',+}: PropParams<R>) {+ return Property.DateTime({ displayName, description, required });+}++function dateRangeEnd<R extends boolean>({+ required,+ displayName = 'To',+ description = 'End of the report period, ISO 8601, for example 2026-10-31T23:59:59Z.',+}: PropParams<R>) {+ return Property.DateTime({ displayName, description, required });+}++function idList<R extends boolean>({+ required,+ displayName,+ description,+}: PropParams<R> & { displayName: string }) {+ return Property.Array({ displayName, description, required });+}++function changeFeedEntityType<R extends boolean>({+ required,+ displayName = 'Record Type',+ description = 'Type of record to list changes for.',+}: PropParams<R>) {+ return Property.StaticDropdown({+ displayName,+ description,+ required,+ options: {+ disabled: false,+ options: CHANGE_FEED_TYPES.map((value) => ({ label: value, value })),+ },+ });+}++export const clockifyAiProps = {+ workspaceId,+ userId,+ projectId,+ taskId,+ clientId,+ tagId,+ userGroupId,+ timeEntryId,+ templateId,+ holidayId,+ sharedReportId,+ customFieldId,+ page,+ pageSize,+ rateAmount,+ rateSince,+ includeApproved,+ tagIds,+ timeEntryIds,+ entryDescription,+ dateRangeStart,+ dateRangeEnd,+ idList,+ changeFeedEntityType,+};diff --git a/packages/pieces/community/clockify/src/lib/common/api.ts b/packages/pieces/community/clockify/src/lib/common/api.tsnew file mode 100644index 00000000000..25a5738d2dc--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/common/api.ts@@ -0,0 +1,1581 @@+import { HttpMethod, QueryParams } from '@activepieces/pieces-common';++import { clockifyClient } from './client';++import type {+ ClockifyAuthValue,+ ClockifyProject,+ ClockifyTag,+ ClockifyTask,+ ClockifyTimeEntry,+ ClockifyUser,+ ClockifyWebhook,+ ClockifyWorkspace,+ ClockifyMemberProfile,+ ClockifyRole,+ ClockifyUserCustomFieldValue,+ ClockifyUserGroup,+ ClockifyClient,+ ClockifyClientInput,+ ClockifyProjectInput,+ ClockifyCustomField,+ ClockifyTaskInput,+ ClockifyTimeEntryInput,+ ClockifyEntityFilter,+ ClockifyReport,+ ClockifyReportRequest,+ ClockifySharedReport,+ ClockifySharedReportInput,+ ClockifySharedReportPage,+ ClockifySharedReportUpdate,+ ClockifyTemplate,+ ClockifyHoliday,+ ClockifyAssignment,+} from './types';++async function getCurrentUser({+ auth,+ query,+}: {+ auth: ClockifyAuthValue;+ query?: QueryParams;+}): Promise<ClockifyUser> {+ return await clockifyClient.request<ClockifyUser>({+ auth,+ method: HttpMethod.GET,+ path: '/user',+ query,+ });+}++async function listWorkspaces({+ auth,+ query,+}: {+ auth: ClockifyAuthValue;+ query?: QueryParams;+}): Promise<ClockifyWorkspace[]> {+ return await clockifyClient.request<ClockifyWorkspace[]>({+ auth,+ method: HttpMethod.GET,+ path: '/workspaces',+ query,+ });+}++async function listProjects({+ auth,+ workspaceId,+ query,+}: WorkspaceScope & { auth: ClockifyAuthValue; query?: QueryParams }): Promise<ClockifyProject[]> {+ return await clockifyClient.request<ClockifyProject[]>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/projects`,+ query,+ });+}++async function listUsers({+ auth,+ workspaceId,+}: {+ auth: ClockifyAuthValue;+ workspaceId: string;+}): Promise<ClockifyUser[]> {+ return await clockifyClient.request<ClockifyUser[]>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/users`,+ });+}++async function listTags({+ auth,+ workspaceId,+ query,+}: WorkspaceScope & { auth: ClockifyAuthValue; query?: QueryParams }): Promise<ClockifyTag[]> {+ return await clockifyClient.request<ClockifyTag[]>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/tags`,+ query,+ });+}++async function listTasks({+ auth,+ workspaceId,+ projectId,+ query,+}: {+ auth: ClockifyAuthValue;+ workspaceId: string;+ projectId: string;+ query?: QueryParams;+}): Promise<ClockifyTask[]> {+ return await clockifyClient.request<ClockifyTask[]>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/projects/${projectId}/tasks`,+ query,+ });+}++async function createTask({+ auth,+ workspaceId,+ projectId,+ name,+ status,+ assigneeIds,+ estimate,+ userGroupIds,+}: CreateTaskParams & { auth: ClockifyAuthValue }): Promise<ClockifyTask> {+ return await clockifyClient.request<ClockifyTask>({+ auth,+ method: HttpMethod.POST,+ path: `/workspaces/${workspaceId}/projects/${projectId}/tasks`,+ body: {+ name,+ status,+ assigneeIds,+ estimate,+ userGroupIds,+ },+ });+}++async function createTimeEntry({+ auth,+ workspaceId,+ billable,+ description,+ start,+ end,+ projectId,+ taskId,+ tagIds,+}: CreateTimeEntryParams & { auth: ClockifyAuthValue }): Promise<ClockifyTimeEntry> {+ return await clockifyClient.request<ClockifyTimeEntry>({+ auth,+ method: HttpMethod.POST,+ path: `/workspaces/${workspaceId}/time-entries`,+ body: {+ billable,+ description,+ start,+ end,+ projectId,+ taskId,+ tagIds,+ type: 'REGULAR',+ },+ });+}++async function listInProgressTimeEntries({+ auth,+ workspaceId,+ query,+}: WorkspaceScope & { auth: ClockifyAuthValue; query?: QueryParams }): Promise<+ ClockifyTimeEntry[]+> {+ return await clockifyClient.request<ClockifyTimeEntry[]>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/time-entries/status/in-progress`,+ query,+ });+}++async function listUserTimeEntries({+ auth,+ workspaceId,+ userId,+ query,+}: {+ auth: ClockifyAuthValue;+ workspaceId: string;+ userId: string;+ query: QueryParams;+}): Promise<ClockifyTimeEntry[]> {+ return await clockifyClient.request<ClockifyTimeEntry[]>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/user/${userId}/time-entries`,+ query,+ });+}++async function stopUserTimer({+ auth,+ workspaceId,+ userId,+ end,+}: {+ auth: ClockifyAuthValue;+ workspaceId: string;+ userId: string;+ end: string;+}): Promise<ClockifyTimeEntry> {+ return await clockifyClient.request<ClockifyTimeEntry>({+ auth,+ method: HttpMethod.PATCH,+ path: `/workspaces/${workspaceId}/user/${userId}/time-entries`,+ body: {+ end,+ },+ });+}++async function createWebhook({+ auth,+ workspaceId,+ url,+ webhookEvent,+ triggerSourceType,+ triggerSource,+}: CreateWebhookParams & { auth: ClockifyAuthValue }): Promise<ClockifyWebhook> {+ return await clockifyClient.request<ClockifyWebhook>({+ auth,+ method: HttpMethod.POST,+ path: `/workspaces/${workspaceId}/webhooks`,+ body: {+ url,+ webhookEvent,+ triggerSourceType,+ triggerSource,+ },+ });+}++async function deleteWebhook({+ auth,+ workspaceId,+ webhookId,+}: {+ auth: ClockifyAuthValue;+ workspaceId: string;+ webhookId: string;+}): Promise<void> {+ await clockifyClient.request<unknown>({+ auth,+ method: HttpMethod.DELETE,+ path: `/workspaces/${workspaceId}/webhooks/${webhookId}`,+ });+}++async function getWorkspace({+ auth,+ workspaceId,+}: WorkspaceScope & { auth: ClockifyAuthValue }): Promise<ClockifyWorkspace> {+ return await clockifyClient.request<ClockifyWorkspace>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}`,+ });+}++async function createWorkspace({+ auth,+ name,+ organizationId,+}: {+ auth: ClockifyAuthValue;+ name: string;+ organizationId: string | undefined;+}): Promise<ClockifyWorkspace> {+ return await clockifyClient.request<ClockifyWorkspace>({+ auth,+ method: HttpMethod.POST,+ path: '/workspaces',+ body: { name, organizationId },+ });+}++async function updateWorkspaceBillableRate({+ auth,+ workspaceId,+ amount,+ currency,+ since,+ includeApproved,+}: WorkspaceScope &+ RateParams & { auth: ClockifyAuthValue; currency: string }): Promise<ClockifyWorkspace> {+ return await clockifyClient.request<ClockifyWorkspace>({+ auth,+ method: HttpMethod.PUT,+ path: `/workspaces/${workspaceId}/hourly-rate`,+ body: { amount, currency, since, includeApproved },+ });+}++async function updateWorkspaceCostRate({+ auth,+ workspaceId,+ amount,+ since,+ includeApproved,+}: WorkspaceScope & RateParams & { auth: ClockifyAuthValue }): Promise<ClockifyWorkspace> {+ return await clockifyClient.request<ClockifyWorkspace>({+ auth,+ method: HttpMethod.PUT,+ path: `/workspaces/${workspaceId}/cost-rate`,+ body: { amount, since, includeApproved },+ });+}++async function filterUsers({+ auth,+ workspaceId,+ filter,+}: WorkspaceScope & { auth: ClockifyAuthValue; filter: UserFilter }): Promise<ClockifyUser[]> {+ return await clockifyClient.request<ClockifyUser[]>({+ auth,+ method: HttpMethod.POST,+ path: `/workspaces/${workspaceId}/users/info`,+ body: filter,+ });+}++async function updateUserStatus({+ auth,+ workspaceId,+ userId,+ status,+}: UserScope & { auth: ClockifyAuthValue; status: string }): Promise<ClockifyWorkspace> {+ return await clockifyClient.request<ClockifyWorkspace>({+ auth,+ method: HttpMethod.PUT,+ path: `/workspaces/${workspaceId}/users/${userId}`,+ body: { status },+ });+}++async function updateUserBillableRate({+ auth,+ workspaceId,+ userId,+ amount,+ since,+ includeApproved,+}: UserScope & RateParams & { auth: ClockifyAuthValue }): Promise<ClockifyWorkspace> {+ return await clockifyClient.request<ClockifyWorkspace>({+ auth,+ method: HttpMethod.PUT,+ path: `/workspaces/${workspaceId}/users/${userId}/hourly-rate`,+ body: { amount, since, includeApproved },+ });+}++async function updateUserCostRate({+ auth,+ workspaceId,+ userId,+ amount,+ since,+ includeApproved,+}: UserScope & RateParams & { auth: ClockifyAuthValue }): Promise<ClockifyWorkspace> {+ return await clockifyClient.request<ClockifyWorkspace>({+ auth,+ method: HttpMethod.PUT,+ path: `/workspaces/${workspaceId}/users/${userId}/cost-rate`,+ body: { amount, since, includeApproved },+ });+}++async function updateUserCustomField({+ auth,+ workspaceId,+ userId,+ customFieldId,+ value,+}: UserScope & {+ auth: ClockifyAuthValue;+ customFieldId: string;+ value: string;+}): Promise<ClockifyUserCustomFieldValue> {+ return await clockifyClient.request<ClockifyUserCustomFieldValue>({+ auth,+ method: HttpMethod.PUT,+ path: `/workspaces/${workspaceId}/users/${userId}/custom-field/${customFieldId}/value`,+ body: { value },+ });+}++async function listUserManagers({+ auth,+ workspaceId,+ userId,+ query,+}: UserScope & { auth: ClockifyAuthValue; query: QueryParams }): Promise<ClockifyUser[]> {+ return await clockifyClient.request<ClockifyUser[]>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/users/${userId}/managers`,+ query,+ });+}++async function addUserRole({+ auth,+ workspaceId,+ userId,+ role,+ entityId,+ sourceType,+}: UserScope & RoleParams & { auth: ClockifyAuthValue }): Promise<ClockifyRole[]> {+ return await clockifyClient.request<ClockifyRole[]>({+ auth,+ method: HttpMethod.POST,+ path: `/workspaces/${workspaceId}/users/${userId}/roles`,+ body: { role, entityId, sourceType },+ });+}++async function removeUserRole({+ auth,+ workspaceId,+ userId,+ role,+ entityId,+ sourceType,+}: UserScope & RoleParams & { auth: ClockifyAuthValue }): Promise<void> {+ await clockifyClient.request<unknown>({+ auth,+ method: HttpMethod.DELETE,+ path: `/workspaces/${workspaceId}/users/${userId}/roles`,+ body: { role, entityId, sourceType },+ });+}++async function getMemberProfile({+ auth,+ workspaceId,+ userId,+}: UserScope & { auth: ClockifyAuthValue }): Promise<ClockifyMemberProfile> {+ return await clockifyClient.request<ClockifyMemberProfile>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/member-profile/${userId}`,+ });+}++async function updateMemberProfile({+ auth,+ workspaceId,+ userId,+ changes,+}: UserScope & {+ auth: ClockifyAuthValue;+ changes: MemberProfileChanges;+}): Promise<ClockifyMemberProfile> {+ return await clockifyClient.request<ClockifyMemberProfile>({+ auth,+ method: HttpMethod.PATCH,+ path: `/workspaces/${workspaceId}/member-profile/${userId}`,+ body: changes,+ });+}++async function listUserGroups({+ auth,+ workspaceId,+ query,+}: WorkspaceScope & { auth: ClockifyAuthValue; query: QueryParams }): Promise<ClockifyUserGroup[]> {+ return await clockifyClient.request<ClockifyUserGroup[]>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/user-groups`,+ query,+ });+}++async function createUserGroup({+ auth,+ workspaceId,+ name,+}: WorkspaceScope & { auth: ClockifyAuthValue; name: string }): Promise<ClockifyUserGroup> {+ return await clockifyClient.request<ClockifyUserGroup>({+ auth,+ method: HttpMethod.POST,+ path: `/workspaces/${workspaceId}/user-groups`,+ body: { name },+ });+}++async function updateUserGroup({+ auth,+ workspaceId,+ userGroupId,+ name,+}: UserGroupScope & { auth: ClockifyAuthValue; name: string }): Promise<ClockifyUserGroup> {+ return await clockifyClient.request<ClockifyUserGroup>({+ auth,+ method: HttpMethod.PUT,+ path: `/workspaces/${workspaceId}/user-groups/${userGroupId}`,+ body: { name },+ });+}++async function deleteUserGroup({+ auth,+ workspaceId,+ userGroupId,+}: UserGroupScope & { auth: ClockifyAuthValue }): Promise<ClockifyUserGroup> {+ return await clockifyClient.request<ClockifyUserGroup>({+ auth,+ method: HttpMethod.DELETE,+ path: `/workspaces/${workspaceId}/user-groups/${userGroupId}`,+ });+}++async function addUserToGroup({+ auth,+ workspaceId,+ userGroupId,+ userId,+}: UserGroupScope & { auth: ClockifyAuthValue; userId: string }): Promise<ClockifyUserGroup> {+ return await clockifyClient.request<ClockifyUserGroup>({+ auth,+ method: HttpMethod.POST,+ path: `/workspaces/${workspaceId}/user-groups/${userGroupId}/users`,+ body: { userId },+ });+}++async function removeUserFromGroup({+ auth,+ workspaceId,+ userGroupId,+ userId,+}: UserGroupScope & { auth: ClockifyAuthValue; userId: string }): Promise<ClockifyUserGroup> {+ return await clockifyClient.request<ClockifyUserGroup>({+ auth,+ method: HttpMethod.DELETE,+ path: `/workspaces/${workspaceId}/user-groups/${userGroupId}/users/${userId}`,+ });+}++async function listClients({+ auth,+ workspaceId,+ query,+}: WorkspaceScope & { auth: ClockifyAuthValue; query: QueryParams }): Promise<ClockifyClient[]> {+ return await clockifyClient.request<ClockifyClient[]>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/clients`,+ query,+ });+}++async function getClient({+ auth,+ workspaceId,+ clientId,+}: WorkspaceScope & { auth: ClockifyAuthValue; clientId: string }): Promise<ClockifyClient> {+ return await clockifyClient.request<ClockifyClient>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/clients/${clientId}`,+ });+}++async function createClient({+ auth,+ workspaceId,+ client,+}: WorkspaceScope & {+ auth: ClockifyAuthValue;+ client: ClockifyClientInput;+}): Promise<ClockifyClient> {+ return await clockifyClient.request<ClockifyClient>({+ auth,+ method: HttpMethod.POST,+ path: `/workspaces/${workspaceId}/clients`,+ body: client,+ });+}++async function updateClient({+ auth,+ workspaceId,+ clientId,+ client,+ query,+}: WorkspaceScope & {+ auth: ClockifyAuthValue;+ clientId: string;+ client: ClockifyClientInput;+ query: QueryParams;+}): Promise<ClockifyClient> {+ return await clockifyClient.request<ClockifyClient>({+ auth,+ method: HttpMethod.PUT,+ path: `/workspaces/${workspaceId}/clients/${clientId}`,+ body: client,+ query,+ });+}++async function deleteClient({+ auth,+ workspaceId,+ clientId,+}: WorkspaceScope & { auth: ClockifyAuthValue; clientId: string }): Promise<ClockifyClient> {+ return await clockifyClient.request<ClockifyClient>({+ auth,+ method: HttpMethod.DELETE,+ path: `/workspaces/${workspaceId}/clients/${clientId}`,+ });+}++async function getTag({+ auth,+ workspaceId,+ tagId,+}: WorkspaceScope & { auth: ClockifyAuthValue; tagId: string }): Promise<ClockifyTag> {+ return await clockifyClient.request<ClockifyTag>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/tags/${tagId}`,+ });+}++async function createTag({+ auth,+ workspaceId,+ name,+}: WorkspaceScope & { auth: ClockifyAuthValue; name: string }): Promise<ClockifyTag> {+ return await clockifyClient.request<ClockifyTag>({+ auth,+ method: HttpMethod.POST,+ path: `/workspaces/${workspaceId}/tags`,+ body: { name },+ });+}++async function updateTag({+ auth,+ workspaceId,+ tagId,+ name,+ archived,+}: WorkspaceScope & {+ auth: ClockifyAuthValue;+ tagId: string;+ name: string;+ archived: boolean;+}): Promise<ClockifyTag> {+ return await clockifyClient.request<ClockifyTag>({+ auth,+ method: HttpMethod.PUT,+ path: `/workspaces/${workspaceId}/tags/${tagId}`,+ body: { name, archived },+ });+}++async function deleteTag({+ auth,+ workspaceId,+ tagId,+}: WorkspaceScope & { auth: ClockifyAuthValue; tagId: string }): Promise<ClockifyTag> {+ return await clockifyClient.request<ClockifyTag>({+ auth,+ method: HttpMethod.DELETE,+ path: `/workspaces/${workspaceId}/tags/${tagId}`,+ });+}++async function getProject({+ auth,+ workspaceId,+ projectId,+}: ProjectScope & { auth: ClockifyAuthValue }): Promise<ClockifyProject> {+ return await clockifyClient.request<ClockifyProject>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/projects/${projectId}`,+ });+}++async function createProject({+ auth,+ workspaceId,+ project,+}: WorkspaceScope & {+ auth: ClockifyAuthValue;+ project: ClockifyProjectInput;+}): Promise<ClockifyProject> {+ return await clockifyClient.request<ClockifyProject>({+ auth,+ method: HttpMethod.POST,+ path: `/workspaces/${workspaceId}/projects`,+ body: project,+ });+}++async function createProjectFromTemplate({+ auth,+ workspaceId,+ project,+}: WorkspaceScope & {+ auth: ClockifyAuthValue;+ project: ProjectFromTemplateInput;+}): Promise<ClockifyProject> {+ return await clockifyClient.request<ClockifyProject>({+ auth,+ method: HttpMethod.POST,+ path: `/workspaces/${workspaceId}/projects/from-template`,+ body: project,+ });+}++async function updateProject({+ auth,+ workspaceId,+ projectId,+ project,+}: ProjectScope & {+ auth: ClockifyAuthValue;+ project: ClockifyProjectInput;+}): Promise<ClockifyProject> {+ return await clockifyClient.request<ClockifyProject>({+ auth,+ method: HttpMethod.PUT,+ path: `/workspaces/${workspaceId}/projects/${projectId}`,+ body: project,+ });+}++async function deleteProject({+ auth,+ workspaceId,+ projectId,+}: ProjectScope & { auth: ClockifyAuthValue }): Promise<ClockifyProject> {+ return await clockifyClient.request<ClockifyProject>({+ auth,+ method: HttpMethod.DELETE,+ path: `/workspaces/${workspaceId}/projects/${projectId}`,+ });+}++async function replaceProjectMemberships({+ auth,+ workspaceId,+ projectId,+ userIds,+}: ProjectScope & { auth: ClockifyAuthValue; userIds: string[] }): Promise<ClockifyProject> {+ return await clockifyClient.request<ClockifyProject>({+ auth,+ method: HttpMethod.PATCH,+ path: `/workspaces/${workspaceId}/projects/${projectId}/memberships`,+ body: { memberships: userIds.map((userId) => ({ userId })) },+ });+}++async function assignProjectUsers({+ auth,+ workspaceId,+ projectId,+ userIds,+ remove,+}: ProjectScope & {+ auth: ClockifyAuthValue;+ userIds: string[];+ remove: boolean;+}): Promise<ClockifyProject> {+ return await clockifyClient.request<ClockifyProject>({+ auth,+ method: HttpMethod.POST,+ path: `/workspaces/${workspaceId}/projects/${projectId}/memberships`,+ body: { userIds, remove },+ });+}++async function updateProjectUserBillableRate({+ auth,+ workspaceId,+ projectId,+ userId,+ amount,+ since,+ includeApproved,+}: ProjectScope &+ RateParams & { auth: ClockifyAuthValue; userId: string }): Promise<ClockifyProject> {+ return await clockifyClient.request<ClockifyProject>({+ auth,+ method: HttpMethod.PUT,+ path: `/workspaces/${workspaceId}/projects/${projectId}/users/${userId}/hourly-rate`,+ body: { amount, since, includeApproved },+ });+}++async function updateProjectUserCostRate({+ auth,+ workspaceId,+ projectId,+ userId,+ amount,+ since,+ includeApproved,+}: ProjectScope &+ RateParams & { auth: ClockifyAuthValue; userId: string }): Promise<ClockifyProject> {+ return await clockifyClient.request<ClockifyProject>({+ auth,+ method: HttpMethod.PUT,+ path: `/workspaces/${workspaceId}/projects/${projectId}/users/${userId}/cost-rate`,+ body: { amount, since, includeApproved },+ });+}++async function updateProjectEstimate({+ auth,+ workspaceId,+ projectId,+ estimate,+}: ProjectScope & {+ auth: ClockifyAuthValue;+ estimate: ProjectEstimateInput;+}): Promise<ClockifyProject> {+ return await clockifyClient.request<ClockifyProject>({+ auth,+ method: HttpMethod.PATCH,+ path: `/workspaces/${workspaceId}/projects/${projectId}/estimate`,+ body: estimate,+ });+}++async function updateProjectTemplate({+ auth,+ workspaceId,+ projectId,+ isTemplate,+}: ProjectScope & { auth: ClockifyAuthValue; isTemplate: boolean }): Promise<ClockifyProject> {+ return await clockifyClient.request<ClockifyProject>({+ auth,+ method: HttpMethod.PATCH,+ path: `/workspaces/${workspaceId}/projects/${projectId}/template`,+ body: { isTemplate },+ });+}++async function listProjectCustomFields({+ auth,+ workspaceId,+ projectId,+ query,+}: ProjectScope & { auth: ClockifyAuthValue; query: QueryParams }): Promise<ClockifyCustomField[]> {+ return await clockifyClient.request<ClockifyCustomField[]>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/projects/${projectId}/custom-fields`,+ query,+ });+}++async function getTask({+ auth,+ workspaceId,+ projectId,+ taskId,+}: ProjectScope & { auth: ClockifyAuthValue; taskId: string }): Promise<ClockifyTask> {+ return await clockifyClient.request<ClockifyTask>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/projects/${projectId}/tasks/${taskId}`,+ });+}++async function updateTask({+ auth,+ workspaceId,+ projectId,+ taskId,+ task,+}: ProjectScope & {+ auth: ClockifyAuthValue;+ taskId: string;+ task: ClockifyTaskInput;+}): Promise<ClockifyTask> {+ return await clockifyClient.request<ClockifyTask>({+ auth,+ method: HttpMethod.PUT,+ path: `/workspaces/${workspaceId}/projects/${projectId}/tasks/${taskId}`,+ body: task,+ });+}++async function deleteTask({+ auth,+ workspaceId,+ projectId,+ taskId,+}: ProjectScope & { auth: ClockifyAuthValue; taskId: string }): Promise<ClockifyTask> {+ return await clockifyClient.request<ClockifyTask>({+ auth,+ method: HttpMethod.DELETE,+ path: `/workspaces/${workspaceId}/projects/${projectId}/tasks/${taskId}`,+ });+}++async function updateTaskBillableRate({+ auth,+ workspaceId,+ projectId,+ taskId,+ amount,+ since,+ includeApproved,+}: ProjectScope & RateParams & { auth: ClockifyAuthValue; taskId: string }): Promise<ClockifyTask> {+ return await clockifyClient.request<ClockifyTask>({+ auth,+ method: HttpMethod.PUT,+ path: `/workspaces/${workspaceId}/projects/${projectId}/tasks/${taskId}/hourly-rate`,+ body: { amount, since, includeApproved },+ });+}++async function updateTaskCostRate({+ auth,+ workspaceId,+ projectId,+ taskId,+ amount,+ since,+ includeApproved,+}: ProjectScope & RateParams & { auth: ClockifyAuthValue; taskId: string }): Promise<ClockifyTask> {+ return await clockifyClient.request<ClockifyTask>({+ auth,+ method: HttpMethod.PUT,+ path: `/workspaces/${workspaceId}/projects/${projectId}/tasks/${taskId}/cost-rate`,+ body: { amount, since, includeApproved },+ });+}++async function createUserTimeEntry({+ auth,+ workspaceId,+ userId,+ entry,+}: UserScope & {+ auth: ClockifyAuthValue;+ entry: ClockifyTimeEntryInput;+}): Promise<ClockifyTimeEntry> {+ return await clockifyClient.request<ClockifyTimeEntry>({+ auth,+ method: HttpMethod.POST,+ path: `/workspaces/${workspaceId}/user/${userId}/time-entries`,+ body: entry,+ });+}++async function getTimeEntry({+ auth,+ workspaceId,+ timeEntryId,+ query,+}: TimeEntryScope & { auth: ClockifyAuthValue; query: QueryParams }): Promise<ClockifyTimeEntry> {+ return await clockifyClient.request<ClockifyTimeEntry>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/time-entries/${timeEntryId}`,+ query,+ });+}++async function getTimeEntriesByIds({+ auth,+ workspaceId,+ timeEntryIds,+ hydrated,+}: WorkspaceScope & {+ auth: ClockifyAuthValue;+ timeEntryIds: string[];+ hydrated?: boolean;+}): Promise<ClockifyTimeEntry[]> {+ return await clockifyClient.request<ClockifyTimeEntry[]>({+ auth,+ method: HttpMethod.POST,+ path: `/workspaces/${workspaceId}/time-entries/batch`,+ body: { timeEntryIds, hydrated },+ });+}++async function updateTimeEntry({+ auth,+ workspaceId,+ timeEntryId,+ entry,+}: TimeEntryScope & {+ auth: ClockifyAuthValue;+ entry: ClockifyTimeEntryInput;+}): Promise<ClockifyTimeEntry> {+ return await clockifyClient.request<ClockifyTimeEntry>({+ auth,+ method: HttpMethod.PUT,+ path: `/workspaces/${workspaceId}/time-entries/${timeEntryId}`,+ body: entry,+ });+}++async function bulkUpdateTimeEntries({+ auth,+ workspaceId,+ userId,+ entries,+}: UserScope & {+ auth: ClockifyAuthValue;+ entries: (ClockifyTimeEntryInput & { id: string })[];+}): Promise<ClockifyTimeEntry[]> {+ return await clockifyClient.request<ClockifyTimeEntry[]>({+ auth,+ method: HttpMethod.PUT,+ path: `/workspaces/${workspaceId}/user/${userId}/time-entries`,+ body: entries,+ });+}++async function deleteTimeEntry({+ auth,+ workspaceId,+ timeEntryId,+}: TimeEntryScope & { auth: ClockifyAuthValue }): Promise<void> {+ await clockifyClient.request<unknown>({+ auth,+ method: HttpMethod.DELETE,+ path: `/workspaces/${workspaceId}/time-entries/${timeEntryId}`,+ });+}++async function bulkDeleteTimeEntries({+ auth,+ workspaceId,+ userId,+ timeEntryIds,+}: UserScope & { auth: ClockifyAuthValue; timeEntryIds: string[] }): Promise<ClockifyTimeEntry[]> {+ return await clockifyClient.request<ClockifyTimeEntry[]>({+ auth,+ method: HttpMethod.DELETE,+ path: `/workspaces/${workspaceId}/user/${userId}/time-entries`,+ query: { 'time-entry-ids': timeEntryIds.join(',') },+ });+}++async function duplicateTimeEntry({+ auth,+ workspaceId,+ userId,+ timeEntryId,+}: UserScope & { auth: ClockifyAuthValue; timeEntryId: string }): Promise<ClockifyTimeEntry> {+ return await clockifyClient.request<ClockifyTimeEntry>({+ auth,+ method: HttpMethod.POST,+ path: `/workspaces/${workspaceId}/user/${userId}/time-entries/${timeEntryId}/duplicate`,+ });+}++async function markTimeEntriesInvoiced({+ auth,+ workspaceId,+ timeEntryIds,+ invoiced,+}: WorkspaceScope & {+ auth: ClockifyAuthValue;+ timeEntryIds: string[];+ invoiced: boolean;+}): Promise<void> {+ await clockifyClient.request<unknown>({+ auth,+ method: HttpMethod.PATCH,+ path: `/workspaces/${workspaceId}/time-entries/invoiced`,+ body: { timeEntryIds, invoiced },+ });+}++async function generateReport({+ auth,+ workspaceId,+ kind,+ report,+}: WorkspaceScope & {+ auth: ClockifyAuthValue;+ kind: ReportKind;+ report: ClockifyReportRequest;+}): Promise<ClockifyReport> {+ return await clockifyClient.request<ClockifyReport>({+ auth,+ method: HttpMethod.POST,+ path: `/workspaces/${workspaceId}/reports/${kind}`,+ body: report,+ host: 'reports',+ });+}++async function listSharedReports({+ auth,+ workspaceId,+ query,+}: WorkspaceScope & {+ auth: ClockifyAuthValue;+ query: QueryParams;+}): Promise<ClockifySharedReportPage> {+ return await clockifyClient.request<ClockifySharedReportPage>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/shared-reports`,+ query,+ host: 'reports',+ });+}++async function getSharedReport({+ auth,+ sharedReportId,+ query,+}: {+ auth: ClockifyAuthValue;+ sharedReportId: string;+ query: QueryParams;+}): Promise<ClockifyReport> {+ return await clockifyClient.request<ClockifyReport>({+ auth,+ method: HttpMethod.GET,+ path: `/shared-reports/${sharedReportId}`,+ query,+ host: 'reports',+ });+}++async function createSharedReport({+ auth,+ workspaceId,+ sharedReport,+}: WorkspaceScope & {+ auth: ClockifyAuthValue;+ sharedReport: ClockifySharedReportInput;+}): Promise<ClockifySharedReport> {+ return await clockifyClient.request<ClockifySharedReport>({+ auth,+ method: HttpMethod.POST,+ path: `/workspaces/${workspaceId}/shared-reports`,+ body: sharedReport,+ host: 'reports',+ });+}++async function updateSharedReport({+ auth,+ workspaceId,+ sharedReportId,+ sharedReport,+}: WorkspaceScope & {+ auth: ClockifyAuthValue;+ sharedReportId: string;+ sharedReport: ClockifySharedReportUpdate;+}): Promise<ClockifySharedReport> {+ return await clockifyClient.request<ClockifySharedReport>({+ auth,+ method: HttpMethod.PUT,+ path: `/workspaces/${workspaceId}/shared-reports/${sharedReportId}`,+ body: sharedReport,+ host: 'reports',+ });+}++async function deleteSharedReport({+ auth,+ workspaceId,+ sharedReportId,+}: WorkspaceScope & { auth: ClockifyAuthValue; sharedReportId: string }): Promise<void> {+ await clockifyClient.request<unknown>({+ auth,+ method: HttpMethod.DELETE,+ path: `/workspaces/${workspaceId}/shared-reports/${sharedReportId}`,+ host: 'reports',+ });+}++async function listTemplates({+ auth,+ workspaceId,+ query,+}: WorkspaceScope & { auth: ClockifyAuthValue; query: QueryParams }): Promise<ClockifyTemplate[]> {+ return await clockifyClient.request<ClockifyTemplate[]>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/templates`,+ query,+ });+}++async function getTemplate({+ auth,+ workspaceId,+ templateId,+ query,+}: WorkspaceScope & {+ auth: ClockifyAuthValue;+ templateId: string;+ query: QueryParams;+}): Promise<ClockifyTemplate> {+ return await clockifyClient.request<ClockifyTemplate>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/templates/${templateId}`,+ query,+ });+}++async function createTemplates({+ auth,+ workspaceId,+ templates,+}: WorkspaceScope & { auth: ClockifyAuthValue; templates: TemplateInput[] }): Promise<+ ClockifyTemplate[]+> {+ return await clockifyClient.request<ClockifyTemplate[]>({+ auth,+ method: HttpMethod.POST,+ path: `/workspaces/${workspaceId}/templates`,+ body: templates,+ });+}++async function renameTemplate({+ auth,+ workspaceId,+ templateId,+ name,+}: WorkspaceScope & {+ auth: ClockifyAuthValue;+ templateId: string;+ name: string;+}): Promise<ClockifyTemplate> {+ return await clockifyClient.request<ClockifyTemplate>({+ auth,+ method: HttpMethod.PATCH,+ path: `/workspaces/${workspaceId}/templates/${templateId}`,+ body: { name },+ });+}++async function deleteTemplate({+ auth,+ workspaceId,+ templateId,+}: WorkspaceScope & { auth: ClockifyAuthValue; templateId: string }): Promise<ClockifyTemplate> {+ return await clockifyClient.request<ClockifyTemplate>({+ auth,+ method: HttpMethod.DELETE,+ path: `/workspaces/${workspaceId}/templates/${templateId}`,+ });+}++async function listHolidays({+ auth,+ workspaceId,+ query,+}: WorkspaceScope & { auth: ClockifyAuthValue; query: QueryParams }): Promise<ClockifyHoliday[]> {+ return await clockifyClient.request<ClockifyHoliday[]>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/holidays`,+ query,+ });+}++async function listHolidaysInPeriod({+ auth,+ workspaceId,+ query,+}: WorkspaceScope & { auth: ClockifyAuthValue; query: QueryParams }): Promise<ClockifyHoliday[]> {+ return await clockifyClient.request<ClockifyHoliday[]>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/holidays/in-period`,+ query,+ });+}++async function createHoliday({+ auth,+ workspaceId,+ holiday,+}: WorkspaceScope & { auth: ClockifyAuthValue; holiday: HolidayInput }): Promise<ClockifyHoliday> {+ return await clockifyClient.request<ClockifyHoliday>({+ auth,+ method: HttpMethod.POST,+ path: `/workspaces/${workspaceId}/holidays`,+ body: holiday,+ });+}++async function updateHoliday({+ auth,+ workspaceId,+ holidayId,+ holiday,+}: WorkspaceScope & {+ auth: ClockifyAuthValue;+ holidayId: string;+ holiday: HolidayInput;+}): Promise<ClockifyHoliday> {+ return await clockifyClient.request<ClockifyHoliday>({+ auth,+ method: HttpMethod.PUT,+ path: `/workspaces/${workspaceId}/holidays/${holidayId}`,+ body: holiday,+ });+}++async function deleteHoliday({+ auth,+ workspaceId,+ holidayId,+}: WorkspaceScope & { auth: ClockifyAuthValue; holidayId: string }): Promise<ClockifyHoliday> {+ return await clockifyClient.request<ClockifyHoliday>({+ auth,+ method: HttpMethod.DELETE,+ path: `/workspaces/${workspaceId}/holidays/${holidayId}`,+ });+}++async function listCreatedEntities({+ auth,+ workspaceId,+ query,+}: WorkspaceScope & {+ auth: ClockifyAuthValue;+ query: QueryParams;+}): Promise<unknown> {+ return await clockifyClient.request<unknown>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/entities/created`,+ query,+ });+}++async function listAssignments({+ auth,+ workspaceId,+ query,+}: WorkspaceScope & { auth: ClockifyAuthValue; query: QueryParams }): Promise<+ ClockifyAssignment[]+> {+ return await clockifyClient.request<ClockifyAssignment[]>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/scheduling/assignments/all`,+ query,+ });+}++async function listCustomFields({+ auth,+ workspaceId,+ query,+}: WorkspaceScope & { auth: ClockifyAuthValue; query: QueryParams }): Promise<+ ClockifyCustomField[]+> {+ return await clockifyClient.request<ClockifyCustomField[]>({+ auth,+ method: HttpMethod.GET,+ path: `/workspaces/${workspaceId}/custom-fields`,+ query,+ });+}++export const clockifyApi = {+ getCurrentUser,+ listWorkspaces,+ listProjects,+ listUsers,+ listTags,+ listTasks,+ createTask,+ createTimeEntry,+ listInProgressTimeEntries,+ listUserTimeEntries,+ stopUserTimer,+ createWebhook,+ deleteWebhook,+ getWorkspace,+ createWorkspace,+ updateWorkspaceBillableRate,+ updateWorkspaceCostRate,+ filterUsers,+ updateUserStatus,+ updateUserBillableRate,+ updateUserCostRate,+ updateUserCustomField,+ listUserManagers,+ addUserRole,+ removeUserRole,+ getMemberProfile,+ updateMemberProfile,+ listUserGroups,+ createUserGroup,+ updateUserGroup,+ deleteUserGroup,+ addUserToGroup,+ removeUserFromGroup,+ listClients,+ getClient,+ createClient,+ updateClient,+ deleteClient,+ getTag,+ createTag,+ updateTag,+ deleteTag,+ getProject,+ createProject,+ createProjectFromTemplate,+ updateProject,+ deleteProject,+ replaceProjectMemberships,+ assignProjectUsers,+ updateProjectUserBillableRate,+ updateProjectUserCostRate,+ updateProjectEstimate,+ updateProjectTemplate,+ listProjectCustomFields,+ getTask,+ updateTask,+ deleteTask,+ updateTaskBillableRate,+ updateTaskCostRate,+ createUserTimeEntry,+ getTimeEntry,+ getTimeEntriesByIds,+ updateTimeEntry,+ bulkUpdateTimeEntries,+ deleteTimeEntry,+ bulkDeleteTimeEntries,+ duplicateTimeEntry,+ markTimeEntriesInvoiced,+ generateReport,+ listSharedReports,+ getSharedReport,+ createSharedReport,+ updateSharedReport,+ deleteSharedReport,+ listTemplates,+ getTemplate,+ createTemplates,+ renameTemplate,+ deleteTemplate,+ listHolidays,+ listHolidaysInPeriod,+ createHoliday,+ updateHoliday,+ deleteHoliday,+ listCreatedEntities,+ listAssignments,+ listCustomFields,+};++type CreateTaskParams = {+ workspaceId: string;+ projectId: string;+ name: string;+ status?: string;+ assigneeIds: string[];+ estimate?: string;+ userGroupIds?: string[];+};++type CreateTimeEntryParams = {+ workspaceId: string;+ billable?: boolean;+ description?: string;+ start: string;+ end?: string;+ projectId?: string;+ taskId?: string;+ tagIds: string[];+};++type CreateWebhookParams = {+ workspaceId: string;+ url: string;+ webhookEvent: string;+ triggerSourceType?: string;+ triggerSource?: string[];+};++type WorkspaceScope = { workspaceId: string };++type UserScope = WorkspaceScope & { userId: string };++type ProjectScope = WorkspaceScope & { projectId: string };++type TimeEntryScope = WorkspaceScope & { timeEntryId: string };++type UserGroupScope = WorkspaceScope & { userGroupId: string };++type RateParams = { amount: number; since?: string; includeApproved?: boolean };++type RoleParams = { role: string; entityId: string; sourceType?: string };++type UserFilter = {+ email?: string;+ name?: string;+ status?: string;+ projectId?: string;+ userGroups?: string[];+ roles?: string[];+ includeRoles?: boolean;+ sortColumn?: string;+ sortOrder?: string;+ page: number;+ pageSize: number;+};++type MemberProfileChanges = {+ name?: string;+ weekStart?: string;+ workCapacity?: string;+ workingDays?: string[];+};++type ProjectFromTemplateInput = {+ name: string;+ templateProjectId: string;+ clientId?: string;+ color?: string;+ isPublic?: boolean;+};++type ProjectEstimateInput = {+ timeEstimate?: {+ active: boolean;+ estimate?: string;+ type: string;+ resetOption?: string;+ includeNonBillable?: boolean;+ };+ budgetEstimate?: { active: boolean; estimate?: number; type: string; resetOption?: string };+};++type ReportKind = 'detailed' | 'summary' | 'weekly' | 'attendance' | 'expenses/detailed';++type TemplateInput = {+ name: string;+ projectsAndTasks: { projectId: string; taskId?: string }[];+ weekStart?: string;+};++type HolidayInput = {+ name: string;+ datePeriod: { startDate: string; endDate: string };+ occursAnnually: boolean;+ everyoneIncludingNew: boolean;+ users?: ClockifyEntityFilter;+ userGroups?: ClockifyEntityFilter;+ automaticTimeEntryCreation?: unknown;+};diff --git a/packages/pieces/community/clockify/src/lib/common/client.ts b/packages/pieces/community/clockify/src/lib/common/client.tsindex f203ff79fa8..614f54cde42 100644--- a/packages/pieces/community/clockify/src/lib/common/client.ts+++ b/packages/pieces/community/clockify/src/lib/common/client.ts@@ -1,48 +1,41 @@-import {- httpClient,- HttpMessageBody,- HttpMethod,- HttpRequest,- QueryParams,-} from '@activepieces/pieces-common';+import { httpClient, HttpMethod, QueryParams } from '@activepieces/pieces-common';+import type { ClockifyAuthValue } from './types';-export type ClockifyApiCallParams = {- apiKey: string;- method: HttpMethod;- resourceUri: string;- query?: Record<string, string | number | string[] | undefined>;- body?: any;-};--export const BASE_URL = 'https://api.clockify.me/api/v1';+function baseUrl(): string {+ return HOSTS.api;+}-export async function clockifyApiCall<T extends HttpMessageBody>({- apiKey,+async function request<T>({+ auth,method,- resourceUri,+ path,query,body,-}: ClockifyApiCallParams): Promise<T> {- const qs: QueryParams = {};-- if (query) {- for (const [key, value] of Object.entries(query)) {- if (value !== null && value !== undefined) {- qs[key] = String(value);- }- }- }-- const request: HttpRequest = {+ host = 'api',+}: RequestParams & { auth: ClockifyAuthValue }): Promise<T> {+ const response = await httpClient.sendRequest<T>({method,- url: BASE_URL + resourceUri,+ url: `${HOSTS[host]}${path}`,headers: {- 'X-Api-Key': apiKey,+ 'X-Api-Key': auth.secret_text,},- queryParams: qs,+ queryParams: query ?? {},body,- };-- const response = await httpClient.sendRequest<T>(request);+ });return response.body;}++export const clockifyClient = { baseUrl, request };++const HOSTS = {+ api: 'https://api.clockify.me/api/v1',+ reports: 'https://reports.api.clockify.me/v1',+};++type RequestParams = {+ method: HttpMethod;+ path: string;+ query?: QueryParams;+ body?: unknown;+ host?: keyof typeof HOSTS;+};diff --git a/packages/pieces/community/clockify/src/lib/common/props.ts b/packages/pieces/community/clockify/src/lib/common/props.tsindex 86b44ee1abd..c8c6dab359b 100644--- a/packages/pieces/community/clockify/src/lib/common/props.ts+++ b/packages/pieces/community/clockify/src/lib/common/props.ts@@ -1,209 +1,209 @@-import { HttpMethod } from '@activepieces/pieces-common';-import { Property } from '@activepieces/pieces-framework';-import { clockifyApiCall } from './client';+import { DropdownState, Property } from '@activepieces/pieces-framework';import { clockifyAuth } from '../auth';--interface DropdownParams {- displayName: string;- description?: string;- required: boolean;-}--export const workspaceId = (params: DropdownParams) =>- Property.Dropdown({+import { clockifyApi } from './api';++function workspaceId<R extends boolean>({+ required,+ displayName = 'Workspace',+ description,+}: PropParams<R>) {+ return Property.Dropdown({auth: clockifyAuth,- displayName: params.displayName,- description: params.description,- required: params.required,+ displayName,+ description,+ required,refreshers: [],options: async ({ auth }) => {if (!auth) {- return {- disabled: true,- options: [],+ return disabledOptions({placeholder: 'Please connect your account first.',- };+ });}- const response = await clockifyApiCall<{ id: string; name: string }[]>({- apiKey: auth.secret_text,- method: HttpMethod.GET,- resourceUri: '/workspaces',- });+ const workspaces = await clockifyApi.listWorkspaces({ auth });return {disabled: false,- options: response.map((workspace) => ({+ options: workspaces.map((workspace) => ({label: workspace.name,value: workspace.id,})),};},});+}-export const projectId = (params: DropdownParams) =>- Property.Dropdown({+function projectId<R extends boolean>({+ required,+ displayName = 'Project',+ description,+}: PropParams<R>) {+ return Property.Dropdown({auth: clockifyAuth,- displayName: params.displayName,- description: params.description,- required: params.required,+ displayName,+ description,+ required,refreshers: ['workspaceId'],options: async ({ auth, workspaceId }) => {if (!auth) {- return {- disabled: true,- options: [],+ return disabledOptions({placeholder: 'Please connect your account first.',- };+ });}if (!workspaceId) {- return {- disabled: true,- options: [],+ return disabledOptions({placeholder: 'Please select workspace first.',- };+ });}- const response = await clockifyApiCall<{ id: string; name: string }[]>({- apiKey: auth.secret_text,- method: HttpMethod.GET,- resourceUri: `/workspaces/${workspaceId}/projects`,+ const projects = await clockifyApi.listProjects({+ auth,+ workspaceId: String(workspaceId),});return {disabled: false,- options: response.map((project) => ({+ options: projects.map((project) => ({label: project.name,value: project.id,})),};},});+}-export const assigneeIds = (params: DropdownParams) =>- Property.MultiSelectDropdown({+function assigneeIds<R extends boolean>({+ required,+ displayName = 'Assignee',+ description,+}: PropParams<R>) {+ return Property.MultiSelectDropdown({auth: clockifyAuth,- displayName: params.displayName,- description: params.description,- required: params.required,+ displayName,+ description,+ required,refreshers: ['workspaceId'],options: async ({ auth, workspaceId }) => {if (!auth) {- return {- disabled: true,- options: [],+ return disabledOptions({placeholder: 'Please connect your account first.',- };+ });}if (!workspaceId) {- return {- disabled: true,- options: [],+ return disabledOptions({placeholder: 'Please select workspace first.',- };+ });}- const response = await clockifyApiCall<{ id: string; email: string }[]>({- apiKey: auth.secret_text,- method: HttpMethod.GET,- resourceUri: `/workspaces/${workspaceId}/users`,+ const users = await clockifyApi.listUsers({+ auth,+ workspaceId: String(workspaceId),});return {disabled: false,- options: response.map((user) => ({+ options: users.map((user) => ({label: user.email,value: user.id,})),};},});+}-export const taskId = (params: DropdownParams) =>- Property.Dropdown({+function taskId<R extends boolean>({ required, displayName = 'Task', description }: PropParams<R>) {+ return Property.Dropdown({auth: clockifyAuth,- displayName: params.displayName,- description: params.description,- required: params.required,+ displayName,+ description,+ required,refreshers: ['workspaceId', 'projectId'],options: async ({ auth, workspaceId, projectId }) => {if (!auth) {- return {- disabled: true,- options: [],+ return disabledOptions({placeholder: 'Please connect your account first.',- };+ });}if (!workspaceId) {- return {- disabled: true,- options: [],+ return disabledOptions({placeholder: 'Please select workspace first.',- };+ });}if (!projectId) {- return {- disabled: true,- options: [],- placeholder: 'Please select project first.',- };+ return disabledOptions({ placeholder: 'Please select project first.' });}- const response = await clockifyApiCall<{ id: string; name: string }[]>({- apiKey: auth.secret_text,- method: HttpMethod.GET,- resourceUri: `/workspaces/${workspaceId}/projects/${projectId}/tasks`,+ const tasks = await clockifyApi.listTasks({+ auth,+ workspaceId: String(workspaceId),+ projectId: String(projectId),});return {disabled: false,- options: response.map((task) => ({+ options: tasks.map((task) => ({label: task.name,value: task.id,})),};},});+}-export const tagIds = (params: DropdownParams) =>- Property.MultiSelectDropdown({+function tagIds<R extends boolean>({ required, displayName = 'Tags', description }: PropParams<R>) {+ return Property.MultiSelectDropdown({auth: clockifyAuth,- displayName: params.displayName,- description: params.description,- required: params.required,+ displayName,+ description,+ required,refreshers: ['workspaceId'],options: async ({ auth, workspaceId }) => {if (!auth) {- return {- disabled: true,- options: [],+ return disabledOptions({placeholder: 'Please connect your account first.',- };+ });}if (!workspaceId) {- return {- disabled: true,- options: [],+ return disabledOptions({placeholder: 'Please select workspace first.',- };+ });}- const response = await clockifyApiCall<{ id: string; name: string }[]>({- apiKey: auth.secret_text,- method: HttpMethod.GET,- resourceUri: `/workspaces/${workspaceId}/tags`,++ const tags = await clockifyApi.listTags({+ auth,+ workspaceId: String(workspaceId),});return {disabled: false,- options: response.map((tag) => ({+ options: tags.map((tag) => ({label: tag.name,value: tag.id,})),};},});+}++function disabledOptions({ placeholder }: { placeholder: string }): DropdownState<never> {+ return { disabled: true, options: [], placeholder };+}++export const clockifyProps = {+ workspaceId,+ projectId,+ assigneeIds,+ taskId,+ tagIds,+};++export type PropParams<R extends boolean> = {+ required: R;+ displayName?: string;+ description?: string;+};diff --git a/packages/pieces/community/clockify/src/lib/common/types.ts b/packages/pieces/community/clockify/src/lib/common/types.tsnew file mode 100644index 00000000000..e02fb5382a4--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/common/types.ts@@ -0,0 +1,164 @@+import type { AppConnectionType } from '@activepieces/pieces-framework';++export type ClockifyAuthValue = { type: AppConnectionType.SECRET_TEXT; secret_text: string };++export type ClockifyUser = {+ id: string;+ email: string;+ name?: string;+ activeWorkspace?: string;+};+export type ClockifyWorkspace = {+ id: string;+ name: string;+ cakeOrganizationId?: string;+};+export type ClockifyProject = {+ id: string;+ name: string;+ clientId?: string;+ color?: string;+ note?: string;+ billable?: boolean;+ archived?: boolean;+ public?: boolean;+};+export type ClockifyTask = {+ id: string;+ name: string;+ projectId?: string;+ status?: string;+ assigneeIds?: string[];+ userGroupIds?: string[];+ estimate?: string;+ billable?: boolean;+ budgetEstimate?: number;+};+export type ClockifyTag = { id: string; name: string; archived?: boolean };+export type ClockifyTimeEntry = {+ id: string;+ description?: string;+ userId?: string;+ projectId?: string;+ taskId?: string;+ tagIds?: string[];+ billable?: boolean;+ type?: string;+ timeInterval?: { start: string; end?: string };+ customFieldValues?: { customFieldId: string; value?: unknown }[];+};+export type ClockifyWebhook = { id: string };+export type ClockifyMemberProfile = {+ email?: string;+ name?: string;+ weekStart?: string;+ workCapacity?: string;+};+export type ClockifyRole = { role: string; userId: string; workspaceId: string };+export type ClockifyUserCustomFieldValue = {+ customFieldId: string;+ userId: string;+ value?: unknown;+};+export type ClockifyUserGroup = { id: string; name: string; userIds?: string[] };+export type ClockifyClient = {+ id: string;+ name: string;+ email?: string;+ address?: string;+ note?: string;+ archived?: boolean;+ currencyId?: string;+ ccEmails?: string[];+};+export type ClockifyClientInput = Omit<ClockifyClient, 'id'>;+export type ClockifyProjectInput = {+ name: string;+ clientId?: string;+ color?: string;+ note?: string;+ billable?: boolean;+ archived?: boolean;+ isPublic?: boolean;+ hourlyRate?: { amount: number };+};+export type ClockifyTaskInput = Omit<ClockifyTask, 'id' | 'projectId'>;+export type ClockifyCustomField = { id: string; name: string; type?: string; status?: string };+export type ClockifyTimeEntryInput = {+ start: string;+ end?: string;+ description?: string;+ projectId?: string;+ taskId?: string;+ tagIds?: string[];+ billable?: boolean;+ type?: string;+ customFields?: { customFieldId: string; value?: unknown }[];+};+export type ClockifyEntityFilter = {+ ids: string[];+ contains: 'CONTAINS' | 'DOES_NOT_CONTAIN';+ status: 'ALL';+};+export type ClockifyReportRequest = {+ dateRangeStart: string;+ dateRangeEnd: string;+ exportType: 'JSON';+ projects?: ClockifyEntityFilter;+ users?: ClockifyEntityFilter;+ clients?: ClockifyEntityFilter;+ tags?: ClockifyEntityFilter;+ userGroups?: ClockifyEntityFilter;+ billable?: boolean;+ description?: string;+ timeZone?: string;+ detailedFilter?: { page: number; pageSize: number; sortColumn: string };+ summaryFilter?: { groups: string[] };+ weeklyFilter?: { group: string; subgroup: string };+ attendanceFilter?: { page: number; pageSize: number };+ page?: number;+ pageSize?: number;+};+export type ClockifyReport = { totals?: unknown[] };+export type ClockifySharedReport = {+ id: string;+ name: string;+ type?: string;+ isPublic?: boolean;+ fixedDate?: boolean;+ visibleToUsers?: string[];+ visibleToUserGroups?: string[];+};+export type ClockifySharedReportInput = {+ name: string;+ type: string;+ isPublic?: boolean;+ fixedDate?: boolean;+ visibleToUsers?: string[];+ visibleToUserGroups?: string[];+ filter: ClockifyReportRequest;+};+export type ClockifySharedReportUpdate = Omit<ClockifySharedReport, 'id' | 'type'>;+export type ClockifySharedReportListItem = Omit<+ ClockifySharedReport,+ 'visibleToUsers' | 'visibleToUserGroups'+> & {+ visibleToUsers?: { id: string }[];+ visibleToUserGroups?: { id: string }[];+};+export type ClockifySharedReportPage = {+ count?: number;+ reports?: ClockifySharedReportListItem[];+};+export type ClockifyTemplate = { id: string; name: string };+export type ClockifyHoliday = {+ id: string;+ name: string;+ datePeriod: { startDate: string; endDate: string };+ occursAnnually?: boolean;+ everyoneIncludingNew?: boolean;+ userIds?: string[];+ userGroupIds?: string[];+ automaticTimeEntryCreation?: unknown;+};+export type ClockifyAssignment = { id: string; userId?: string; projectId?: string };diff --git a/packages/pieces/community/clockify/src/lib/common/utils.ts b/packages/pieces/community/clockify/src/lib/common/utils.tsnew file mode 100644index 00000000000..8d630798e93--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/common/utils.ts@@ -0,0 +1,34 @@+import type { QueryParams } from '@activepieces/pieces-common';++import type { ClockifyEntityFilter } from './types';++function toQuery({+ params,+}: {+ params: Record<string, string | number | boolean | undefined>;+}): QueryParams {+ return Object.fromEntries(+ Object.entries(params)+ .filter(+ (entry): entry is [string, string | number | boolean] =>+ entry[1] !== undefined && entry[1] !== '',+ )+ .map(([key, value]) => [key, String(value)]),+ );+}++function toOptionalBoolean({ value }: { value: string | undefined }): boolean | undefined {+ return value === undefined ? undefined : value === 'true';+}++function nonEmptyIds({ values }: { values: unknown[] | undefined }): string[] | undefined {+ return values && values.length > 0 ? values.map(String) : undefined;+}++function entityFilter({ ids }: { ids: unknown[] | undefined }): ClockifyEntityFilter | undefined {+ return ids && ids.length > 0+ ? { ids: ids.map(String), contains: 'CONTAINS', status: 'ALL' }+ : undefined;+}++export const clockifyUtils = { toQuery, toOptionalBoolean, nonEmptyIds, entityFilter };diff --git a/packages/pieces/community/clockify/src/lib/output-schemas.ts b/packages/pieces/community/clockify/src/lib/output-schemas.tsnew file mode 100644index 00000000000..78fb26907ba--- /dev/null+++ b/packages/pieces/community/clockify/src/lib/output-schemas.ts@@ -0,0 +1,851 @@+import { OutputSchema } from '@activepieces/pieces-framework';++const rateFields: OutputSchema['fields'] = [+ { key: 'amount', label: 'Amount (Cents)', format: 'number' },+ { key: 'currency', label: 'Currency' },+];++const timeIntervalFields: OutputSchema['fields'] = [+ { key: 'start', label: 'Start', format: 'datetime' },+ { key: 'end', label: 'End', format: 'datetime' },+ { key: 'duration', label: 'Duration', format: 'duration' },+ { key: 'zonedStart', label: 'Zoned Start' },+ { key: 'zonedEnd', label: 'Zoned End' },+ { key: 'timeZone', label: 'Time Zone' },+];++const baseTimeEntryFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Time Entry ID' },+ { key: 'description', label: 'Description' },+ { key: 'userId', label: 'User ID' },+ { key: 'workspaceId', label: 'Workspace ID' },+ { key: 'projectId', label: 'Project ID' },+ { key: 'taskId', label: 'Task ID' },+ { key: 'tagIds', label: 'Tag IDs' },+ { key: 'billable', label: 'Billable', format: 'boolean' },+ { key: 'isLocked', label: 'Locked', format: 'boolean' },+ { key: 'type', label: 'Type' },+ { key: 'timeInterval', label: 'Time Interval', children: timeIntervalFields },+ { key: 'customFieldValues', label: 'Custom Field Values' },+];++const timeEntryFields: OutputSchema['fields'] = [+ ...baseTimeEntryFields,+ { key: 'hourlyRate', label: 'Billable Rate', children: rateFields },+ { key: 'costRate', label: 'Cost Rate', children: rateFields },+];++const projectSummaryFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Project ID' },+ { key: 'name', label: 'Project Name' },+ { key: 'clientId', label: 'Client ID' },+ { key: 'clientName', label: 'Client Name' },+ { key: 'color', label: 'Color' },+ { key: 'billable', label: 'Billable', format: 'boolean' },+];++const userSummaryFields: OutputSchema['fields'] = [+ { key: 'id', label: 'User ID' },+ { key: 'name', label: 'Name' },+ { key: 'email', label: 'Email', format: 'email' },+];++const hydratedTimeEntryFields: OutputSchema['fields'] = [+ ...timeEntryFields,+ { key: 'project', label: 'Project', children: projectSummaryFields },+ {+ key: 'task',+ label: 'Task',+ children: [+ { key: 'id', label: 'Task ID' },+ { key: 'name', label: 'Task Name' },+ { key: 'status', label: 'Status' },+ ],+ },+ {+ key: 'tags',+ label: 'Tags',+ labelKey: 'name',+ listItems: [+ { key: 'id', label: 'Tag ID' },+ { key: 'name', label: 'Name' },+ ],+ },+ { key: 'user', label: 'User', children: userSummaryFields },+];++const webhookTimeEntryFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Time Entry ID' },+ { key: 'description', label: 'Description' },+ { key: 'userId', label: 'User ID' },+ { key: 'workspaceId', label: 'Workspace ID' },+ { key: 'projectId', label: 'Project ID' },+ { key: 'billable', label: 'Billable', format: 'boolean' },+ { key: 'isLocked', label: 'Locked', format: 'boolean' },+ { key: 'currentlyRunning', label: 'Currently Running', format: 'boolean' },+ { key: 'type', label: 'Type' },+ { key: 'timeInterval', label: 'Time Interval', children: timeIntervalFields },+ { key: 'hourlyRate', label: 'Billable Rate (Cents)', format: 'number' },+ { key: 'costRate', label: 'Cost Rate (Cents)', format: 'number' },+ { key: 'project', label: 'Project', children: projectSummaryFields },+ {+ key: 'user',+ label: 'User',+ children: [+ { key: 'id', label: 'User ID' },+ { key: 'name', label: 'Name' },+ { key: 'status', label: 'Status' },+ ],+ },+ { key: 'tags', label: 'Tags' },+];++const membershipFields: OutputSchema['fields'] = [+ { key: 'userId', label: 'User ID' },+ { key: 'targetId', label: 'Target ID' },+ { key: 'membershipType', label: 'Membership Type' },+ { key: 'membershipStatus', label: 'Membership Status' },+ { key: 'hourlyRate', label: 'Billable Rate', children: rateFields },+ { key: 'costRate', label: 'Cost Rate', children: rateFields },+];++const estimateFields: OutputSchema['fields'] = [+ { key: 'estimate', label: 'Estimate' },+ { key: 'type', label: 'Type' },+ { key: 'resetOption', label: 'Reset Option' },+ { key: 'active', label: 'Active', format: 'boolean' },+];++const projectFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Project ID' },+ { key: 'name', label: 'Name' },+ { key: 'workspaceId', label: 'Workspace ID' },+ { key: 'clientId', label: 'Client ID' },+ { key: 'clientName', label: 'Client Name' },+ { key: 'color', label: 'Color' },+ { key: 'note', label: 'Note' },+ { key: 'billable', label: 'Billable', format: 'boolean' },+ { key: 'public', label: 'Public', format: 'boolean' },+ { key: 'archived', label: 'Archived', format: 'boolean' },+ { key: 'template', label: 'Template', format: 'boolean' },+ { key: 'duration', label: 'Tracked Duration', format: 'duration' },+ { key: 'hourlyRate', label: 'Billable Rate', children: rateFields },+ { key: 'costRate', label: 'Cost Rate', children: rateFields },+ { key: 'timeEstimate', label: 'Time Estimate', children: estimateFields },+ { key: 'budgetEstimate', label: 'Budget Estimate', children: estimateFields },+ {+ key: 'memberships',+ label: 'Members',+ labelKey: 'userId',+ listItems: membershipFields,+ },+];++const taskFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Task ID' },+ { key: 'name', label: 'Name' },+ { key: 'projectId', label: 'Project ID' },+ { key: 'status', label: 'Status' },+ { key: 'assigneeIds', label: 'Assignee IDs' },+ { key: 'userGroupIds', label: 'User Group IDs' },+ { key: 'estimate', label: 'Estimate', format: 'duration' },+ { key: 'budgetEstimate', label: 'Budget Estimate (Cents)', format: 'number' },+ { key: 'duration', label: 'Tracked Duration', format: 'duration' },+ { key: 'billable', label: 'Billable', format: 'boolean' },+ { key: 'hourlyRate', label: 'Billable Rate', children: rateFields },+ { key: 'costRate', label: 'Cost Rate', children: rateFields },+];++const tagFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Tag ID' },+ { key: 'name', label: 'Name' },+ { key: 'workspaceId', label: 'Workspace ID' },+ { key: 'archived', label: 'Archived', format: 'boolean' },+];++const clientFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Client ID' },+ { key: 'name', label: 'Name' },+ { key: 'email', label: 'Email', format: 'email' },+ { key: 'address', label: 'Address' },+ { key: 'note', label: 'Note' },+ { key: 'archived', label: 'Archived', format: 'boolean' },+ { key: 'workspaceId', label: 'Workspace ID' },+ { key: 'currencyId', label: 'Currency ID' },+];++const clientWithCurrencyFields: OutputSchema['fields'] = [+ ...clientFields,+ { key: 'currencyCode', label: 'Currency' },+];++const userGroupFields: OutputSchema['fields'] = [+ { key: 'id', label: 'User Group ID' },+ { key: 'name', label: 'Name' },+ { key: 'workspaceId', label: 'Workspace ID' },+ { key: 'userIds', label: 'User IDs' },+ { key: 'teamManagers', label: 'Team Managers' },+];++const userFields: OutputSchema['fields'] = [+ { key: 'id', label: 'User ID' },+ { key: 'name', label: 'Name' },+ { key: 'email', label: 'Email', format: 'email' },+ { key: 'status', label: 'Status' },+ { key: 'profilePicture', label: 'Profile Picture', format: 'image' },+ { key: 'activeWorkspace', label: 'Active Workspace ID' },+ { key: 'defaultWorkspace', label: 'Default Workspace ID' },+ {+ key: 'settings',+ label: 'Settings',+ children: [+ { key: 'timeZone', label: 'Time Zone' },+ { key: 'weekStart', label: 'Week Start' },+ { key: 'dateFormat', label: 'Date Format' },+ { key: 'timeFormat', label: 'Time Format' },+ { key: 'lang', label: 'Language' },+ ],+ },+ { key: 'memberships', label: 'Memberships' },+ { key: 'customFields', label: 'Custom Fields' },+];++const workspaceFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Workspace ID' },+ { key: 'name', label: 'Name' },+ { key: 'imageUrl', label: 'Image URL', format: 'image' },+ { key: 'featureSubscriptionType', label: 'Plan' },+ { key: 'cakeOrganizationId', label: 'Organization ID' },+ { key: 'hourlyRate', label: 'Billable Rate', children: rateFields },+ { key: 'costRate', label: 'Cost Rate', children: rateFields },+ {+ key: 'memberships',+ label: 'Members',+ labelKey: 'userId',+ listItems: membershipFields,+ },+ { key: 'currencies', label: 'Currencies' },+ {+ key: 'subdomain',+ label: 'Subdomain',+ children: [+ { key: 'name', label: 'Name' },+ { key: 'enabled', label: 'Enabled', format: 'boolean' },+ ],+ },+ {+ key: 'workspaceSettings',+ label: 'Settings',+ children: [+ { key: 'timeTrackingMode', label: 'Time Tracking Mode' },+ { key: 'activeBillableHours', label: 'Billable Hours On', format: 'boolean' },+ { key: 'taskRateEnabled', label: 'Task Rates On', format: 'boolean' },+ { key: 'timeApprovalEnabled', label: 'Time Approval On', format: 'boolean' },+ { key: 'forceProjects', label: 'Project Required', format: 'boolean' },+ { key: 'forceTasks', label: 'Task Required', format: 'boolean' },+ { key: 'forceTags', label: 'Tag Required', format: 'boolean' },+ { key: 'forceDescription', label: 'Description Required', format: 'boolean' },+ { key: 'trackTimeDownToSecond', label: 'Track To The Second', format: 'boolean' },+ { key: 'invoicingEnabled', label: 'Invoicing On', format: 'boolean' },+ { key: 'expensesEnabled', label: 'Expenses On', format: 'boolean' },+ { key: 'schedulingEnabled', label: 'Scheduling On', format: 'boolean' },+ { key: 'kioskEnabled', label: 'Kiosk On', format: 'boolean' },+ ],+ },+];++const holidayFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Holiday ID' },+ { key: 'name', label: 'Name' },+ { key: 'workspaceId', label: 'Workspace ID' },+ {+ key: 'datePeriod',+ label: 'Date Period',+ children: [+ { key: 'startDate', label: 'Start Date', format: 'date' },+ { key: 'endDate', label: 'End Date', format: 'date' },+ ],+ },+ { key: 'occursAnnually', label: 'Occurs Annually', format: 'boolean' },+ { key: 'everyoneIncludingNew', label: 'Everyone', format: 'boolean' },+ { key: 'userIds', label: 'User IDs' },+ { key: 'userGroupIds', label: 'User Group IDs' },+];++const templateFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Template ID' },+ { key: 'name', label: 'Name' },+ { key: 'userId', label: 'User ID' },+ { key: 'workspaceId', label: 'Workspace ID' },+ { key: 'entries', label: 'Entries' },+];++const templateRowFields: OutputSchema['fields'] = [+ { key: 'projectId', label: 'Project ID' },+ { key: 'taskId', label: 'Task ID' },+];++const hydratedTemplateRowFields: OutputSchema['fields'] = [+ { key: 'type', label: 'Type' },+ { key: 'project', label: 'Project', children: projectSummaryFields },+ { key: 'task', label: 'Task' },+];++const entityFilterFields: OutputSchema['fields'] = [+ { key: 'ids', label: 'IDs' },+ { key: 'contains', label: 'Contains' },+ { key: 'status', label: 'Status' },+];++const sharedReportFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Shared Report ID' },+ { key: 'name', label: 'Name' },+ { key: 'type', label: 'Type' },+ { key: 'workspaceId', label: 'Workspace ID' },+ { key: 'userId', label: 'Author ID' },+ { key: 'isPublic', label: 'Public', format: 'boolean' },+ { key: 'fixedDate', label: 'Fixed Date', format: 'boolean' },+ { key: 'visibleToUsers', label: 'Visible To Users' },+ { key: 'visibleToUserGroups', label: 'Visible To User Groups' },+ {+ key: 'filter',+ label: 'Filter',+ children: [+ { key: 'dateRangeStart', label: 'From', format: 'datetime' },+ { key: 'dateRangeEnd', label: 'To', format: 'datetime' },+ { key: 'users', label: 'Users', children: entityFilterFields },+ { key: 'projects', label: 'Projects', children: entityFilterFields },+ { key: 'exportType', label: 'Export Type' },+ { key: 'timeZone', label: 'Time Zone' },+ ],+ },+];++const reportTotalFields: OutputSchema['fields'] = [+ { key: 'totalTime', label: 'Total Time', format: 'duration' },+ { key: 'totalBillableTime', label: 'Billable Time', format: 'duration' },+ { key: 'entriesCount', label: 'Entries', format: 'number' },+ { key: 'totalAmount', label: 'Total Amount (Cents)', format: 'number' },+ { key: 'numOfCurrencies', label: 'Currencies', format: 'number' },+];++const reportGroupFields: OutputSchema['fields'] = [+ { key: '_id', label: 'ID' },+ { key: 'name', label: 'Name' },+ { key: 'duration', label: 'Duration', format: 'duration' },+ { key: 'color', label: 'Color' },+ { key: 'clientName', label: 'Client Name' },+ { key: 'amounts', label: 'Amounts' },+];++const summaryReportFields: OutputSchema['fields'] = [+ { key: 'totals', label: 'Totals', listItems: reportTotalFields },+ {+ key: 'groupOne',+ label: 'Groups',+ labelKey: 'name',+ listItems: reportGroupFields,+ },+];++const customFieldFields: OutputSchema['fields'] = [+ { key: 'id', label: 'Custom Field ID' },+ { key: 'name', label: 'Name' },+ { key: 'type', label: 'Type' },+ { key: 'entityType', label: 'Applies To' },+ { key: 'status', label: 'Status' },+ { key: 'required', label: 'Required', format: 'boolean' },+ { key: 'onlyAdminCanEdit', label: 'Only Admins Can Edit', format: 'boolean' },+ { key: 'placeholder', label: 'Placeholder' },+ { key: 'allowedValues', label: 'Allowed Values' },+ { key: 'workspaceDefaultValue', label: 'Default Value' },+ { key: 'workspaceId', label: 'Workspace ID' },+];++const detailedTimeEntryFields: OutputSchema['fields'] = [+ { key: '_id', label: 'Time Entry ID' },+ { key: 'description', label: 'Description' },+ { key: 'userId', label: 'User ID' },+ { key: 'userName', label: 'User Name' },+ { key: 'userEmail', label: 'User Email', format: 'email' },+ { key: 'projectId', label: 'Project ID' },+ { key: 'projectName', label: 'Project Name' },+ { key: 'clientId', label: 'Client ID' },+ { key: 'clientName', label: 'Client Name' },+ { key: 'taskId', label: 'Task ID' },+ { key: 'taskName', label: 'Task Name' },+ { key: 'billable', label: 'Billable', format: 'boolean' },+ { key: 'isLocked', label: 'Locked', format: 'boolean' },+ { key: 'approvalStatus', label: 'Approval Status' },+ {+ key: 'timeInterval',+ label: 'Time Interval',+ children: [+ { key: 'start', label: 'Start', format: 'datetime' },+ { key: 'end', label: 'End', format: 'datetime' },+ { key: 'duration', label: 'Duration (Seconds)', format: 'number' },+ ],+ },+ {+ key: 'tags',+ label: 'Tags',+ labelKey: 'name',+ listItems: [+ { key: '_id', label: 'Tag ID' },+ { key: 'name', label: 'Name' },+ ],+ },+];++const totalsByDayFields: OutputSchema['fields'] = [+ { key: 'date', label: 'Date', format: 'datetime' },+ { key: 'duration', label: 'Duration (Seconds)', format: 'number' },+ { key: 'amount', label: 'Amount (Cents)', format: 'number' },+];++const weeklyDayFields: OutputSchema['fields'] = [+ { key: 'date', label: 'Date', format: 'datetime' },+ { key: 'duration', label: 'Duration (Seconds)', format: 'number' },+];++const weeklyRowFields: OutputSchema['fields'] = [+ { key: '_id', label: 'ID' },+ { key: 'name', label: 'Name' },+ { key: 'duration', label: 'Duration (Seconds)', format: 'number' },+ { key: 'amount', label: 'Amount (Cents)', format: 'number' },+ {+ key: 'days',+ label: 'Days',+ labelKey: 'date',+ listItems: weeklyDayFields,+ },+];++export const workspaceOutputSchema: OutputSchema = { fields: workspaceFields };++export const workspacesOutputSchema: OutputSchema = {+ fields: [+ { key: 'workspaces', label: 'Workspaces', labelKey: 'name', listItems: workspaceFields },+ { key: 'count', label: 'Count', format: 'number' },+ ],+};++export const currentUserOutputSchema: OutputSchema = { fields: userFields };++export const usersOutputSchema: OutputSchema = {+ fields: [+ { key: 'users', label: 'Users', labelKey: 'name', listItems: userFields },+ { key: 'count', label: 'Count', format: 'number' },+ ],+};++export const managersOutputSchema: OutputSchema = {+ fields: [+ { key: 'managers', label: 'Managers', labelKey: 'name', listItems: userFields },+ { key: 'count', label: 'Count', format: 'number' },+ ],+};++export const memberProfileOutputSchema: OutputSchema = {+ fields: [+ { key: 'name', label: 'Name' },+ { key: 'email', label: 'Email', format: 'email' },+ { key: 'weekStart', label: 'Week Start' },+ { key: 'workCapacity', label: 'Work Capacity', format: 'duration' },+ { key: 'workingDays', label: 'Working Days' },+ { key: 'imageUrl', label: 'Image URL', format: 'image' },+ { key: 'hasPendingApprovalRequest', label: 'Pending Approval', format: 'boolean' },+ { key: 'userCustomFieldValues', label: 'Custom Field Values' },+ ],+};++export const userRolesOutputSchema: OutputSchema = {+ itemLabel: '{role.name}',+ fields: [+ {+ key: 'roles',+ label: 'Roles',+ value: '',+ listItems: [+ { key: 'userId', label: 'User ID' },+ { key: 'workspaceId', label: 'Workspace ID' },+ {+ key: 'role',+ label: 'Role',+ children: [+ { key: 'id', label: 'Entity ID' },+ { key: 'name', label: 'Name' },+ ],+ },+ ],+ },+ ],+};++export const removedUserRoleOutputSchema: OutputSchema = {+ fields: [+ { key: 'removed', label: 'Removed', format: 'boolean' },+ { key: 'userId', label: 'User ID' },+ { key: 'role', label: 'Role' },+ { key: 'entityId', label: 'Entity ID' },+ ],+};++export const userCustomFieldValueOutputSchema: OutputSchema = {+ fields: [+ { key: 'customFieldId', label: 'Custom Field ID' },+ { key: 'customFieldName', label: 'Custom Field Name' },+ { key: 'customFieldType', label: 'Custom Field Type' },+ { key: 'userId', label: 'User ID' },+ { key: 'value', label: 'Value' },+ ],+};++export const userGroupOutputSchema: OutputSchema = { fields: userGroupFields };++export const userGroupsOutputSchema: OutputSchema = {+ fields: [+ { key: 'userGroups', label: 'User Groups', labelKey: 'name', listItems: userGroupFields },+ { key: 'count', label: 'Count', format: 'number' },+ ],+};++export const clientOutputSchema: OutputSchema = { fields: clientWithCurrencyFields };++export const changedClientOutputSchema: OutputSchema = { fields: clientFields };++export const clientsOutputSchema: OutputSchema = {+ fields: [+ { key: 'clients', label: 'Clients', labelKey: 'name', listItems: clientWithCurrencyFields },+ { key: 'count', label: 'Count', format: 'number' },+ ],+};++export const projectOutputSchema: OutputSchema = { fields: projectFields };++export const projectsOutputSchema: OutputSchema = {+ fields: [+ { key: 'projects', label: 'Projects', labelKey: 'name', listItems: projectFields },+ { key: 'count', label: 'Count', format: 'number' },+ ],+};++export const taskOutputSchema: OutputSchema = { fields: taskFields };++export const tasksOutputSchema: OutputSchema = {+ fields: [+ { key: 'tasks', label: 'Tasks', labelKey: 'name', listItems: taskFields },+ { key: 'count', label: 'Count', format: 'number' },+ ],+};++export const foundTasksOutputSchema: OutputSchema = {+ itemLabel: '{name}',+ fields: [{ key: 'tasks', label: 'Tasks', value: '', listItems: taskFields }],+};++export const newTaskOutputSchema: OutputSchema = {+ fields: [...taskFields, { key: 'workspaceId', label: 'Workspace ID' }],+};++export const tagOutputSchema: OutputSchema = { fields: tagFields };++export const tagsOutputSchema: OutputSchema = {+ fields: [+ { key: 'tags', label: 'Tags', labelKey: 'name', listItems: tagFields },+ { key: 'count', label: 'Count', format: 'number' },+ ],+};++export const timeEntryOutputSchema: OutputSchema = { fields: baseTimeEntryFields };++export const hydratedTimeEntryOutputSchema: OutputSchema = {+ fields: hydratedTimeEntryFields,+};++export const timeEntriesOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'timeEntries',+ label: 'Time Entries',+ labelKey: 'description',+ listItems: timeEntryFields,+ },+ { key: 'count', label: 'Count', format: 'number' },+ ],+};++export const changedTimeEntriesOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'timeEntries',+ label: 'Time Entries',+ labelKey: 'description',+ listItems: baseTimeEntryFields,+ },+ { key: 'count', label: 'Count', format: 'number' },+ ],+};++export const hydratedTimeEntriesOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'timeEntries',+ label: 'Time Entries',+ labelKey: 'description',+ listItems: hydratedTimeEntryFields,+ },+ { key: 'count', label: 'Count', format: 'number' },+ ],+};++export const foundTimeEntriesOutputSchema: OutputSchema = {+ itemLabel: '{description}',+ fields: [+ { key: 'timeEntries', label: 'Time Entries', value: '', listItems: hydratedTimeEntryFields },+ ],+};++export const runningTimersOutputSchema: OutputSchema = {+ itemLabel: '{description}',+ fields: [{ key: 'timeEntries', label: 'Running Timers', value: '', listItems: timeEntryFields }],+};++export const webhookTimeEntryOutputSchema: OutputSchema = {+ fields: webhookTimeEntryFields,+};++export const deletedOutputSchema: OutputSchema = {+ fields: [+ { key: 'deleted', label: 'Deleted', format: 'boolean' },+ { key: 'id', label: 'ID' },+ ],+};++export const invoicedOutputSchema: OutputSchema = {+ fields: [+ { key: 'success', label: 'Success', format: 'boolean' },+ { key: 'invoiced', label: 'Invoiced', format: 'boolean' },+ { key: 'timeEntryIds', label: 'Time Entry IDs' },+ ],+};++export const holidayOutputSchema: OutputSchema = { fields: holidayFields };++export const holidaysOutputSchema: OutputSchema = {+ fields: [+ { key: 'holidays', label: 'Holidays', labelKey: 'name', listItems: holidayFields },+ { key: 'count', label: 'Count', format: 'number' },+ ],+};++export const templateOutputSchema: OutputSchema = {+ fields: [+ ...templateFields,+ { key: 'projectsAndTasks', label: 'Rows', listItems: templateRowFields },+ ],+};++export const hydratedTemplateOutputSchema: OutputSchema = {+ fields: [+ ...templateFields,+ {+ key: 'projectsAndTasks',+ label: 'Rows',+ listItems: [...templateRowFields, ...hydratedTemplateRowFields],+ },+ ],+};++export const templatesOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'templates',+ label: 'Templates',+ labelKey: 'name',+ listItems: [+ ...templateFields,+ {+ key: 'projectsAndTasks',+ label: 'Rows',+ listItems: [...templateRowFields, ...hydratedTemplateRowFields],+ },+ ],+ },+ { key: 'count', label: 'Count', format: 'number' },+ ],+};++export const sharedReportOutputSchema: OutputSchema = { fields: sharedReportFields };++export const sharedReportsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'reports',+ label: 'Shared Reports',+ labelKey: 'name',+ listItems: [+ { key: 'id', label: 'Shared Report ID' },+ { key: 'name', label: 'Name' },+ { key: 'type', label: 'Type' },+ { key: 'link', label: 'Link', format: 'url' },+ { key: 'reportAuthor', label: 'Author' },+ { key: 'isPublic', label: 'Public', format: 'boolean' },+ { key: 'fixedDate', label: 'Fixed Date', format: 'boolean' },+ { key: 'visibleToUsers', label: 'Visible To Users' },+ { key: 'visibleToUserGroups', label: 'Visible To User Groups' },+ ],+ },+ { key: 'count', label: 'Count', format: 'number' },+ ],+};++export const sharedReportDataOutputSchema: OutputSchema = {+ fields: [+ { key: 'totals', label: 'Totals', listItems: reportTotalFields },+ {+ key: 'groupOne',+ label: 'Groups',+ labelKey: 'name',+ listItems: [+ ...reportGroupFields,+ { key: 'amount', label: 'Amount (Cents)', format: 'number' },+ { key: 'days', label: 'Days', labelKey: 'date', listItems: weeklyDayFields },+ ],+ },+ {+ key: 'timeentries',+ label: 'Time Entries',+ labelKey: 'description',+ listItems: detailedTimeEntryFields,+ },+ { key: 'totalsByDay', label: 'Totals By Day', labelKey: 'date', listItems: totalsByDayFields },+ {+ key: 'filters',+ label: 'Report',+ children: [+ { key: 'id', label: 'Shared Report ID' },+ { key: 'name', label: 'Name' },+ { key: 'type', label: 'Type' },+ ],+ },+ ],+};++export const detailedReportOutputSchema: OutputSchema = {+ fields: [+ { key: 'totals', label: 'Totals', listItems: reportTotalFields },+ {+ key: 'timeentries',+ label: 'Time Entries',+ labelKey: 'description',+ listItems: detailedTimeEntryFields,+ },+ ],+};++export const summaryReportOutputSchema: OutputSchema = { fields: summaryReportFields };++export const weeklyReportOutputSchema: OutputSchema = {+ fields: [+ { key: 'totals', label: 'Totals', listItems: reportTotalFields },+ {+ key: 'totalsByDay',+ label: 'Totals By Day',+ labelKey: 'date',+ listItems: totalsByDayFields,+ },+ {+ key: 'groupOne',+ label: 'Rows',+ labelKey: 'name',+ listItems: weeklyRowFields,+ },+ ],+};++export const attendanceReportOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'totals',+ label: 'Totals',+ children: [+ { key: 'capacity', label: 'Capacity (Seconds)', format: 'number' },+ { key: 'totalDuration', label: 'Tracked (Seconds)', format: 'number' },+ { key: 'break', label: 'Break (Seconds)', format: 'number' },+ { key: 'overtime', label: 'Overtime (Seconds)', format: 'number' },+ { key: 'timeOff', label: 'Time Off (Seconds)', format: 'number' },+ { key: 'entriesCount', label: 'Entries', format: 'number' },+ ],+ },+ {+ key: 'entities',+ label: 'Days',+ labelKey: 'userName',+ listItems: [+ { key: 'userId', label: 'User ID' },+ { key: 'userName', label: 'User Name' },+ { key: 'date', label: 'Date', format: 'datetime' },+ { key: 'capacity', label: 'Capacity (Seconds)', format: 'number' },+ { key: 'totalDuration', label: 'Tracked (Seconds)', format: 'number' },+ { key: 'break', label: 'Break (Seconds)', format: 'number' },+ { key: 'overtime', label: 'Overtime (Seconds)', format: 'number' },+ { key: 'timeOff', label: 'Time Off (Seconds)', format: 'number' },+ { key: 'hasRunningEntry', label: 'Timer Running', format: 'boolean' },+ ],+ },+ ],+};++export const expenseReportOutputSchema: OutputSchema = {+ fields: [+ { key: 'totals', label: 'Totals' },+ { key: 'expenses', label: 'Expenses' },+ { key: 'exportFields', label: 'Export Fields' },+ ],+};++export const customFieldsOutputSchema: OutputSchema = {+ fields: [+ { key: 'customFields', label: 'Custom Fields', labelKey: 'name', listItems: customFieldFields },+ { key: 'count', label: 'Count', format: 'number' },+ ],+};++export const projectCustomFieldsOutputSchema: OutputSchema = {+ fields: [+ { key: 'customFields', label: 'Custom Fields' },+ { key: 'count', label: 'Count', format: 'number' },+ ],+};++export const assignmentsOutputSchema: OutputSchema = {+ fields: [+ { key: 'assignments', label: 'Assignments' },+ { key: 'count', label: 'Count', format: 'number' },+ ],+};++export const createdEntitiesOutputSchema: OutputSchema = {+ itemLabel: '{documentCode} {id}',+ fields: [+ {+ key: 'entities',+ label: 'Records',+ value: '',+ listItems: [+ { key: 'id', label: 'Record ID' },+ { key: 'documentCode', label: 'Record Type' },+ { key: 'workspaceId', label: 'Workspace ID' },+ {+ key: 'auditMetadata',+ label: 'Audit',+ children: [+ { key: 'createdAt', label: 'Created At', format: 'datetime' },+ { key: 'updatedAt', label: 'Updated At', format: 'datetime' },+ ],+ },+ ],+ },+ ],+};diff --git a/packages/pieces/community/clockify/src/lib/triggers/new-task.ts b/packages/pieces/community/clockify/src/lib/triggers/new-task.tsindex 7906036e344..5e39881e7f5 100644--- a/packages/pieces/community/clockify/src/lib/triggers/new-task.ts+++ b/packages/pieces/community/clockify/src/lib/triggers/new-task.ts@@ -1,15 +1,16 @@-import { HttpMethod } from '@activepieces/pieces-common';import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';import { isNil } from '@activepieces/pieces-framework';import { clockifyAuth } from '../auth';-import { clockifyApiCall } from '../common/client';-import { projectId, workspaceId } from '../common/props';+import { clockifyApi } from '../common/api';+import { clockifyProps } from '../common/props';+import { newTaskOutputSchema } from '../output-schemas';const TRIGGER_KEY = 'new-task-trigger';export const newTaskTrigger = createTrigger({auth: clockifyAuth,name: 'new-task',+ outputSchema: newTaskOutputSchema,classification: 'READ',displayName: 'New Task',description: 'Triggers when a new task is created in specified project.',@@ -19,28 +20,19 @@ export const newTaskTrigger = createTrigger({},type: TriggerStrategy.WEBHOOK,props: {- workspaceId: workspaceId({- displayName: 'Workspace',- required: true,- }),- projectId: projectId({- displayName: 'Project',- required: true,- }),+ workspaceId: clockifyProps.workspaceId({ required: true }),+ projectId: clockifyProps.projectId({ required: true }),},async onEnable(context) {const { workspaceId, projectId } = context.propsValue;- const response = await clockifyApiCall<{ id: string }>({- apiKey: context.auth.secret_text,- method: HttpMethod.POST,- resourceUri: `/workspaces/${workspaceId}/webhooks`,- body: {- url: context.webhookUrl,- webhookEvent: 'NEW_TASK',- triggerSourceType: 'PROJECT_ID',- triggerSource: [projectId],- },+ const response = await clockifyApi.createWebhook({+ auth: context.auth,+ workspaceId,+ url: context.webhookUrl,+ webhookEvent: 'NEW_TASK',+ triggerSourceType: 'PROJECT_ID',+ triggerSource: [projectId],});await context.store.put<string>(TRIGGER_KEY, response.id);@@ -51,27 +43,21 @@ export const newTaskTrigger = createTrigger({const webhookId = await context.store.get<string>(TRIGGER_KEY);if (!isNil(webhookId)) {- await clockifyApiCall({- apiKey: context.auth.secret_text,- method: HttpMethod.DELETE,- resourceUri: `/workspaces/${workspaceId}/webhooks/${webhookId}`,- });+ await clockifyApi.deleteWebhook({ auth: context.auth, workspaceId, webhookId });}},async test(context) {const { workspaceId, projectId } = context.propsValue;- const response = await clockifyApiCall<{ id: string }[]>({- apiKey: context.auth.secret_text,- method: HttpMethod.GET,- resourceUri: `/workspaces/${workspaceId}/projects/${projectId}/tasks`,+ return await clockifyApi.listTasks({+ auth: context.auth,+ workspaceId,+ projectId,query: {page: '1',- 'page-size': 5,+ 'page-size': '5',},});-- return response;},async run(context) {return [context.payload.body];diff --git a/packages/pieces/community/clockify/src/lib/triggers/new-time-entry.ts b/packages/pieces/community/clockify/src/lib/triggers/new-time-entry.tsindex a0f30ac5320..a39304b9e21 100644--- a/packages/pieces/community/clockify/src/lib/triggers/new-time-entry.ts+++ b/packages/pieces/community/clockify/src/lib/triggers/new-time-entry.ts@@ -1,15 +1,17 @@-import { HttpMethod, QueryParams } from '@activepieces/pieces-common';+import { QueryParams } from '@activepieces/pieces-common';import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';import { isNil } from '@activepieces/pieces-framework';import { clockifyAuth } from '../auth';-import { clockifyApiCall } from '../common/client';-import { projectId, taskId, workspaceId } from '../common/props';+import { clockifyApi } from '../common/api';+import { clockifyProps } from '../common/props';+import { webhookTimeEntryOutputSchema } from '../output-schemas';const TRIGGER_KEY = 'new-time-entry-trigger';export const newTimeEntryTrigger = createTrigger({auth: clockifyAuth,name: 'new-time-entry',+ outputSchema: webhookTimeEntryOutputSchema,classification: 'READ',displayName: 'New Time Entry',description: 'Triggers when a new time entry is created.',@@ -19,47 +21,38 @@ export const newTimeEntryTrigger = createTrigger({},type: TriggerStrategy.WEBHOOK,props: {- workspaceId: workspaceId({- displayName: 'Workspace',- required: true,- }),- projectId: projectId({- displayName: 'Project',- required: false,- }),- taskId: taskId({- displayName: 'Task',- required: false,- }),+ workspaceId: clockifyProps.workspaceId({ required: true }),+ projectId: clockifyProps.projectId({ required: false }),+ taskId: clockifyProps.taskId({ required: false }),},async onEnable(context) {const { workspaceId, projectId, taskId } = context.propsValue;- const payload: Record<string, any> = {- url: context.webhookUrl,- webhookEvent: 'NEW_TIME_ENTRY',- };+ let triggerSourceType: string | undefined;+ let triggerSource: string[] | undefined;if (workspaceId) {- payload['triggerSourceType'] = 'WORKSPACE_ID';- payload['triggerSource'] = [workspaceId];+ triggerSourceType = 'WORKSPACE_ID';+ triggerSource = [workspaceId];}if (projectId) {- payload['triggerSourceType'] = 'PROJECT_ID';- payload['triggerSource'] = [projectId];+ triggerSourceType = 'PROJECT_ID';+ triggerSource = [projectId];}if (taskId) {- payload['triggerSourceType'] = 'TASK_ID';- payload['triggerSource'] = [taskId];+ triggerSourceType = 'TASK_ID';+ triggerSource = [taskId];}- const response = await clockifyApiCall<{ id: string }>({- apiKey: context.auth.secret_text,- method: HttpMethod.POST,- resourceUri: `/workspaces/${workspaceId}/webhooks`,- body: payload,+ const response = await clockifyApi.createWebhook({+ auth: context.auth,+ workspaceId,+ url: context.webhookUrl,+ webhookEvent: 'NEW_TIME_ENTRY',+ triggerSourceType,+ triggerSource,});await context.store.put<string>(TRIGGER_KEY, response.id);@@ -70,36 +63,24 @@ export const newTimeEntryTrigger = createTrigger({const webhookId = await context.store.get<string>(TRIGGER_KEY);if (!isNil(webhookId)) {- await clockifyApiCall({- apiKey: context.auth.secret_text,- method: HttpMethod.DELETE,- resourceUri: `/workspaces/${workspaceId}/webhooks/${webhookId}`,- });+ await clockifyApi.deleteWebhook({ auth: context.auth, workspaceId, webhookId });}},async test(context) {const { workspaceId, projectId, taskId } = context.propsValue;- const currentUserResponse = await clockifyApiCall<{ id: string; email: string }>({- apiKey: context.auth.secret_text,- method: HttpMethod.GET,- resourceUri: `/user`,- });-- const userId = currentUserResponse.id;+ const currentUser = await clockifyApi.getCurrentUser({ auth: context.auth });const qs: QueryParams = { hydrated: 'true', page: '1', 'page-size': '5' };- if (projectId) qs['project'] = projectId as string;- if (taskId) qs['task'] = taskId as string;+ if (projectId) qs['project'] = projectId;+ if (taskId) qs['task'] = taskId;- const response = await clockifyApiCall<{id:string}[]>({- apiKey: context.auth.secret_text,- method: HttpMethod.GET,- resourceUri: `/workspaces/${workspaceId}/user/${userId}/time-entries`,+ return await clockifyApi.listUserTimeEntries({+ auth: context.auth,+ workspaceId,+ userId: currentUser.id,query: qs,});-- return response;},async run(context) {return [context.payload.body];diff --git a/packages/pieces/community/clockify/src/lib/triggers/new-timer-started.ts b/packages/pieces/community/clockify/src/lib/triggers/new-timer-started.tsindex 8b08896e547..34f55be2dd7 100644--- a/packages/pieces/community/clockify/src/lib/triggers/new-timer-started.ts+++ b/packages/pieces/community/clockify/src/lib/triggers/new-timer-started.ts@@ -1,15 +1,16 @@-import { HttpMethod } from '@activepieces/pieces-common';import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';import { isNil } from '@activepieces/pieces-framework';import { clockifyAuth } from '../auth';-import { clockifyApiCall } from '../common/client';-import { workspaceId } from '../common/props';+import { clockifyApi } from '../common/api';+import { clockifyProps } from '../common/props';+import { webhookTimeEntryOutputSchema } from '../output-schemas';const TRIGGER_KEY = 'new-timer-started-trigger';export const newTimerStartedTrigger = createTrigger({auth: clockifyAuth,name: 'new-timer-started',+ outputSchema: webhookTimeEntryOutputSchema,classification: 'READ',displayName: 'New Timer Started',description: 'Triggers when a new entry is started and running.',@@ -19,24 +20,18 @@ export const newTimerStartedTrigger = createTrigger({},type: TriggerStrategy.WEBHOOK,props: {- workspaceId: workspaceId({- displayName: 'Workspace',- required: true,- }),+ workspaceId: clockifyProps.workspaceId({ required: true }),},async onEnable(context) {const { workspaceId } = context.propsValue;- const response = await clockifyApiCall<{ id: string }>({- apiKey: context.auth.secret_text,- method: HttpMethod.POST,- resourceUri: `/workspaces/${workspaceId}/webhooks`,- body: {- url: context.webhookUrl,- webhookEvent: 'NEW_TIMER_STARTED',- triggerSourceType: 'WORKSPACE_ID',- triggerSource: [workspaceId],- },+ const response = await clockifyApi.createWebhook({+ auth: context.auth,+ workspaceId,+ url: context.webhookUrl,+ webhookEvent: 'NEW_TIMER_STARTED',+ triggerSourceType: 'WORKSPACE_ID',+ triggerSource: [workspaceId],});await context.store.put<string>(TRIGGER_KEY, response.id);@@ -47,11 +42,7 @@ export const newTimerStartedTrigger = createTrigger({const webhookId = await context.store.get<string>(TRIGGER_KEY);if (!isNil(webhookId)) {- await clockifyApiCall<{ id: string }>({- apiKey: context.auth.secret_text ,- method: HttpMethod.DELETE,- resourceUri: `/workspaces/${workspaceId}/webhooks/${webhookId}`,- });+ await clockifyApi.deleteWebhook({ auth: context.auth, workspaceId, webhookId });}},async run(context) {