chat_xdk 0.7.10-x86_64-linux → 0.7.13-x86_64-linux

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: dfe1310326c237061df7c4c2935426642f8e9c22af126003f407b8d24b2168b4
4
- data.tar.gz: 51f1436271092cfaf7aaaf34481ac289f99717721b73a694a8d0df79f17e68ce
3
+ metadata.gz: 01db5f9dda20513ea755ccb37170019ff19cfd741b9dc2117752404f7f66804b
4
+ data.tar.gz: ffd3f70683c60dae606074d442b23d4ae80c3bbacaf73c4759b907781f8d1107
5
5
  SHA512:
6
- metadata.gz: 8ee51fedad54bd1d6461975284f682d6e707db03c77315fd2f45c3da782a43d91c17cda3b519d18805b4d3528d4483ad7b607574d0575ad4a1a5fd8e50adc1b4
7
- data.tar.gz: d689cda4d85d7d4f67b2a89bfef141486d0a17ccbf59c0313d8a4787f3ca72a77e4ba7357ffa34693c2fe98976d258c7ea470e9812a4d39fdd7d3805f1747742
6
+ metadata.gz: 85d2b9fdbc58ba2d71b5b7f742516246a72d2a0969e4095303552f42f785b571c05270b78765d1dad2287265070dfb34be10a5e0c982fe3ac9ce5c613258945c
7
+ data.tar.gz: 591055ae5463f5107870e516638b608a3576dd192ef31d6fc8aefd1c6ba04c8007221cf3c2c84f244a0be86b57f720739ff1a725b9e2fc4b1be1246b5ae059da
@@ -558,7 +558,7 @@ Versions are from the repository `Cargo.lock` at generation time.
558
558
  | Python (`chatxdk` wheel) | Embeds the Rust core (+ Juicebox when built with default features). No pure-Python runtime deps. |
559
559
  | JavaScript/WASM (`@xdevplatform/chat-xdk`) | Embeds the Rust core **without** Juicebox. Optional peer `juicebox-sdk` is separate software. |
560
560
  | Go (`go/chatxdk`) | Prebuilt static libraries embed the Rust core (+ Juicebox). No Go module dependencies. |
561
- | .NET (`XDevPlatform.ChatXdk`) | Native cdylib embeds the Rust core (+ Juicebox). No NuGet runtime package dependencies. |
561
+ | .NET (`XDevPlatform.ChatXdk`) | Native cdylib embeds the Rust core (+ Juicebox). No NuGet runtime dependencies on `net8.0`; `netstandard2.0` depends on Microsoft's MIT-licensed `System.Text.Json` and `System.Memory`. |
562
562
 
563
563
  ---
564
564
 
data/lib/chat_xdk/chat.rb CHANGED
@@ -749,6 +749,7 @@ module ChatXdk
749
749
  doc["entities"] = serialize_entities(params.entities) unless params.entities.nil?
750
750
  doc["attachments"] = serialize_attachments(params.attachments) unless params.attachments.nil?
751
751
  doc["quick_reply"] = serialize_quick_reply(params.quick_reply) unless params.quick_reply.nil?
752
+ doc["ctas"] = serialize_ctas(params.ctas) unless params.ctas.nil?
752
753
  doc["should_notify"] = params.should_notify unless params.should_notify.nil?
753
754
  doc["ttl_msec"] = params.ttl_msec unless params.ttl_msec.nil?
754
755
  call_encrypt(JSON.generate(doc), :chat_xdk_encrypt_message)
@@ -810,6 +811,7 @@ module ChatXdk
810
811
  doc["reply_to_attachments"] = serialize_attachments(params.reply_to_attachments) unless params.reply_to_attachments.nil?
811
812
  doc["reply_to_attachment_id"] = params.reply_to_attachment_id unless params.reply_to_attachment_id.nil?
812
813
  doc["quick_reply"] = serialize_quick_reply(params.quick_reply) unless params.quick_reply.nil?
814
+ doc["ctas"] = serialize_ctas(params.ctas) unless params.ctas.nil?
813
815
  doc["should_notify"] = params.should_notify unless params.should_notify.nil?
814
816
  doc["ttl_msec"] = params.ttl_msec unless params.ttl_msec.nil?
815
817
  call_encrypt(JSON.generate(doc), :chat_xdk_encrypt_reply)
@@ -1243,6 +1245,16 @@ module ChatXdk
1243
1245
  quick_reply.to_h
1244
1246
  end
1245
1247
 
