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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions components/dictionary_api/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#*.js
#*.mjs
dist
*.js
*.mjs
dist
6 changes: 3 additions & 3 deletions components/facebook_groups/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#*.js
#*.mjs
dist
*.js
*.mjs
dist
6 changes: 3 additions & 3 deletions components/facebook_pages/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#*.js
#*.mjs
dist
*.js
*.mjs
dist
6 changes: 3 additions & 3 deletions components/personio/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#*.js
#*.mjs
dist
*.js
*.mjs
dist
6 changes: 3 additions & 3 deletions components/smiirl/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#*.js
#*.mjs
dist
*.js
*.mjs
dist
28 changes: 28 additions & 0 deletions components/toggl/actions/create-new-client/create-new-client.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import toggl from "../../toggl.app.mjs";

export default {
name: "Create a new client",
version: "0.0.1",
description: "Create a new Client [See docs here.](https://developers.track.toggl.com/docs/api/clients/index.html#post-create-client)",
type: "action",
key: "toggle-create-new-client",
props: {
toggl,
name: {
type: "string",
label: "Name",
},
workspace_id: {
type: "integer",
label: "Workspace ID",
}
},
async run({ $ }) {
const response = await this.toggl.createNewClient({
name: this.name,
workspace_id: this.workspace_id,
})

response && $.export("$summary", "Successfully created new client");
}
}
138 changes: 138 additions & 0 deletions components/toggl/actions/create-project/create-project.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
import toggl from "../../toggl.app.mjs";

export default {
name: "Create a new Project",
version: "0.0.1",
description: "Create project for given workspace. [See docs here.](https://developers.track.toggl.com/docs/api/projects#post-workspaceprojects)",
type: "action",
key: "toggle-create-new-project",
props: {
toggl,
name: {
type: "string",
label: "Name",
description: 'unique for client and workspace'
},
workspace_id: {
type: "integer",
label: "Workspace ID",
description: "Numeric ID of the workspace"
},
client_id: {
type: 'integer',
label: 'client ID',
optional: true,
},
client_name: {
type: 'string',
label: 'client Name',
optional: true,
},
active: {
type: 'boolean',
label: 'Active',
optional: true,
description: ' Whether the project is archived or not',
},
is_private: {
type: 'boolean',
label: 'Is Private',
optional: true,
description: 'Whether project is accessible for only project users or for all workspace users',
},
template: {
type: 'boolean',
label: 'Template',
optional: true,
description: 'Whether the project can be used as a template',
},
template_id: {
type: 'integer',
label: 'Template ID',
description: "Id of the template project used on current project's creation",
optional: true,
},
billable: {
type: 'boolean',
label: 'Billable',
description: "Whether the project is billable or no (available only for pro workspaces)",
},
auto_estimates: {
type: 'boolean',
label: 'Auto Estimates',
optional: true,
description: "whether the estimated hours are automatically calculated based on task estimations or manually fixed based on the value of 'estimated_hours' (premium functionality) ",
},
estimated_hours: {
type: 'boolean',
label: 'Estimated Hours',
optional: true,
description: "if auto_estimates is true then the sum of task estimations is returned, otherwise user inserted hours (premium functionality)"

},
color: {
type: 'string',
label: 'Color',
description: 'Project color (hex value in the form of #[0-9a-f]{6}.)',
},
rate: {
type: 'integer',
label: 'Rate',
description: 'Hourly Rate. premium feature',
optional: true,
},
fixed_fee: {
type: 'integer',
label: 'Rate',
description: 'Project fixed fee. premium feature',
optional: true,
},
currency: {
type: 'string',
label: 'Currency',
description: 'Project currency. premium feature',
optional: true,
},
start_date: {
type: 'string',
label: 'Start Date',
description: 'Start date of a project timeframe',
},
end_date: {
type: 'string',
label: 'End Date',
description: 'End date of a project timeframe',
},
},
async run({ $ }) {
const {
name, workspace_id,client_id,client_name, active,
is_private, template, template_id, billable, auto_estimates,
estimated_hours, color, rate, fixed_fee, currency, start_date, end_date} = this;
const payload = {
name,
workspace_id,
client_id,
client_name,
active,
is_private,
template,
template_id,
billable,
auto_estimates,
estimated_hours,
color,
rate,
fixed_fee,
currency,
start_date,
end_date
}
const response = await this.toggl.createProject({
workspace_id: this.workspace_id,
payload,
})

response && $.export("$summary", `Successfully created new project, ${response.name}`);
}
}
33 changes: 33 additions & 0 deletions components/toggl/actions/update-client/update-client.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import toggl from "../../toggl.app.mjs";

export default {
name: "Update new client",
version: "0.0.1",
description: "Upate a Client [See docs here.](https://developers.track.toggl.com/docs/api/clients/index.html#put-change-client)",
type: "action",
key: "toggle-update-client",
props: {
toggl,
name: {
type: "string",
label: "Name",
},
workspace_id: {
type: "integer",
label: "Workspace ID",
},
client_id: {
type: "integer",
label: "Client ID",
},
},
async run({ $ }) {
const response = await this.toggl.updateClient({
name: this.name,
workspace_id: this.workspace_id,
client_id: this.client_id
})

response && $.export("$summary", "Successfully updated client info.");
}
}
144 changes: 144 additions & 0 deletions components/toggl/actions/update-project/update-project.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
import toggl from "../../toggl.app.mjs";

export default {
name: "Update a Project",
version: "0.0.1",
description: "Update project for given workspace. [See docs here.](https://developers.track.toggl.com/docs/api/projects#post-workspaceprojects)",
type: "action",
key: "toggle-update-project",
props: {
toggl,
workspace_id: {
type: "integer",
label: "Workspace ID",
description: "Numeric ID of the workspace"
},
project_id: {
type: "integer",
label: "Project ID",
description: "Numeric ID of the project"
},
name: {
type: "string",
label: "Name",
description: 'unique for client and workspace'
},
client_id: {
type: 'integer',
label: 'client ID',
optional: true,
},
client_name: {
type: 'string',
label: 'client Name',
optional: true,
},
active: {
type: 'boolean',
label: 'Active',
optional: true,
description: ' Whether the project is archived or not',
},
is_private: {
type: 'boolean',
label: 'Is Private',
optional: true,
description: 'Whether project is accessible for only project users or for all workspace users',
},
template: {
type: 'boolean',
label: 'Template',
optional: true,
description: 'Whether the project can be used as a template',
},
template_id: {
type: 'integer',
label: 'Template ID',
description: "Id of the template project used on current project's creation",
optional: true,
},
billable: {
type: 'boolean',
label: 'Billable',
description: "Whether the project is billable or no (available only for pro workspaces)",
},
auto_estimates: {
type: 'boolean',
label: 'Auto Estimates',
optional: true,
description: "whether the estimated hours are automatically calculated based on task estimations or manually fixed based on the value of 'estimated_hours' (premium functionality) ",
},
estimated_hours: {
type: 'boolean',
label: 'Estimated Hours',
optional: true,
description: "if auto_estimates is true then the sum of task estimations is returned, otherwise user inserted hours (premium functionality)"

},
color: {
type: 'string',
label: 'Color',
description: 'Project color',
},
rate: {
type: 'integer',
label: 'Rate',
description: 'Hourly Rate. premium feature',
optional: true,
},
fixed_fee: {
type: 'integer',
label: 'Rate',
description: 'Project fixed fee. premium feature',
optional: true,
},
currency: {
type: 'string',
label: 'Currency',
description: 'Project currency. premium feature',
optional: true,
},
start_date: {
type: 'string',
label: 'Start Date',
description: 'Start date of a project timeframe',
},
end_date: {
type: 'string',
label: 'End Date',
description: 'End date of a project timeframe',
},
},
async run({ $ }) {
const {
name, workspace_id,client_id,client_name, active,
is_private, template, template_id, billable, auto_estimates,
estimated_hours, color, rate, fixed_fee, currency, start_date, end_date} = this;
const data = {
name,
workspace_id,
client_id,
client_name,
active,
is_private,
template,
template_id,
billable,
auto_estimates,
estimated_hours,
color,
rate,
fixed_fee,
currency,
start_date,
end_date
}
const response = await this.toggl.updateProject({
workspace_id: this.workspace_id,
project_id: this.project_id,
payload: data,
})

response && $.export("$summary", `Successfully created updated the ${response.name} project`);
}
}
1 change: 1 addition & 0 deletions components/toggl/common/constants.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ export default {
API_BASE_URL_VERSIONS: {
"v1": "https://track.toggl.com/webhooks/api/v1",
"v8": "https://api.track.toggl.com/api/v8",
"v9": "https://api.track.toggl.com/api/v9"
},
};
Loading