basecamp-sdk 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/basecamp/client.rb +5 -0
- data/lib/basecamp/generated/metadata.json +54 -1
- data/lib/basecamp/generated/services/base_service.rb +13 -0
- data/lib/basecamp/generated/services/campfires_service.rb +2 -2
- data/lib/basecamp/generated/services/card_columns_service.rb +3 -3
- data/lib/basecamp/generated/services/checkins_service.rb +5 -4
- data/lib/basecamp/generated/services/client_approvals_service.rb +1 -1
- data/lib/basecamp/generated/services/client_correspondences_service.rb +1 -1
- data/lib/basecamp/generated/services/documents_service.rb +3 -2
- data/lib/basecamp/generated/services/forwards_service.rb +1 -1
- data/lib/basecamp/generated/services/gauges_service.rb +4 -4
- data/lib/basecamp/generated/services/messages_service.rb +4 -3
- data/lib/basecamp/generated/services/my_assignments_service.rb +1 -1
- data/lib/basecamp/generated/services/my_notifications_service.rb +1 -1
- data/lib/basecamp/generated/services/people_service.rb +2 -2
- data/lib/basecamp/generated/services/projects_service.rb +2 -2
- data/lib/basecamp/generated/services/recordings_service.rb +1 -1
- data/lib/basecamp/generated/services/reports_service.rb +2 -2
- data/lib/basecamp/generated/services/schedules_service.rb +5 -4
- data/lib/basecamp/generated/services/search_service.rb +14 -3
- data/lib/basecamp/generated/services/templates_service.rb +4 -5
- data/lib/basecamp/generated/services/timesheets_service.rb +3 -3
- data/lib/basecamp/generated/services/todolists_service.rb +15 -3
- data/lib/basecamp/generated/services/todos_service.rb +1 -1
- data/lib/basecamp/generated/services/tools_service.rb +1 -1
- data/lib/basecamp/generated/services/uploads_service.rb +3 -2
- data/lib/basecamp/generated/services/webhooks_service.rb +2 -2
- data/lib/basecamp/generated/services/wormholes_service.rb +44 -0
- data/lib/basecamp/generated/types.rb +254 -58
- data/lib/basecamp/version.rb +2 -2
- data/scripts/generate-services.rb +24 -10
- data/scripts/generate-types.rb +33 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e872009b6b4862fca29c9f3d432d1b60c6629b77d6f3a293983b56bb0afc249a
|
|
4
|
+
data.tar.gz: 3aa007580b800dde800072fb5b13ef21cc619800194f1a0c1d34f3d76db85ba8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e229aad8ab09a80b14abf54abce5d4d205c71b3b2ad2105cd03a3a152ba4d6ee5eefc5d5538bbd6ebf4dda0892fb9073a92e9cd4334d76521533f08c2e47320f
|
|
7
|
+
data.tar.gz: ac047d82d5997039b26db6b1848cd151bb662c96837210c233614fdb4e170ee65daad81cf6048d5f3656468bafacad4327f2117c6556c3629973b0470c420087
|
data/README.md
CHANGED
|
@@ -179,7 +179,7 @@ aborts before an oversized body is buffered.
|
|
|
179
179
|
|
|
180
180
|
## Services
|
|
181
181
|
|
|
182
|
-
The SDK provides
|
|
182
|
+
The SDK provides 45 account-scoped services. The table below covers the common ones; see `lib/basecamp/generated/services/` for the authoritative, complete set:
|
|
183
183
|
|
|
184
184
|
| Service | Description |
|
|
185
185
|
|---------|-------------|
|
|
@@ -210,6 +210,7 @@ The SDK provides 37 services covering the complete Basecamp API:
|
|
|
210
210
|
| `card_tables` | Card tables (kanban) |
|
|
211
211
|
| `card_columns` | Card table columns |
|
|
212
212
|
| `card_steps` | Card workflow steps |
|
|
213
|
+
| `wormholes` | Card table wormholes (cross-project moves) |
|
|
213
214
|
| `lineup` | Card lineup view |
|
|
214
215
|
| `tools` | Project dock tools |
|
|
215
216
|
| `search` | Full-text search |
|
data/lib/basecamp/client.rb
CHANGED
|
@@ -431,6 +431,11 @@ module Basecamp
|
|
|
431
431
|
service(:card_steps) { Services::CardStepsService.new(self) }
|
|
432
432
|
end
|
|
433
433
|
|
|
434
|
+
# @return [Services::WormholesService]
|
|
435
|
+
def wormholes
|
|
436
|
+
service(:wormholes) { Services::WormholesService.new(self) }
|
|
437
|
+
end
|
|
438
|
+
|
|
434
439
|
# @return [Services::TemplatesService]
|
|
435
440
|
def templates
|
|
436
441
|
service(:templates) { Services::TemplatesService.new(self) }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://basecamp.com/schemas/sdk-metadata.json",
|
|
3
3
|
"version": "1.0.0",
|
|
4
|
-
"generated": "2026-07-
|
|
4
|
+
"generated": "2026-07-23T19:34:23Z",
|
|
5
5
|
"operations": {
|
|
6
6
|
"GetAccount": {
|
|
7
7
|
"retry": {
|
|
@@ -131,6 +131,45 @@
|
|
|
131
131
|
"natural": true
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
|
+
"UpdateWormhole": {
|
|
135
|
+
"retry": {
|
|
136
|
+
"maxAttempts": 3,
|
|
137
|
+
"baseDelayMs": 1000,
|
|
138
|
+
"backoff": "exponential",
|
|
139
|
+
"retryOn": [
|
|
140
|
+
429,
|
|
141
|
+
503
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
"idempotent": {
|
|
145
|
+
"natural": true
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"DeleteWormhole": {
|
|
149
|
+
"retry": {
|
|
150
|
+
"maxAttempts": 3,
|
|
151
|
+
"baseDelayMs": 1000,
|
|
152
|
+
"backoff": "exponential",
|
|
153
|
+
"retryOn": [
|
|
154
|
+
429,
|
|
155
|
+
503
|
|
156
|
+
]
|
|
157
|
+
},
|
|
158
|
+
"idempotent": {
|
|
159
|
+
"natural": true
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"CreateWormhole": {
|
|
163
|
+
"retry": {
|
|
164
|
+
"maxAttempts": 2,
|
|
165
|
+
"baseDelayMs": 1000,
|
|
166
|
+
"backoff": "exponential",
|
|
167
|
+
"retryOn": [
|
|
168
|
+
429,
|
|
169
|
+
503
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
},
|
|
134
173
|
"CreateTool": {
|
|
135
174
|
"retry": {
|
|
136
175
|
"maxAttempts": 2,
|
|
@@ -2413,6 +2452,20 @@
|
|
|
2413
2452
|
"natural": true
|
|
2414
2453
|
}
|
|
2415
2454
|
},
|
|
2455
|
+
"RepositionTodolist": {
|
|
2456
|
+
"retry": {
|
|
2457
|
+
"maxAttempts": 3,
|
|
2458
|
+
"baseDelayMs": 1000,
|
|
2459
|
+
"backoff": "exponential",
|
|
2460
|
+
"retryOn": [
|
|
2461
|
+
429,
|
|
2462
|
+
503
|
|
2463
|
+
]
|
|
2464
|
+
},
|
|
2465
|
+
"idempotent": {
|
|
2466
|
+
"natural": true
|
|
2467
|
+
}
|
|
2468
|
+
},
|
|
2416
2469
|
"GetTodoset": {
|
|
2417
2470
|
"retry": {
|
|
2418
2471
|
"maxAttempts": 3,
|
|
@@ -141,6 +141,19 @@ module Basecamp
|
|
|
141
141
|
kwargs.compact
|
|
142
142
|
end
|
|
143
143
|
|
|
144
|
+
# Like compact_params, but also drops empty arrays. For query filters an
|
|
145
|
+
# empty array means "no filter" and must be omitted entirely: Faraday's
|
|
146
|
+
# nested encoder would otherwise emit a bare `bucket_ids[]`, which Rails
|
|
147
|
+
# normalizes into a bogus `[0]` filter instead of the unfiltered request
|
|
148
|
+
# the caller intended. Not used for request bodies, where an explicit
|
|
149
|
+
# empty array (e.g. clearing a list) can be meaningful.
|
|
150
|
+
#
|
|
151
|
+
# @param hash [Hash] the input hash
|
|
152
|
+
# @return [Hash] hash with nil values and empty arrays removed
|
|
153
|
+
def compact_query_params(**kwargs)
|
|
154
|
+
kwargs.reject { |_, value| value.nil? || value == [] }
|
|
155
|
+
end
|
|
156
|
+
|
|
144
157
|
# Build a bucket (project) path.
|
|
145
158
|
# @param project_id [Integer, String] the project/bucket ID
|
|
146
159
|
# @param path [String] the path suffix
|
|
@@ -86,7 +86,7 @@ module Basecamp
|
|
|
86
86
|
# @return [Enumerator<Hash>] paginated results
|
|
87
87
|
def list_lines(campfire_id:, sort: nil, direction: nil)
|
|
88
88
|
wrap_paginated(service: "campfires", operation: "list_lines", is_mutation: false, resource_id: campfire_id) do
|
|
89
|
-
params =
|
|
89
|
+
params = compact_query_params(sort: sort, direction: direction)
|
|
90
90
|
paginate("/chats/#{campfire_id}/lines.json", params: params)
|
|
91
91
|
end
|
|
92
92
|
end
|
|
@@ -142,7 +142,7 @@ module Basecamp
|
|
|
142
142
|
# @return [Enumerator<Hash>] paginated results
|
|
143
143
|
def list_uploads(campfire_id:, sort: nil, direction: nil)
|
|
144
144
|
wrap_paginated(service: "campfires", operation: "list_uploads", is_mutation: false, resource_id: campfire_id) do
|
|
145
|
-
params =
|
|
145
|
+
params = compact_query_params(sort: sort, direction: direction)
|
|
146
146
|
paginate("/chats/#{campfire_id}/uploads.json", params: params)
|
|
147
147
|
end
|
|
148
148
|
end
|
|
@@ -13,7 +13,7 @@ module Basecamp
|
|
|
13
13
|
# @param color [String] Valid colors: white, red, orange, yellow, green, blue, aqua, purple, gray, pink, brown
|
|
14
14
|
# @return [Hash] response data
|
|
15
15
|
def set_color(bucket_id:, column_id:, color:)
|
|
16
|
-
with_operation(service: "cardcolumns", operation: "set_color", is_mutation: true, resource_id: column_id) do
|
|
16
|
+
with_operation(service: "cardcolumns", operation: "set_color", is_mutation: true, project_id: bucket_id, resource_id: column_id) do
|
|
17
17
|
http_put("/buckets/#{bucket_id}/card_tables/columns/#{column_id}/color.json", body: compact_params(color: color)).json
|
|
18
18
|
end
|
|
19
19
|
end
|
|
@@ -23,7 +23,7 @@ module Basecamp
|
|
|
23
23
|
# @param column_id [Integer] column id ID
|
|
24
24
|
# @return [Hash] response data
|
|
25
25
|
def enable_on_hold(bucket_id:, column_id:)
|
|
26
|
-
with_operation(service: "cardcolumns", operation: "enable_on_hold", is_mutation: true, resource_id: column_id) do
|
|
26
|
+
with_operation(service: "cardcolumns", operation: "enable_on_hold", is_mutation: true, project_id: bucket_id, resource_id: column_id) do
|
|
27
27
|
http_post("/buckets/#{bucket_id}/card_tables/columns/#{column_id}/on_hold.json").json
|
|
28
28
|
end
|
|
29
29
|
end
|
|
@@ -33,7 +33,7 @@ module Basecamp
|
|
|
33
33
|
# @param column_id [Integer] column id ID
|
|
34
34
|
# @return [Hash] response data
|
|
35
35
|
def disable_on_hold(bucket_id:, column_id:)
|
|
36
|
-
with_operation(service: "cardcolumns", operation: "disable_on_hold", is_mutation: true, resource_id: column_id) do
|
|
36
|
+
with_operation(service: "cardcolumns", operation: "disable_on_hold", is_mutation: true, project_id: bucket_id, resource_id: column_id) do
|
|
37
37
|
http_delete("/buckets/#{bucket_id}/card_tables/columns/#{column_id}/on_hold.json").json
|
|
38
38
|
end
|
|
39
39
|
end
|
|
@@ -57,11 +57,12 @@ module Basecamp
|
|
|
57
57
|
# Create a new question in a questionnaire
|
|
58
58
|
# @param questionnaire_id [Integer] questionnaire id ID
|
|
59
59
|
# @param title [String] title
|
|
60
|
-
# @param schedule [
|
|
60
|
+
# @param schedule [Hash] schedule
|
|
61
|
+
# @param visible_to_clients [Boolean, nil] visible to clients
|
|
61
62
|
# @return [Hash] response data
|
|
62
|
-
def create_question(questionnaire_id:, title:, schedule:)
|
|
63
|
+
def create_question(questionnaire_id:, title:, schedule:, visible_to_clients: nil)
|
|
63
64
|
with_operation(service: "checkins", operation: "create_question", is_mutation: true, resource_id: questionnaire_id) do
|
|
64
|
-
http_post("/questionnaires/#{questionnaire_id}/questions.json", body: compact_params(title: title, schedule: schedule)).json
|
|
65
|
+
http_post("/questionnaires/#{questionnaire_id}/questions.json", body: compact_params(title: title, schedule: schedule, visible_to_clients: visible_to_clients)).json
|
|
65
66
|
end
|
|
66
67
|
end
|
|
67
68
|
|
|
@@ -77,7 +78,7 @@ module Basecamp
|
|
|
77
78
|
# Update an existing question
|
|
78
79
|
# @param question_id [Integer] question id ID
|
|
79
80
|
# @param title [String, nil] title
|
|
80
|
-
# @param schedule [
|
|
81
|
+
# @param schedule [Hash, nil] schedule
|
|
81
82
|
# @param paused [Boolean, nil] paused
|
|
82
83
|
# @return [Hash] response data
|
|
83
84
|
def update_question(question_id:, title: nil, schedule: nil, paused: nil)
|
|
@@ -13,7 +13,7 @@ module Basecamp
|
|
|
13
13
|
# @return [Enumerator<Hash>] paginated results
|
|
14
14
|
def list(sort: nil, direction: nil)
|
|
15
15
|
wrap_paginated(service: "clientapprovals", operation: "list", is_mutation: false) do
|
|
16
|
-
params =
|
|
16
|
+
params = compact_query_params(sort: sort, direction: direction)
|
|
17
17
|
paginate("/client/approvals.json", params: params)
|
|
18
18
|
end
|
|
19
19
|
end
|
|
@@ -13,7 +13,7 @@ module Basecamp
|
|
|
13
13
|
# @return [Enumerator<Hash>] paginated results
|
|
14
14
|
def list(sort: nil, direction: nil)
|
|
15
15
|
wrap_paginated(service: "clientcorrespondences", operation: "list", is_mutation: false) do
|
|
16
|
-
params =
|
|
16
|
+
params = compact_query_params(sort: sort, direction: direction)
|
|
17
17
|
paginate("/client/correspondences.json", params: params)
|
|
18
18
|
end
|
|
19
19
|
end
|
|
@@ -42,10 +42,11 @@ module Basecamp
|
|
|
42
42
|
# @param content [String, nil] content
|
|
43
43
|
# @param status [String, nil] active|drafted
|
|
44
44
|
# @param subscriptions [Array, nil] subscriptions
|
|
45
|
+
# @param visible_to_clients [Boolean, nil] visible to clients
|
|
45
46
|
# @return [Hash] response data
|
|
46
|
-
def create(vault_id:, title:, content: nil, status: nil, subscriptions: nil)
|
|
47
|
+
def create(vault_id:, title:, content: nil, status: nil, subscriptions: nil, visible_to_clients: nil)
|
|
47
48
|
with_operation(service: "documents", operation: "create", is_mutation: true, resource_id: vault_id) do
|
|
48
|
-
http_post("/vaults/#{vault_id}/documents.json", body: compact_params(title: title, content: content, status: status, subscriptions: subscriptions)).json
|
|
49
|
+
http_post("/vaults/#{vault_id}/documents.json", body: compact_params(title: title, content: content, status: status, subscriptions: subscriptions, visible_to_clients: visible_to_clients)).json
|
|
49
50
|
end
|
|
50
51
|
end
|
|
51
52
|
end
|
|
@@ -61,7 +61,7 @@ module Basecamp
|
|
|
61
61
|
# @return [Enumerator<Hash>] paginated results
|
|
62
62
|
def list(inbox_id:, sort: nil, direction: nil)
|
|
63
63
|
wrap_paginated(service: "forwards", operation: "list", is_mutation: false, resource_id: inbox_id) do
|
|
64
|
-
params =
|
|
64
|
+
params = compact_query_params(sort: sort, direction: direction)
|
|
65
65
|
paginate("/inboxes/#{inbox_id}/forwards.json", params: params)
|
|
66
66
|
end
|
|
67
67
|
end
|
|
@@ -18,7 +18,7 @@ module Basecamp
|
|
|
18
18
|
|
|
19
19
|
# Update a gauge needle's description. Position and color are immutable.
|
|
20
20
|
# @param needle_id [Integer] needle id ID
|
|
21
|
-
# @param gauge_needle [
|
|
21
|
+
# @param gauge_needle [Hash, nil] gauge needle
|
|
22
22
|
# @return [Hash] response data
|
|
23
23
|
def update_gauge_needle(needle_id:, gauge_needle: nil)
|
|
24
24
|
with_operation(service: "gauges", operation: "update_gauge_needle", is_mutation: true, resource_id: needle_id) do
|
|
@@ -38,7 +38,7 @@ module Basecamp
|
|
|
38
38
|
|
|
39
39
|
# Enable or disable the gauge for a project. Only project admins can toggle gauges.
|
|
40
40
|
# @param project_id [Integer] project id ID
|
|
41
|
-
# @param gauge [
|
|
41
|
+
# @param gauge [Hash] gauge
|
|
42
42
|
# @return [void]
|
|
43
43
|
def toggle_gauge(project_id:, gauge:)
|
|
44
44
|
with_operation(service: "gauges", operation: "toggle_gauge", is_mutation: true, project_id: project_id) do
|
|
@@ -58,7 +58,7 @@ module Basecamp
|
|
|
58
58
|
|
|
59
59
|
# Create a gauge needle (progress update) for a project
|
|
60
60
|
# @param project_id [Integer] project id ID
|
|
61
|
-
# @param gauge_needle [
|
|
61
|
+
# @param gauge_needle [Hash] gauge needle
|
|
62
62
|
# @param notify [String, nil] Who to notify: "everyone", "working_on", "custom", or omit for nobody
|
|
63
63
|
# @param subscriptions [Array, nil] Array of people IDs to notify (only used when notify is "custom")
|
|
64
64
|
# @return [Hash] response data
|
|
@@ -74,7 +74,7 @@ module Basecamp
|
|
|
74
74
|
# @return [Enumerator<Hash>] paginated results
|
|
75
75
|
def list_gauges(bucket_ids: nil)
|
|
76
76
|
wrap_paginated(service: "gauges", operation: "list_gauges", is_mutation: false) do
|
|
77
|
-
params =
|
|
77
|
+
params = compact_query_params(bucket_ids: bucket_ids)
|
|
78
78
|
paginate("/reports/gauges.json", params: params)
|
|
79
79
|
end
|
|
80
80
|
end
|
|
@@ -14,7 +14,7 @@ module Basecamp
|
|
|
14
14
|
# @return [Enumerator<Hash>] paginated results
|
|
15
15
|
def list(board_id:, sort: nil, direction: nil)
|
|
16
16
|
wrap_paginated(service: "messages", operation: "list", is_mutation: false, resource_id: board_id) do
|
|
17
|
-
params =
|
|
17
|
+
params = compact_query_params(sort: sort, direction: direction)
|
|
18
18
|
paginate("/message_boards/#{board_id}/messages.json", params: params)
|
|
19
19
|
end
|
|
20
20
|
end
|
|
@@ -26,10 +26,11 @@ module Basecamp
|
|
|
26
26
|
# @param status [String, nil] active|drafted
|
|
27
27
|
# @param category_id [Integer, nil] category id
|
|
28
28
|
# @param subscriptions [Array, nil] subscriptions
|
|
29
|
+
# @param visible_to_clients [Boolean, nil] visible to clients
|
|
29
30
|
# @return [Hash] response data
|
|
30
|
-
def create(board_id:, subject:, content: nil, status: nil, category_id: nil, subscriptions: nil)
|
|
31
|
+
def create(board_id:, subject:, content: nil, status: nil, category_id: nil, subscriptions: nil, visible_to_clients: nil)
|
|
31
32
|
with_operation(service: "messages", operation: "create", is_mutation: true, resource_id: board_id) do
|
|
32
|
-
http_post("/message_boards/#{board_id}/messages.json", body: compact_params(subject: subject, content: content, status: status, category_id: category_id, subscriptions: subscriptions)).json
|
|
33
|
+
http_post("/message_boards/#{board_id}/messages.json", body: compact_params(subject: subject, content: content, status: status, category_id: category_id, subscriptions: subscriptions, visible_to_clients: visible_to_clients)).json
|
|
33
34
|
end
|
|
34
35
|
end
|
|
35
36
|
|
|
@@ -29,7 +29,7 @@ module Basecamp
|
|
|
29
29
|
# @return [Hash] response data
|
|
30
30
|
def get_my_due_assignments(scope: nil)
|
|
31
31
|
with_operation(service: "myassignments", operation: "get_my_due_assignments", is_mutation: false) do
|
|
32
|
-
http_get("/my/assignments/due.json", params:
|
|
32
|
+
http_get("/my/assignments/due.json", params: compact_query_params(scope: scope)).json
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
end
|
|
@@ -12,7 +12,7 @@ module Basecamp
|
|
|
12
12
|
# @return [Hash] response data
|
|
13
13
|
def get_my_notifications(page: nil)
|
|
14
14
|
with_operation(service: "mynotifications", operation: "get_my_notifications", is_mutation: false) do
|
|
15
|
-
http_get("/my/readings.json", params:
|
|
15
|
+
http_get("/my/readings.json", params: compact_query_params(page: page)).json
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
|
|
@@ -24,7 +24,7 @@ module Basecamp
|
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
# Update the current user's preferences
|
|
27
|
-
# @param person [
|
|
27
|
+
# @param person [Hash] person
|
|
28
28
|
# @return [Hash] response data
|
|
29
29
|
def update_my_preferences(person:)
|
|
30
30
|
with_operation(service: "people", operation: "update_my_preferences", is_mutation: true) do
|
|
@@ -85,7 +85,7 @@ module Basecamp
|
|
|
85
85
|
|
|
86
86
|
# Enable or replace out of office for a person.
|
|
87
87
|
# @param person_id [Integer] person id ID
|
|
88
|
-
# @param out_of_office [
|
|
88
|
+
# @param out_of_office [Hash] out of office
|
|
89
89
|
# @return [Hash] response data
|
|
90
90
|
def enable_out_of_office(person_id:, out_of_office:)
|
|
91
91
|
with_operation(service: "people", operation: "enable_out_of_office", is_mutation: true, resource_id: person_id) do
|
|
@@ -12,7 +12,7 @@ module Basecamp
|
|
|
12
12
|
# @return [Enumerator<Hash>] paginated results
|
|
13
13
|
def list(status: nil)
|
|
14
14
|
wrap_paginated(service: "projects", operation: "list", is_mutation: false) do
|
|
15
|
-
params =
|
|
15
|
+
params = compact_query_params(status: status)
|
|
16
16
|
paginate("/projects.json", params: params)
|
|
17
17
|
end
|
|
18
18
|
end
|
|
@@ -41,7 +41,7 @@ module Basecamp
|
|
|
41
41
|
# @param name [String] name
|
|
42
42
|
# @param description [String, nil] description
|
|
43
43
|
# @param admissions [String, nil] invite|employee|team
|
|
44
|
-
# @param schedule_attributes [
|
|
44
|
+
# @param schedule_attributes [Hash, nil] schedule attributes
|
|
45
45
|
# @return [Hash] response data
|
|
46
46
|
def update(project_id:, name:, description: nil, admissions: nil, schedule_attributes: nil)
|
|
47
47
|
with_operation(service: "projects", operation: "update", is_mutation: true, project_id: project_id) do
|
|
@@ -16,7 +16,7 @@ module Basecamp
|
|
|
16
16
|
# @return [Enumerator<Hash>] paginated results
|
|
17
17
|
def list(type:, bucket: nil, status: nil, sort: nil, direction: nil)
|
|
18
18
|
wrap_paginated(service: "recordings", operation: "list", is_mutation: false) do
|
|
19
|
-
params =
|
|
19
|
+
params = compact_query_params(type: type, bucket: bucket, status: status, sort: sort, direction: direction)
|
|
20
20
|
paginate("/projects/recordings.json", params: params)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
@@ -21,7 +21,7 @@ module Basecamp
|
|
|
21
21
|
# @return [Hash] response data
|
|
22
22
|
def upcoming(window_starts_on: nil, window_ends_on: nil)
|
|
23
23
|
with_operation(service: "reports", operation: "upcoming", is_mutation: false) do
|
|
24
|
-
http_get("/reports/schedules/upcoming.json", params:
|
|
24
|
+
http_get("/reports/schedules/upcoming.json", params: compact_query_params(window_starts_on: window_starts_on, window_ends_on: window_ends_on)).json
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
|
|
@@ -31,7 +31,7 @@ module Basecamp
|
|
|
31
31
|
# @return [Hash] response data
|
|
32
32
|
def assigned(person_id:, group_by: nil)
|
|
33
33
|
with_operation(service: "reports", operation: "assigned", is_mutation: false, resource_id: person_id) do
|
|
34
|
-
http_get("/reports/todos/assigned/#{person_id}", params:
|
|
34
|
+
http_get("/reports/todos/assigned/#{person_id}", params: compact_query_params(group_by: group_by)).json
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
|
|
@@ -37,7 +37,7 @@ module Basecamp
|
|
|
37
37
|
# @param date [String] date ID
|
|
38
38
|
# @return [Hash] response data
|
|
39
39
|
def get_entry_occurrence(entry_id:, date:)
|
|
40
|
-
with_operation(service: "schedules", operation: "get_entry_occurrence", is_mutation: false, resource_id:
|
|
40
|
+
with_operation(service: "schedules", operation: "get_entry_occurrence", is_mutation: false, resource_id: entry_id) do
|
|
41
41
|
http_get("/schedule_entries/#{entry_id}/occurrences/#{date}").json
|
|
42
42
|
end
|
|
43
43
|
end
|
|
@@ -67,7 +67,7 @@ module Basecamp
|
|
|
67
67
|
# @return [Enumerator<Hash>] paginated results
|
|
68
68
|
def list_entries(schedule_id:, status: nil)
|
|
69
69
|
wrap_paginated(service: "schedules", operation: "list_entries", is_mutation: false, resource_id: schedule_id) do
|
|
70
|
-
params =
|
|
70
|
+
params = compact_query_params(status: status)
|
|
71
71
|
paginate("/schedules/#{schedule_id}/entries.json", params: params)
|
|
72
72
|
end
|
|
73
73
|
end
|
|
@@ -82,10 +82,11 @@ module Basecamp
|
|
|
82
82
|
# @param all_day [Boolean, nil] all day
|
|
83
83
|
# @param notify [Boolean, nil] notify
|
|
84
84
|
# @param subscriptions [Array, nil] subscriptions
|
|
85
|
+
# @param visible_to_clients [Boolean, nil] visible to clients
|
|
85
86
|
# @return [Hash] response data
|
|
86
|
-
def create_entry(schedule_id:, summary:, starts_at:, ends_at:, description: nil, participant_ids: nil, all_day: nil, notify: nil, subscriptions: nil)
|
|
87
|
+
def create_entry(schedule_id:, summary:, starts_at:, ends_at:, description: nil, participant_ids: nil, all_day: nil, notify: nil, subscriptions: nil, visible_to_clients: nil)
|
|
87
88
|
with_operation(service: "schedules", operation: "create_entry", is_mutation: true, resource_id: schedule_id) do
|
|
88
|
-
http_post("/schedules/#{schedule_id}/entries.json", body: compact_params(summary: summary, starts_at: starts_at, ends_at: ends_at, description: description, participant_ids: participant_ids, all_day: all_day, notify: notify, subscriptions: subscriptions)).json
|
|
89
|
+
http_post("/schedules/#{schedule_id}/entries.json", body: compact_params(summary: summary, starts_at: starts_at, ends_at: ends_at, description: description, participant_ids: participant_ids, all_day: all_day, notify: notify, subscriptions: subscriptions, visible_to_clients: visible_to_clients)).json
|
|
89
90
|
end
|
|
90
91
|
end
|
|
91
92
|
end
|
|
@@ -9,11 +9,22 @@ module Basecamp
|
|
|
9
9
|
|
|
10
10
|
# Search for content across the account
|
|
11
11
|
# @param q [String] q
|
|
12
|
-
# @param
|
|
12
|
+
# @param type_names [Array, nil] Recording types to include. Use `key` values from the metadata
|
|
13
|
+
# endpoint's `recording_search_types`. Available since Basecamp 5.
|
|
14
|
+
# @param bucket_ids [Array, nil] Project IDs to filter by. Available since Basecamp 5.
|
|
15
|
+
# @param creator_ids [Array, nil] Creator person IDs to filter by. Available since Basecamp 5.
|
|
16
|
+
# @param file_type [String, nil] Filter attachments by type. Use `key` values from the metadata
|
|
17
|
+
# endpoint's `file_search_types`.
|
|
18
|
+
# @param exclude_chat [Boolean, nil] Set to true to exclude chat results.
|
|
19
|
+
# @param since [String, nil] last_7_days|last_30_days|last_90_days|last_12_months|forever
|
|
20
|
+
# @param sort [String, nil] best_match|recency
|
|
21
|
+
# @param type [String, nil] Deprecated: prefer type_names[].
|
|
22
|
+
# @param bucket_id [Integer, nil] Deprecated: prefer bucket_ids[].
|
|
23
|
+
# @param creator_id [Integer, nil] Deprecated: prefer creator_ids[].
|
|
13
24
|
# @return [Enumerator<Hash>] paginated results
|
|
14
|
-
def search(q:, sort: nil)
|
|
25
|
+
def search(q:, type_names: nil, bucket_ids: nil, creator_ids: nil, file_type: nil, exclude_chat: nil, since: nil, sort: nil, type: nil, bucket_id: nil, creator_id: nil)
|
|
15
26
|
wrap_paginated(service: "search", operation: "search", is_mutation: false) do
|
|
16
|
-
params =
|
|
27
|
+
params = compact_query_params(q: q, type_names: type_names, bucket_ids: bucket_ids, creator_ids: creator_ids, file_type: file_type, exclude_chat: exclude_chat, since: since, sort: sort, type: type, bucket_id: bucket_id, creator_id: creator_id)
|
|
17
28
|
paginate("/search.json", params: params)
|
|
18
29
|
end
|
|
19
30
|
end
|
|
@@ -12,7 +12,7 @@ module Basecamp
|
|
|
12
12
|
# @return [Enumerator<Hash>] paginated results
|
|
13
13
|
def list(status: nil)
|
|
14
14
|
wrap_paginated(service: "templates", operation: "list", is_mutation: false) do
|
|
15
|
-
params =
|
|
15
|
+
params = compact_query_params(status: status)
|
|
16
16
|
paginate("/templates.json", params: params)
|
|
17
17
|
end
|
|
18
18
|
end
|
|
@@ -59,12 +59,11 @@ module Basecamp
|
|
|
59
59
|
|
|
60
60
|
# Create a project from a template (asynchronous)
|
|
61
61
|
# @param template_id [Integer] template id ID
|
|
62
|
-
# @param
|
|
63
|
-
# @param description [String, nil] description
|
|
62
|
+
# @param project [Hash] project
|
|
64
63
|
# @return [Hash] response data
|
|
65
|
-
def create_project(template_id:,
|
|
64
|
+
def create_project(template_id:, project:)
|
|
66
65
|
with_operation(service: "templates", operation: "create_project", is_mutation: true, resource_id: template_id) do
|
|
67
|
-
http_post("/templates/#{template_id}/project_constructions.json", body: compact_params(
|
|
66
|
+
http_post("/templates/#{template_id}/project_constructions.json", body: compact_params(project: project)).json
|
|
68
67
|
end
|
|
69
68
|
end
|
|
70
69
|
|
|
@@ -15,7 +15,7 @@ module Basecamp
|
|
|
15
15
|
# @return [Enumerator<Hash>] paginated results
|
|
16
16
|
def for_project(project_id:, from: nil, to: nil, person_id: nil)
|
|
17
17
|
wrap_paginated(service: "timesheets", operation: "for_project", is_mutation: false, project_id: project_id) do
|
|
18
|
-
params =
|
|
18
|
+
params = compact_query_params(from: from, to: to, person_id: person_id)
|
|
19
19
|
paginate("/projects/#{project_id}/timesheet.json", params: params)
|
|
20
20
|
end
|
|
21
21
|
end
|
|
@@ -28,7 +28,7 @@ module Basecamp
|
|
|
28
28
|
# @return [Enumerator<Hash>] paginated results
|
|
29
29
|
def for_recording(recording_id:, from: nil, to: nil, person_id: nil)
|
|
30
30
|
wrap_paginated(service: "timesheets", operation: "for_recording", is_mutation: false, resource_id: recording_id) do
|
|
31
|
-
params =
|
|
31
|
+
params = compact_query_params(from: from, to: to, person_id: person_id)
|
|
32
32
|
paginate("/recordings/#{recording_id}/timesheet.json", params: params)
|
|
33
33
|
end
|
|
34
34
|
end
|
|
@@ -53,7 +53,7 @@ module Basecamp
|
|
|
53
53
|
# @return [Hash] response data
|
|
54
54
|
def report(from: nil, to: nil, person_id: nil)
|
|
55
55
|
with_operation(service: "timesheets", operation: "report", is_mutation: false) do
|
|
56
|
-
http_get("/reports/timesheet.json", params:
|
|
56
|
+
http_get("/reports/timesheet.json", params: compact_query_params(from: from, to: to, person_id: person_id)).json
|
|
57
57
|
end
|
|
58
58
|
end
|
|
59
59
|
|
|
@@ -27,13 +27,24 @@ module Basecamp
|
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
+
# Reposition a to-do list within its to-do set.
|
|
31
|
+
# @param todolist_id [Integer] todolist id ID
|
|
32
|
+
# @param position [Integer] position
|
|
33
|
+
# @return [void]
|
|
34
|
+
def reposition(todolist_id:, position:)
|
|
35
|
+
with_operation(service: "todolists", operation: "reposition", is_mutation: true, resource_id: todolist_id) do
|
|
36
|
+
http_put("/todosets/todolists/#{todolist_id}/position.json", body: compact_params(position: position))
|
|
37
|
+
nil
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
30
41
|
# List todolists in a todoset
|
|
31
42
|
# @param todoset_id [Integer] todoset id ID
|
|
32
43
|
# @param status [String, nil] active|archived|trashed
|
|
33
44
|
# @return [Enumerator<Hash>] paginated results
|
|
34
45
|
def list(todoset_id:, status: nil)
|
|
35
46
|
wrap_paginated(service: "todolists", operation: "list", is_mutation: false, resource_id: todoset_id) do
|
|
36
|
-
params =
|
|
47
|
+
params = compact_query_params(status: status)
|
|
37
48
|
paginate("/todosets/#{todoset_id}/todolists.json", params: params)
|
|
38
49
|
end
|
|
39
50
|
end
|
|
@@ -42,10 +53,11 @@ module Basecamp
|
|
|
42
53
|
# @param todoset_id [Integer] todoset id ID
|
|
43
54
|
# @param name [String] name
|
|
44
55
|
# @param description [String, nil] description
|
|
56
|
+
# @param visible_to_clients [Boolean, nil] visible to clients
|
|
45
57
|
# @return [Hash] response data
|
|
46
|
-
def create(todoset_id:, name:, description: nil)
|
|
58
|
+
def create(todoset_id:, name:, description: nil, visible_to_clients: nil)
|
|
47
59
|
with_operation(service: "todolists", operation: "create", is_mutation: true, resource_id: todoset_id) do
|
|
48
|
-
http_post("/todosets/#{todoset_id}/todolists.json", body: compact_params(name: name, description: description)).json
|
|
60
|
+
http_post("/todosets/#{todoset_id}/todolists.json", body: compact_params(name: name, description: description, visible_to_clients: visible_to_clients)).json
|
|
49
61
|
end
|
|
50
62
|
end
|
|
51
63
|
end
|
|
@@ -14,7 +14,7 @@ module Basecamp
|
|
|
14
14
|
# @return [Enumerator<Hash>] paginated results
|
|
15
15
|
def list(todolist_id:, status: nil, completed: nil)
|
|
16
16
|
wrap_paginated(service: "todos", operation: "list", is_mutation: false, resource_id: todolist_id) do
|
|
17
|
-
params =
|
|
17
|
+
params = compact_query_params(status: status, completed: completed)
|
|
18
18
|
paginate("/todolists/#{todolist_id}/todos.json", params: params)
|
|
19
19
|
end
|
|
20
20
|
end
|
|
@@ -13,7 +13,7 @@ module Basecamp
|
|
|
13
13
|
# @param title [String, nil] Title for the new tool. When omitted, Basecamp assigns the next available default title for the tool type.
|
|
14
14
|
# @return [Hash] response data
|
|
15
15
|
def create(bucket_id:, tool_type:, title: nil)
|
|
16
|
-
with_operation(service: "tools", operation: "create", is_mutation: true,
|
|
16
|
+
with_operation(service: "tools", operation: "create", is_mutation: true, project_id: bucket_id) do
|
|
17
17
|
http_post("/buckets/#{bucket_id}/dock/tools.json", body: compact_params(tool_type: tool_type, title: title)).json
|
|
18
18
|
end
|
|
19
19
|
end
|
|
@@ -51,10 +51,11 @@ module Basecamp
|
|
|
51
51
|
# @param description [String, nil] description
|
|
52
52
|
# @param base_name [String, nil] base name
|
|
53
53
|
# @param subscriptions [Array, nil] subscriptions
|
|
54
|
+
# @param visible_to_clients [Boolean, nil] visible to clients
|
|
54
55
|
# @return [Hash] response data
|
|
55
|
-
def create(vault_id:, attachable_sgid:, description: nil, base_name: nil, subscriptions: nil)
|
|
56
|
+
def create(vault_id:, attachable_sgid:, description: nil, base_name: nil, subscriptions: nil, visible_to_clients: nil)
|
|
56
57
|
with_operation(service: "uploads", operation: "create", is_mutation: true, resource_id: vault_id) do
|
|
57
|
-
http_post("/vaults/#{vault_id}/uploads.json", body: compact_params(attachable_sgid: attachable_sgid, description: description, base_name: base_name, subscriptions: subscriptions)).json
|
|
58
|
+
http_post("/vaults/#{vault_id}/uploads.json", body: compact_params(attachable_sgid: attachable_sgid, description: description, base_name: base_name, subscriptions: subscriptions, visible_to_clients: visible_to_clients)).json
|
|
58
59
|
end
|
|
59
60
|
end
|
|
60
61
|
|
|
@@ -11,7 +11,7 @@ module Basecamp
|
|
|
11
11
|
# @param bucket_id [Integer] bucket id ID
|
|
12
12
|
# @return [Enumerator<Hash>] paginated results
|
|
13
13
|
def list(bucket_id:)
|
|
14
|
-
wrap_paginated(service: "webhooks", operation: "list", is_mutation: false,
|
|
14
|
+
wrap_paginated(service: "webhooks", operation: "list", is_mutation: false, project_id: bucket_id) do
|
|
15
15
|
paginate("/buckets/#{bucket_id}/webhooks.json")
|
|
16
16
|
end
|
|
17
17
|
end
|
|
@@ -23,7 +23,7 @@ module Basecamp
|
|
|
23
23
|
# @param active [Boolean, nil] active
|
|
24
24
|
# @return [Hash] response data
|
|
25
25
|
def create(bucket_id:, payload_url:, types:, active: nil)
|
|
26
|
-
with_operation(service: "webhooks", operation: "create", is_mutation: true,
|
|
26
|
+
with_operation(service: "webhooks", operation: "create", is_mutation: true, project_id: bucket_id) do
|
|
27
27
|
http_post("/buckets/#{bucket_id}/webhooks.json", body: compact_params(payload_url: payload_url, types: types, active: active)).json
|
|
28
28
|
end
|
|
29
29
|
end
|