1248
+ def serialize_ctas(ctas)
1249
+ ctas.map do |cta|
1250
+ unless cta.is_a?(CallToAction)
1251
+ raise TypeError, "expected CallToAction, got #{cta.class.name}"
1252
+ end
1253
+
1254
+ cta.to_h
1255
+ end
1256
+ end
1257
+
1246
1258
  def parse_user_ids(json)
1247
1259
  return [] if json.nil? || json.empty?
1248
1260
 
@@ -1102,6 +1102,35 @@ module ChatXdk
1102
1102
  end
1103
1103
  end
1104
1104
 
1105
+ # A call-to-action button (label plus URL) attached to a text message.
1106
+ # Deserializes from a decrypted event's ctas Hash entry via {.from_h}.
1107
+ class CallToAction
1108
+ attr_accessor :label, :url
1109
+
1110
+ def initialize(label: nil, url: nil)
1111
+ @label = label
1112
+ @url = url
1113
+ end
1114
+
1115
+ def self.from_h(hash)
1116
+ return nil if hash.nil?
1117
+ return hash if hash.is_a?(self)
1118
+ raise ArgumentError, "expected Hash or CallToAction" unless hash.is_a?(Hash)
1119
+
1120
+ new(
1121
+ label: hash.key?("label") ? hash["label"] : hash[:label],
1122
+ url: hash.key?("url") ? hash["url"] : hash[:url]
1123
+ )
1124
+ end
1125
+
1126
+ def to_h
1127
+ h = {}
1128
+ h["label"] = @label unless @label.nil?
1129
+ h["url"] = @url unless @url.nil?
1130
+ h
1131
+ end
1132
+ end
1133
+
1105
1134
  # --- Params classes ---
1106
1135
 
1107
1136
  # Parameters for {Chat#set_identity}.
@@ -1158,7 +1187,7 @@ module ChatXdk
1158
1187
  class EncryptMessageParams
1159
1188
  attr_accessor :conversation_id, :text, :sender_id, :signing_key_version,
1160
1189
  :conversation_key, :conversation_key_version, :entities,
1161
- :attachments, :quick_reply, :should_notify, :ttl_msec
1190
+ :attachments, :quick_reply, :ctas, :should_notify, :ttl_msec
1162
1191
 
1163
1192
  def initialize(
1164
1193
  conversation_id:,
@@ -1170,6 +1199,7 @@ module ChatXdk
1170
1199
  entities: nil,
1171
1200
  attachments: nil,
1172
1201
  quick_reply: nil,
1202
+ ctas: nil,
1173
1203
  should_notify: nil,
1174
1204
  ttl_msec: nil
1175
1205
  )
@@ -1182,6 +1212,7 @@ module ChatXdk
1182
1212
  @entities = entities
1183
1213
  @attachments = attachments
1184
1214
  @quick_reply = quick_reply
1215
+ @ctas = ctas
1185
1216
  @should_notify = should_notify
1186
1217
  @ttl_msec = ttl_msec
1187
1218
  end
@@ -1241,7 +1272,7 @@ module ChatXdk
1241
1272
  :reply_to_sequence_id, :reply_to_message_id, :reply_to_sender_id,
1242
1273
  :reply_to_text, :entities, :attachments, :reply_to_entities,
1243
1274
  :reply_to_attachments, :reply_to_attachment_id, :quick_reply,
1244
- :should_notify, :ttl_msec
1275
+ :ctas, :should_notify, :ttl_msec
1245
1276
 
1246
1277
  def initialize(
1247
1278
  conversation_id:,
@@ -1263,6 +1294,7 @@ module ChatXdk
1263
1294
  reply_to_attachments: nil,
1264
1295
  reply_to_attachment_id: nil,
1265
1296
  quick_reply: nil,
1297
+ ctas: nil,
1266
1298
  should_notify: nil,
1267
1299
  ttl_msec: nil
1268
1300
  )
@@ -1285,6 +1317,7 @@ module ChatXdk
1285
1317
  @reply_to_attachments = reply_to_attachments
1286
1318
  @reply_to_attachment_id = reply_to_attachment_id
1287
1319
  @quick_reply = quick_reply
1320
+ @ctas = ctas
1288
1321
  @should_notify = should_notify
1289
1322
  @ttl_msec = ttl_msec
1290
1323
  end
@@ -3,5 +3,5 @@
3
3
  module ChatXdk
4
4
  # Canonical release version, stamped by scripts/version.sh in lockstep with
5
5
  # the workspace Cargo.toml.
6
- VERSION = "0.7.10"
6
+ VERSION = "0.7.13"
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chat_xdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.10
4
+ version: 0.7.13
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - X Developer Platform
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-12-03 00:00:00.000000000 Z
11
+ date: 2026-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi