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

Tibble output via tibblify #5

Draft
wants to merge 137 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
0aa3da9
Import tibble and tibblify
krlmlr Oct 2, 2021
35b91d7
Unrelated: Project configuration
krlmlr Oct 2, 2021
584bb40
Add script snapshot
krlmlr Oct 2, 2021
4b73716
Add copy of all API function files
krlmlr Oct 2, 2021
a6713e1
cu_ -> cuf_
krlmlr Oct 2, 2021
84aeaf9
Export
krlmlr Oct 2, 2021
00fb110
Prune roxygen2
krlmlr Oct 2, 2021
6492c76
Document
krlmlr Oct 2, 2021
5929d52
cuf_get_teams()
krlmlr Oct 2, 2021
a5f6675
Spaces
krlmlr Oct 2, 2021
195a840
Folders
krlmlr Oct 2, 2021
be40451
Clean up
krlmlr Oct 3, 2021
201b32c
Document
krlmlr Oct 2, 2021
c59e76d
Tweak
krlmlr Oct 2, 2021
bd4d70e
Purge
krlmlr Oct 2, 2021
9a76c84
Create more
krlmlr Oct 2, 2021
5c9d900
Extract spec to separate files
krlmlr Oct 2, 2021
1dd8ff9
Indent
krlmlr Oct 2, 2021
3073b1b
Autogenerate specs
krlmlr Oct 2, 2021
2711397
Extract write_spec()
krlmlr Oct 3, 2021
0d45a98
Split
krlmlr Oct 3, 2021
175b08b
Character ID columns
krlmlr Oct 3, 2021
de699da
Refresh teams
krlmlr Oct 3, 2021
43c2789
Need .parser
krlmlr Oct 3, 2021
2b83750
Refresh spaces
krlmlr Oct 3, 2021
7176085
Tweak type of orderindex
krlmlr Oct 3, 2021
adff4e2
lcol_dtt
krlmlr Oct 3, 2021
afa2443
Get all folders
krlmlr Oct 3, 2021
94da951
Tweak
krlmlr Oct 3, 2021
24d88c2
Lists
krlmlr Oct 3, 2021
cabc4db
Tasks
krlmlr Oct 3, 2021
0d7372a
Refine spec
krlmlr Oct 3, 2021
912f6b2
More tasks
krlmlr Oct 3, 2021
9340f60
Refine spec
krlmlr Oct 3, 2021
d6b3458
Time entries
krlmlr Oct 3, 2021
74380df
Members
krlmlr Oct 3, 2021
996b720
Fix due date
krlmlr Oct 3, 2021
ff06b4a
Source all
krlmlr Oct 3, 2021
9ec6a31
Restore cuf_delete_*()
krlmlr Oct 3, 2021
9b4b9fb
Draft tests
krlmlr Oct 3, 2021
9f78efc
Add documentation
krlmlr Oct 3, 2021
9a77e8b
Better specs
krlmlr Oct 3, 2021
db885a4
Refine tasks
krlmlr Oct 3, 2021
49a5405
Oops
krlmlr Oct 3, 2021
da02b99
Refine
krlmlr Oct 3, 2021
154c7f6
Refine tasks
krlmlr Oct 3, 2021
2b78fd1
Refine
krlmlr Oct 3, 2021
b9599c0
Specify task
krlmlr Oct 3, 2021
e926ef8
Duration
krlmlr Oct 3, 2021
57c407f
Refine task
krlmlr Oct 4, 2021
6e1038c
Fix unstable API output
krlmlr Dec 12, 2021
75424d9
Cast
krlmlr Dec 12, 2021
a8dc4b9
lcol_int()
krlmlr Dec 12, 2021
9d729a6
Merge branch 'f-paging' into f-data-frame
krlmlr Dec 13, 2021
d70cad0
Merge branch 'master' into f-data-frame
krlmlr Jan 28, 2022
deb9cca
Allow missing profile picture
krlmlr Jan 28, 2022
70e13aa
More optional
krlmlr Jan 28, 2022
c9693db
Bump
krlmlr Jan 28, 2022
9a4ceda
Always enforce parsing as integer
krlmlr Apr 5, 2022
5ba94ac
Bump version
krlmlr Apr 5, 2022
0b40e45
Adapt to dev version of tibblify
krlmlr May 22, 2022
3e78377
Merge branch 'master' into f-data-frame
krlmlr May 22, 2022
44ccf20
Use new API for search + replace
krlmlr May 22, 2022
5032311
Tweak time entries without task
krlmlr May 23, 2022
63cdfbb
Type stability
krlmlr May 23, 2022
4633db2
README
krlmlr May 23, 2022
6f9ce8d
Cleanup
krlmlr May 23, 2022
7de2f80
Bump version
krlmlr May 23, 2022
48b3701
Need tib_scalar()
krlmlr May 23, 2022
033f194
Test-drive
krlmlr May 23, 2022
aa11fba
Bump version
krlmlr May 23, 2022
6ef89e2
Fix type for duration
krlmlr May 23, 2022
05955a7
Allow missing
krlmlr May 23, 2022
a11078f
Make loadable again
krlmlr Jul 2, 2022
1a7824a
Document
krlmlr Jul 2, 2022
64ca832
cu_date_to() gets tz argument
krlmlr Jul 2, 2022
3b1e7c7
Rename API
krlmlr Jul 2, 2022
7c2e64f
Remove names
krlmlr Jul 2, 2022
fa2b2d3
Teams
krlmlr Jul 2, 2022
e245537
Spaces
krlmlr Jul 2, 2022
9caa5dd
Folders
krlmlr Jul 2, 2022
499b642
Lists
krlmlr Jul 2, 2022
3c35959
Tasks
krlmlr Jul 2, 2022
d5518e5
Time entries
krlmlr Jul 2, 2022
34414d7
Members
krlmlr Jul 2, 2022
e631a1b
Bump version
krlmlr Jul 2, 2022
0cf1713
Up e-mail
krlmlr May 26, 2023
34848f3
Bump tibblify version
krlmlr May 26, 2023
d2535ae
Bump version
krlmlr May 26, 2023
db924b0
tib_custom()
krlmlr May 26, 2023
9bcbf4e
ptype_inner
krlmlr May 26, 2023
41f32f2
teams
krlmlr May 26, 2023
ba50983
spaces
krlmlr May 26, 2023
8afdeaa
folders
krlmlr May 26, 2023
13179eb
lists
krlmlr May 26, 2023
4c06a1a
tasks
krlmlr May 26, 2023
7d208ca
timetracking
krlmlr May 26, 2023
d5dc052
members
krlmlr May 26, 2023
70442ac
Merge branch 'b-not-paged' into f-data-frame
krlmlr Aug 20, 2023
c53951e
Un-remote
krlmlr Jan 1, 2024
91a3675
Fix type
krlmlr Jan 6, 2024
5d62c7b
Bump
krlmlr Jan 6, 2024
e0a73ce
New optional field
krlmlr Jan 19, 2024
5d5124a
New sub-record with all-optional values
krlmlr Jan 19, 2024
b8ba966
unspecified -> typed
krlmlr Jan 19, 2024
0cf7af6
Task locations
krlmlr Jan 19, 2024
27882e7
Align
krlmlr Jan 19, 2024
97b92a3
Fix drift
krlmlr Jan 19, 2024
2ab0e38
Support paging for cu_get_filtered_team_tasks()
krlmlr Jan 19, 2024
4cf8bf8
Derive specs from cu_get_filtered_team_tasks()
krlmlr Jan 19, 2024
cee9c24
Done
krlmlr Jan 19, 2024
40f798a
Bump version
krlmlr Jan 19, 2024
e569c0d
Don't page with paging = FALSE
krlmlr Jan 19, 2024
da8e15e
Bump version
krlmlr Jan 19, 2024
c4ba219
orderindex is a double
krlmlr Jan 21, 2024
ba9d64f
Bump version
krlmlr Jan 21, 2024
9cc34b2
orderindex
krlmlr Jan 21, 2024
f375bce
Bump version
krlmlr Jan 21, 2024
7b20731
Merge branch 'master' into f-data-frame
krlmlr Feb 1, 2024
ccdb4c2
Bump version
krlmlr Feb 1, 2024
0063f78
cu_token
krlmlr Feb 3, 2024
007d56b
Bump version
krlmlr Feb 3, 2024
2dc9198
Update schema definition
krlmlr Mar 11, 2024
9a5ff65
Bump version
krlmlr Mar 11, 2024
e4f3519
Document
krlmlr May 4, 2024
442211c
Add ... to cu_get_task() and cuf_get_task()
krlmlr May 4, 2024
b73b3e7
Bump
krlmlr May 4, 2024
6c57d61
Fix
krlmlr May 4, 2024
ac47209
Refine spec
krlmlr May 4, 2024
df2e327
Coerce logicals
krlmlr May 4, 2024
dfd0380
Include subtasks in spec
krlmlr May 4, 2024
061d7a0
Avoid LazyData
krlmlr May 4, 2024
23229e3
Bump
krlmlr May 9, 2024
c63246a
Tweak schema
krlmlr May 9, 2024
47b6f63
Bump
krlmlr May 9, 2024
b20d049
New structure for spaces
krlmlr Aug 7, 2024
c0318e4
Bump
krlmlr Aug 7, 2024
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
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
^CODE_OF_CONDUCT\.md$
^docs$
^_pkgdown\.yml$
^script$
28 changes: 19 additions & 9 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: clickrup
Type: Package
Package: clickrup
Title: Interacting with the ClickUp v2 API from R
Version: 0.0.6
Version: 0.0.6.9020
Date: 2021-12-12
Authors@R:
c(person(given = "Peter",
Expand All @@ -12,18 +12,28 @@ Authors@R:
person(given = "Kirill",
family = "M\u00fcller",
role = "aut",
email = "[email protected]"))
email = "[email protected]"))
Maintainer: Peter Solymos <[email protected]>
Description: Work with the ClickUp productivity app from R to
manage tasks, goals, time tracking, and more.
License: MIT + file LICENSE
LazyLoad: yes
LazyData: true
Imports: httr, jsonlite, rlang
Suggests: knitr
URL: https://github.com/psolymos/clickrup
BugReports: https://github.com/psolymos/clickrup/issues
VignetteBuilder: knitr
RoxygenNote: 7.2.3
Imports:
dttr2,
httr,
jsonlite,
rlang,
tibble,
tibblify (>= 0.3.0)
Suggests:
fansi,
knitr,
testthat (>= 3.0.0)
VignetteBuilder:
knitr
Config/testthat/edition: 3
Encoding: UTF-8
LazyLoad: yes
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
115 changes: 115 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,118 @@ export(cu_update_task)
export(cu_update_time_entry)
export(cu_update_view)
export(cu_update_webhook)
export(cuf_add_dependency)
export(cuf_add_guest_to_folder)
export(cuf_add_guest_to_list)
export(cuf_add_guest_to_task)
export(cuf_add_tag_to_task)
export(cuf_add_tags_from_time_entries)
export(cuf_add_task_link)
export(cuf_change_tag_names_from_time_entries)
export(cuf_create_checklist)
export(cuf_create_checklist_item)
export(cuf_create_folder)
export(cuf_create_folder_view)
export(cuf_create_folderless_list)
export(cuf_create_goal)
export(cuf_create_key_result)
export(cuf_create_list)
export(cuf_create_list_view)
export(cuf_create_space)
export(cuf_create_space_tag)
export(cuf_create_space_view)
export(cuf_create_task)
export(cuf_create_task_from_template)
export(cuf_create_team_view)
export(cuf_create_time_entry)
export(cuf_create_webhook)
export(cuf_delete_checklist)
export(cuf_delete_checklist_item)
export(cuf_delete_comment)
export(cuf_delete_dependency)
export(cuf_delete_folder)
export(cuf_delete_goal)
export(cuf_delete_key_result)
export(cuf_delete_list)
export(cuf_delete_space)
export(cuf_delete_space_tag)
export(cuf_delete_task)
export(cuf_delete_time_entry)
export(cuf_delete_time_tracked)
export(cuf_delete_view)
export(cuf_delete_webhook)
export(cuf_edit_checklist)
export(cuf_edit_checklist_item)
export(cuf_edit_guest_on_workspace)
export(cuf_edit_key_result)
export(cuf_edit_space_tag)
export(cuf_edit_time_tracked)
export(cuf_edit_user_on_workspace)
export(cuf_get_access_token)
export(cuf_get_accessible_custom_fields)
export(cuf_get_all_tags_from_time_entries)
export(cuf_get_authorized_teams)
export(cuf_get_authorized_user)
export(cuf_get_filtered_team_tasks)
export(cuf_get_folder)
export(cuf_get_folder_views)
export(cuf_get_folders)
export(cuf_get_goal)
export(cuf_get_goals)
export(cuf_get_guest)
export(cuf_get_list)
export(cuf_get_list_comments)
export(cuf_get_list_members)
export(cuf_get_list_views)
export(cuf_get_lists)
export(cuf_get_lists_folderless)
export(cuf_get_running_time_entry)
export(cuf_get_shared)
export(cuf_get_singular_time_entry)
export(cuf_get_space)
export(cuf_get_space_tags)
export(cuf_get_space_views)
export(cuf_get_spaces)
export(cuf_get_task)
export(cuf_get_task_comments)
export(cuf_get_task_members)
export(cuf_get_task_templates)
export(cuf_get_tasks)
export(cuf_get_team_views)
export(cuf_get_teams)
export(cuf_get_time_entries_within_date_range)
export(cuf_get_time_entry_history)
export(cuf_get_tracked_time)
export(cuf_get_user)
export(cuf_get_view)
export(cuf_get_view_comments)
export(cuf_get_view_tasks)
export(cuf_get_webhooks)
export(cuf_invite_guest_to_workspace)
export(cuf_invite_user_to_workspace)
export(cuf_post_list_comment)
export(cuf_post_task_attachment)
export(cuf_post_task_comment)
export(cuf_post_view_comment)
export(cuf_put_update_comment)
export(cuf_remove_field_value)
export(cuf_remove_guest_from_folder)
export(cuf_remove_guest_from_list)
export(cuf_remove_guest_from_task)
export(cuf_remove_guest_from_workspace)
export(cuf_remove_tags_from_time_entries)
export(cuf_remove_user_from_workspace)
export(cuf_set_custom_field_value)
export(cuf_start_time_entry)
export(cuf_stop_time_entry)
export(cuf_track_time)
export(cuf_update_folder)
export(cuf_update_goal)
export(cuf_update_list)
export(cuf_update_space)
export(cuf_update_task)
export(cuf_update_time_entry)
export(cuf_update_view)
export(cuf_update_webhook)
import(tibble)
import(tibblify)
14 changes: 14 additions & 0 deletions R/aaa.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
tib_custom <- function(key, transform, required = TRUE) {
# https://github.com/mgirlich/tibblify/issues/183

transform <- rlang::as_function(transform)
ptype <- transform(character())

tib_scalar(
key,
ptype,
ptype_inner = character(),
transform = transform,
required = required
)
}
4 changes: 2 additions & 2 deletions R/api-tasks.R
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ cu_get_tasks <- function(list_id, archived=FALSE, ..., cu_token = NULL) {
## task_id
## Example: 9hz.
## String
cu_get_task <- function(task_id, cu_token = NULL) {
cu_get_task <- function(task_id, ..., cu_token = NULL) {
task_id <- cu_task_id(task_id)
.cu_get("task", task_id, cu_token = cu_token)
.cu_get("task", task_id, query = list(...), cu_token = cu_token)
}


Expand Down
5 changes: 4 additions & 1 deletion R/cu-date.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ cu_date_from <- function(ms, tz = NULL, ...) {
#' @export
#' @rdname cu-date
## turning POSIXct to unix time
cu_date_to <- function(dt) {
cu_date_to <- function(dt, tz = NULL) {
if (is.null(tz))
tz <- getOption("cu_options")$tz

as.character(round(unclass(as.POSIXct(dt))*1000))
}
4 changes: 4 additions & 0 deletions R/cu-get-all-team-tasks.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#'
#' The wrapper function uses [cu_get_filtered_team_tasks()]
#' but takes care of paging.
#' No longer needed because paging is now handled automatically for all functions,
#' including [cu_get_filtered_team_tasks()].
#'
#' @param team_id Team ID of tasks.
#' @param ... All query parameters for [cu_get_filtered_team_tasks()]
Expand All @@ -20,6 +22,8 @@

## include_closed = FALSE by default
cu_get_all_team_tasks <- function(team_id, ...) {
.Deprecated("cu_get_filtered_team_tasks")

p <- 0
done <- FALSE
out <- list(tasks=NULL)
Expand Down
26 changes: 26 additions & 0 deletions R/df-attachments.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

#' @export
#' @rdname api-attachment


cuf_post_task_attachment <- function(task_id, attachment, filename=NULL, ...) {
task_id <- cu_task_id(task_id)
if (is.null(filename))
filename <- basename(attachment)
resp <- httr::POST(
httr::modify_url(getOption("cu_options")$baseurl,
path = .cu_path("task", task_id, "attachment")),
httr::add_headers(
Authorization = cu_get_pat(),
"Content-Type" = "multipart/form-data"),
httr::accept_json(),
body=list(
filename=filename,
attachment=httr::upload_file(attachment, ...)),
encode="multipart",
httr::user_agent(getOption("cu_options")$useragent))
cont <- .cu_process(resp)
class(cont) <- c(class(cont), "cu_post")
cont
}

26 changes: 26 additions & 0 deletions R/df-authorization.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

#' @rdname api-authorization
NULL

#' @export
#' @rdname api-authorization
cuf_get_access_token <- function(client_id, client_secret, code) {
.cu_post("oauth", "token",
query=list(client_id=client_id,
client_secret=client_secret,
code=code))
}


#' @export
#' @rdname api-authorization
cuf_get_authorized_user <- function() {
.cu_get("user")
}


#' @export
#' @rdname api-authorization
cuf_get_authorized_teams <- function() {
.cu_get("team")
}
65 changes: 65 additions & 0 deletions R/df-checklists.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

#' @rdname api-checklists
NULL

#' @export
#' @rdname api-checklists
cuf_create_checklist <- function(task_id, name) {
task_id <- cu_task_id(task_id)
.cu_post("task", task_id, "checklist",
body=list(name = name))
}
#cu_create_checklist("8ach57", "New checklist")


#' @export
#' @rdname api-checklists
cuf_edit_checklist <- function(checklist_id, position) {
.cu_put("checklist", checklist_id,
body=list(position = position))
}
#cu_edit_checklist("4bc57892-a1a6-44f4-894d-d98de71f4054", 0)


#' @export
#' @rdname api-checklists
cuf_delete_checklist <- function(checklist_id) {
.cu_delete("checklist", checklist_id)
}
#cu_delete_checklist("4bc57892-a1a6-44f4-894d-d98de71f4054")


#' @export
#' @rdname api-checklists
cuf_create_checklist_item <- function(checklist_id, name, ...) {
.cu_post("checklist", checklist_id, "checklist_item",
body=list(name = name, ...))
}
#cu_create_checklist_item("40146d1e-efe5-4140-a0ba-ad39c9dec18c",
# name="New item 1")
#cu_create_checklist_item("40146d1e-efe5-4140-a0ba-ad39c9dec18c",
# name="New item 2", assignee=4471793)
#cu_create_checklist_item("40146d1e-efe5-4140-a0ba-ad39c9dec18c",
# name="New item 3",
# assignee=NA, resolved=TRUE, parent=NA)


#' @export
#' @rdname api-checklists
cuf_edit_checklist_item <- function(checklist_id, checklist_item_id, ...) {
.cu_put("checklist", checklist_id, "checklist_item", checklist_item_id,
body=list(...))
}
#cu_put_edit_checklist_item("40146d1e-efe5-4140-a0ba-ad39c9dec18c",
# "8849fcba-9db4-4400-a78e-cfced2ae6ce0",
# name="Renamed to that", resolved=TRUE)


#' @export
#' @rdname api-checklists
cuf_delete_checklist_item <- function(checklist_id, checklist_item_id) {
.cu_delete("checklist", checklist_id, "checklist_item", checklist_item_id)
}
#cu_delete_checklist_item("40146d1e-efe5-4140-a0ba-ad39c9dec18c",
# "8849fcba-9db4-4400-a78e-cfced2ae6ce0")

Loading
Loading