Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12147 update toggl track to latest version of api v9 #12741

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import toggl from "../../toggl.app.mjs";

export default {
name: "Get Current Time Entry",
version: "0.0.4",
version: "0.0.5",
key: "toggl-get-current-time-entry",
description: "Get the time entry that is running now. [See docs here]https://developers.track.toggl.com/docs/api/time_entries#get-get-current-time-entry)",
type: "action",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import toggl from "../../toggl.app.mjs";

export default {
name: "Get Time Entries",
version: "0.0.4",
version: "0.0.5",
key: "toggl-get-time-entries",
description: "Get the last thousand time entries. [See docs here](https://developers.track.toggl.com/docs/api/time_entries#get-timeentries)",
type: "action",
Expand Down
5 changes: 2 additions & 3 deletions components/toggl/actions/get-time-entry/get-time-entry.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import toggl from "../../toggl.app.mjs";

export default {
name: "Get Time Entry",
version: "0.0.4",
version: "0.0.5",
key: "toggl-get-time-entry",
description: "Get details about a specific time entry. [See docs here](https://developers.track.toggl.com/docs/api/time_entries)",
type: "action",
Expand All @@ -21,8 +21,7 @@ export default {
timeEntryId: this.timeEntryId,
});

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

$.export("$summary", "Successfully retrieved time entry");
return response;
},
};
4 changes: 2 additions & 2 deletions components/toggl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/toggl",
"version": "0.0.5",
"version": "0.0.6",
"description": "Pipedream Toggl Components",
"main": "toggl.app.js",
"keywords": [
Expand All @@ -14,7 +14,7 @@
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^0.10.0",
"@pipedream/platform": "^3.0.0",
"toggl-api": "^1.0.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import base from "../common/base.mjs";
export default {
...base,
name: "New Start Time Entry (Instant)",
version: "0.0.2",
version: "0.0.3",
key: "toggl-new-start-time-entry",
description: "Emit new event when a time entry is started. [See docs here](https://github.com/toggl/toggl_api_docs/blob/master/webhooks.md)",
type: "source",
Expand Down
2 changes: 1 addition & 1 deletion components/toggl/sources/new-time-entry/new-time-entry.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import base from "../common/base.mjs";
export default {
...base,
name: "New Time Entry (Instant)",
version: "0.0.2",
version: "0.0.3",
key: "toggl-new-time-entry",
description: "Emit new event when a time entry is created. [See docs here](https://github.com/toggl/toggl_api_docs/blob/master/webhooks.md)",
type: "source",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import base from "../common/base.mjs";
export default {
...base,
name: "New Update Time Entry (Instant)",
version: "0.0.2",
version: "0.0.3",
key: "toggl-new-update-time-entry",
description: "Emit new event when a time entry is updated. [See docs here](https://github.com/toggl/toggl_api_docs/blob/master/webhooks.md)",
type: "source",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import constants from "../common/constants.mjs";
export default {
...base,
name: "New Webhook Event (Instant)",
version: "0.0.2",
version: "0.0.3",
key: "toggl-new-webhook-event",
description: "Emit new event on receive a webhook event. [See docs here](https://github.com/toggl/toggl_api_docs/blob/master/webhooks.md)",
type: "source",
Expand Down
22 changes: 9 additions & 13 deletions components/toggl/toggl.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default {
_apiUrl(apiVersion) {
return constants.API_BASE_URL_VERSIONS[apiVersion];
},
async _makeRequest(apiVersion, path, options = {}, $ = this) {
_makeRequest(apiVersion, path, options = {}, $ = this) {
return axios($, {
url: `${this._apiUrl(apiVersion)}/${path}`,
auth: {
Expand All @@ -57,7 +57,7 @@ export default {
...options,
});
},
async createWebhook({
createWebhook({
workspaceId, data,
}) {
return this._makeRequest("v1", `subscriptions/${workspaceId}`, {
Expand All @@ -69,22 +69,20 @@ export default {
},
});
},
async removeWebhook({
removeWebhook({
workspaceId, webhookId,
}) {
return this._makeRequest("v1", `subscriptions/${workspaceId}/${webhookId}`, {
method: "delete",
});
luancazarine marked this conversation as resolved.
Show resolved Hide resolved
},
async getWorkspaces({
workspaceId, $,
}) {
return this._makeRequest("v9", `workspaces/${workspaceId}`, {}, $);
getWorkspaces({ $ }) {
return this._makeRequest("v9", "me/workspaces", {}, $);
},
async getCurrentTimeEntry({ $ } = {}) {
getCurrentTimeEntry({ $ } = {}) {
return this._makeRequest("v9", "me/time_entries/current", {}, $);
},
luancazarine marked this conversation as resolved.
Show resolved Hide resolved
async getTimeEntries({
getTimeEntries({
params, $,
} = {}) {
return this._makeRequest("v9", "me/time_entries", {
Expand All @@ -94,12 +92,10 @@ export default {
},
}, $);
},
async getTimeEntry({
getTimeEntry({
timeEntryId, $,
} = {}) {
const { data } = await this._makeRequest("v8", `time_entries/${timeEntryId}`, {}, $);

return data;
return this._makeRequest("v9", `me/time_entries/${timeEntryId}`, {}, $);
luancazarine marked this conversation as resolved.
Show resolved Hide resolved
},
},
};
4 changes: 2 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading