basecamp-sdk 0.26.0 → 0.27.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 +1 -0
- data/lib/basecamp/client.rb +4 -0
- data/lib/basecamp/generated/metadata.json +25 -1
- data/lib/basecamp/generated/services/base_service.rb +4 -0
- data/lib/basecamp/generated/services/embeds_service.rb +29 -0
- data/lib/basecamp/generated/services/schedules_service.rb +1 -1
- data/lib/basecamp/generated/types.rb +38 -1
- data/lib/basecamp/version.rb +1 -1
- data/scripts/generate-services.rb +6 -4
- 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: 69a94db94f0ff533b6160519f9ed6e41089ef70639d36e7042668f8ba5c819e9
|
|
4
|
+
data.tar.gz: a19a2cf4cff6180e1671e826bc6a9e93794576c05af574c0cd0ab64296a361e7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bec94397b02003677dd55ce96cb2786c4d0f8b502097f564086187c74ba767e6191b0104ca9d67eaece577664646a1f6828e877b9407e2f6c7613ad9c8c36c5d
|
|
7
|
+
data.tar.gz: 5523532f3233eecefc27ec7ca6c0048513f66fee6b53986be5458c120f83f75be65509de87eaeb22e84f2814356f30758d64fb1df392cc63dc5a76bb2bb7d8b5
|
data/README.md
CHANGED
|
@@ -349,6 +349,7 @@ The SDK provides the full account-scoped service set documented in SPEC §5. The
|
|
|
349
349
|
| `card_steps` | Card workflow steps |
|
|
350
350
|
| `subtasks` | Subtasks (checklist items) on to-dos and cards |
|
|
351
351
|
| `pings` | Pings (direct and group chats) |
|
|
352
|
+
| `embeds` | Embeds for rich text (create, get) |
|
|
352
353
|
| `wormholes` | Card table wormholes (cross-project moves) |
|
|
353
354
|
| `lineup` | Card lineup view |
|
|
354
355
|
| `tools` | Project dock tools |
|
data/lib/basecamp/client.rb
CHANGED
|
@@ -617,6 +617,10 @@ module Basecamp
|
|
|
617
617
|
service(:pings) { Services::PingsService.new(self) }
|
|
618
618
|
end
|
|
619
619
|
|
|
620
|
+
def embeds
|
|
621
|
+
service(:embeds) { Services::EmbedsService.new(self) }
|
|
622
|
+
end
|
|
623
|
+
|
|
620
624
|
# @return [Services::AccountService]
|
|
621
625
|
def account
|
|
622
626
|
service(:account) { Services::AccountService.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-10-
|
|
4
|
+
"generated": "2026-10-20T15:47:49Z",
|
|
5
5
|
"operations": {
|
|
6
6
|
"GetAccount": {
|
|
7
7
|
"retry": {
|
|
@@ -1134,6 +1134,30 @@
|
|
|
1134
1134
|
"natural": true
|
|
1135
1135
|
}
|
|
1136
1136
|
},
|
|
1137
|
+
"CreateEmbed": {
|
|
1138
|
+
"retry": {
|
|
1139
|
+
"maxAttempts": 3,
|
|
1140
|
+
"baseDelayMs": 1000,
|
|
1141
|
+
"backoff": "exponential",
|
|
1142
|
+
"retryOn": [
|
|
1143
|
+
503
|
|
1144
|
+
]
|
|
1145
|
+
},
|
|
1146
|
+
"idempotent": {
|
|
1147
|
+
"natural": true
|
|
1148
|
+
}
|
|
1149
|
+
},
|
|
1150
|
+
"GetEmbed": {
|
|
1151
|
+
"retry": {
|
|
1152
|
+
"maxAttempts": 3,
|
|
1153
|
+
"baseDelayMs": 1000,
|
|
1154
|
+
"backoff": "exponential",
|
|
1155
|
+
"retryOn": [
|
|
1156
|
+
429,
|
|
1157
|
+
503
|
|
1158
|
+
]
|
|
1159
|
+
}
|
|
1160
|
+
},
|
|
1137
1161
|
"PollEvents": {
|
|
1138
1162
|
"retry": {
|
|
1139
1163
|
"maxAttempts": 3,
|
|
@@ -162,6 +162,10 @@ module Basecamp
|
|
|
162
162
|
kwargs.compact
|
|
163
163
|
end
|
|
164
164
|
|
|
165
|
+
def path_segment(value)
|
|
166
|
+
CGI.escapeURIComponent(value.to_s)
|
|
167
|
+
end
|
|
168
|
+
|
|
165
169
|
# Like compact_params, but also drops empty arrays. For query filters an
|
|
166
170
|
# empty array means "no filter" and must be omitted entirely: Faraday's
|
|
167
171
|
# nested encoder would otherwise emit a bare `bucket_ids[]`, which Rails
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Basecamp
|
|
4
|
+
module Services
|
|
5
|
+
# Service for Embeds operations
|
|
6
|
+
#
|
|
7
|
+
# @generated from OpenAPI spec
|
|
8
|
+
class EmbedsService < BaseService
|
|
9
|
+
|
|
10
|
+
# Create an embed for a URL, or return the one Basecamp already has for it.
|
|
11
|
+
# @param url [String] The URL of the content to embed.
|
|
12
|
+
# @return [Hash] response data
|
|
13
|
+
def create(url:)
|
|
14
|
+
with_operation(service: "embeds", operation: "create", is_mutation: true) do
|
|
15
|
+
http_post("/embeds.json", body: compact_params(url: url)).json(operation: "CreateEmbed")
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# Get an embed by its sgid.
|
|
20
|
+
# @param sgid [String] An embed's signed global id, an opaque string.
|
|
21
|
+
# @return [Hash] response data
|
|
22
|
+
def get(sgid:)
|
|
23
|
+
with_operation(service: "embeds", operation: "get", is_mutation: false) do
|
|
24
|
+
http_get("/embeds/#{path_segment(sgid)}", operation: "GetEmbed").json(operation: "GetEmbed")
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -72,7 +72,7 @@ module Basecamp
|
|
|
72
72
|
# @return [Hash] response data
|
|
73
73
|
def get_entry_occurrence(entry_id:, date:)
|
|
74
74
|
with_operation(service: "schedules", operation: "get_entry_occurrence", is_mutation: false, resource_id: entry_id) do
|
|
75
|
-
http_get("/schedule_entries/#{entry_id}/occurrences/#{date}", operation: "GetScheduleEntryOccurrence").json(operation: "GetScheduleEntryOccurrence")
|
|
75
|
+
http_get("/schedule_entries/#{entry_id}/occurrences/#{path_segment(date)}", operation: "GetScheduleEntryOccurrence").json(operation: "GetScheduleEntryOccurrence")
|
|
76
76
|
end
|
|
77
77
|
end
|
|
78
78
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# Auto-generated from OpenAPI spec. Do not edit manually.
|
|
4
|
-
# Generated: 2026-10-
|
|
4
|
+
# Generated: 2026-10-20T15:47:49Z
|
|
5
5
|
|
|
6
6
|
require "json"
|
|
7
7
|
require "time"
|
|
@@ -1685,6 +1685,43 @@ module Basecamp
|
|
|
1685
1685
|
end
|
|
1686
1686
|
end
|
|
1687
1687
|
|
|
1688
|
+
# Embed
|
|
1689
|
+
class Embed
|
|
1690
|
+
include TypeHelpers
|
|
1691
|
+
attr_accessor :sgid, :status, :url, :content, :content_type, :image_url, :type
|
|
1692
|
+
|
|
1693
|
+
# @return [Array<Symbol>]
|
|
1694
|
+
def self.required_fields
|
|
1695
|
+
%i[sgid status url].freeze
|
|
1696
|
+
end
|
|
1697
|
+
|
|
1698
|
+
def initialize(data = {})
|
|
1699
|
+
@sgid = data["sgid"]
|
|
1700
|
+
@status = data["status"]
|
|
1701
|
+
@url = data["url"]
|
|
1702
|
+
@content = data["content"]
|
|
1703
|
+
@content_type = data["content_type"]
|
|
1704
|
+
@image_url = data["image_url"]
|
|
1705
|
+
@type = data["type"]
|
|
1706
|
+
end
|
|
1707
|
+
|
|
1708
|
+
def to_h
|
|
1709
|
+
{
|
|
1710
|
+
"sgid" => @sgid,
|
|
1711
|
+
"status" => @status,
|
|
1712
|
+
"url" => @url,
|
|
1713
|
+
"content" => @content,
|
|
1714
|
+
"content_type" => @content_type,
|
|
1715
|
+
"image_url" => @image_url,
|
|
1716
|
+
"type" => @type,
|
|
1717
|
+
}.compact
|
|
1718
|
+
end
|
|
1719
|
+
|
|
1720
|
+
def to_json(*args)
|
|
1721
|
+
to_h.to_json(*args)
|
|
1722
|
+
end
|
|
1723
|
+
end
|
|
1724
|
+
|
|
1688
1725
|
# Event
|
|
1689
1726
|
class Event
|
|
1690
1727
|
include TypeHelpers
|
data/lib/basecamp/version.rb
CHANGED
|
@@ -84,6 +84,7 @@ class ServiceGenerator
|
|
|
84
84
|
'Boosts' => 'Boosts',
|
|
85
85
|
'Subtasks' => 'Subtasks',
|
|
86
86
|
'Pings' => 'Pings',
|
|
87
|
+
'Embeds' => 'Embeds',
|
|
87
88
|
'Untagged' => 'Miscellaneous'
|
|
88
89
|
}.freeze
|
|
89
90
|
|
|
@@ -365,7 +366,7 @@ class ServiceGenerator
|
|
|
365
366
|
clientcorrespondences clientreply clientreplies forwardreply
|
|
366
367
|
forwardreplies campfireline campfirelines todolistgroup todolistgroups
|
|
367
368
|
todolistorgroup uploadversions hillchart hillcharts subtask subtasks ping pings
|
|
368
|
-
wormhole wormholes
|
|
369
|
+
wormhole wormholes embed embeds
|
|
369
370
|
].freeze
|
|
370
371
|
|
|
371
372
|
def initialize(openapi_path)
|
|
@@ -571,7 +572,7 @@ class ServiceGenerator
|
|
|
571
572
|
operation_id: operation_id,
|
|
572
573
|
method_name: method_name,
|
|
573
574
|
http_method: http_method,
|
|
574
|
-
path: convert_path(path),
|
|
575
|
+
path: convert_path(path, path_params),
|
|
575
576
|
description: description,
|
|
576
577
|
path_params: path_params,
|
|
577
578
|
query_params: query_params,
|
|
@@ -679,14 +680,15 @@ class ServiceGenerator
|
|
|
679
680
|
SIMPLE_RESOURCES.include?(resource.downcase.gsub('_', ''))
|
|
680
681
|
end
|
|
681
682
|
|
|
682
|
-
def convert_path(path)
|
|
683
|
+
def convert_path(path, path_params = [])
|
|
683
684
|
# Remove /{accountId} prefix
|
|
684
685
|
path = path.sub(%r{^/\{accountId\}}, '')
|
|
686
|
+
string_params = path_params.select { |p| p[:type] == 'String' }.map { |p| p[:name] }
|
|
685
687
|
# Convert {camelCaseParam} to #{snake_case_param}
|
|
686
688
|
path.gsub(/\{(\w+)\}/) do |_match|
|
|
687
689
|
param = ::Regexp.last_match(1)
|
|
688
690
|
snake_param = to_snake_case(param)
|
|
689
|
-
"\#{#{snake_param}}"
|
|
691
|
+
string_params.include?(param) ? "\#{path_segment(#{snake_param})}" : "\#{#{snake_param}}"
|
|
690
692
|
end
|
|
691
693
|
end
|
|
692
694
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: basecamp-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.27.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Basecamp
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -202,6 +202,7 @@ files:
|
|
|
202
202
|
- lib/basecamp/generated/services/comments_service.rb
|
|
203
203
|
- lib/basecamp/generated/services/documents_service.rb
|
|
204
204
|
- lib/basecamp/generated/services/drafts_service.rb
|
|
205
|
+
- lib/basecamp/generated/services/embeds_service.rb
|
|
205
206
|
- lib/basecamp/generated/services/event_feed_service.rb
|
|
206
207
|
- lib/basecamp/generated/services/events_service.rb
|
|
207
208
|
- lib/basecamp/generated/services/everything_service.rb
|