basecamp-sdk 0.26.0 → 0.27.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1fd42c71ec94ed3fca5d41b7f015309154da9cba442bd5d7e1a4daa41fcc47f7
4
- data.tar.gz: 38b36b58f82eb91498ec501a1d497ea18210ad07a7f4548820350a3f69c08724
3
+ metadata.gz: 464ab4e49c6a0281a60dc00e1f5a211825a18934de70f2d6f3f286764a214b4f
4
+ data.tar.gz: cf3853885993c37050532e8cc49cd8373d988c95bbaaee5c592fc0f0b5795a38
5
5
  SHA512:
6
- metadata.gz: 89dd7bc9af9f11a0365f768ffec3a6335b801f4278834dfadbbfe5963046f4da5f33bece26b8b112798896128e2def06c405d31f04b7f07b29e7432a384b9d83
7
- data.tar.gz: 716839ec940b554a08f9049ec03caa88090e7965575dd29567545a38e04f8cd46176daf2de2882df079c32684f339e1b4c7ad09be523e0840854b0e0240919c3
6
+ metadata.gz: 06aecc483956a9f48bf409a1bf7d5e330a6b4a20798f2af6ea23f042ae9c0bb41887e05baa209f7aa56773b9a5ee0ac27ffbc97edbe43c55f8f8536aed54f4b3
7
+ data.tar.gz: 5be36d9af6d70513ec896efd88173094b8b23c6b63b4aed3f72bcdc9b4d1e7eb1d5ea5b0b942df829c406671c22b980fe65d137ac81e4d460ff312d8080f539c
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 |
@@ -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-19T21:23:14Z",
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-19T21:23:14Z
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
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Basecamp
4
- VERSION = "0.26.0"
4
+ VERSION = "0.27.1"
5
5
  API_VERSION = "2026-10-19"
6
6
  end
@@ -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.26.0
4
+ version: 0.27.1
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-20 00:00:00.000000000 Z
11
+ date: 2026-10-22 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