apologist 1.0.4 → 1.0.5

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: 373080f7416a7d36a385db207eed74ad7cac5e69b9abe892a395181b24049939
4
- data.tar.gz: '09e84784563f7ea280f3aad6c06c8ec396aea0af9580ea5b05d6a801db58970f'
3
+ metadata.gz: dc0fc7710c16452519984bcb40f9f0347ff58491c622aa4a3a5734d26574f3ec
4
+ data.tar.gz: b0fdb77c44c03ac3e4f368c070d2c300c8085bd5b682881e9d83788205fa1913
5
5
  SHA512:
6
- metadata.gz: e5ecb98b5f1f955ea8973150f481ea2fe909ace4811ffe4c00a7a0b63261b1e132015167bd08ac624cfd1d059aafda66e646d6ca259beafe09df07e5e1976136
7
- data.tar.gz: ec91d363b64e04c35b6478ef56251038d8ee04e4043b9163985e90f514ea0a3a6134325894106979f6187cc66d42f7a800866317d8bd6419fd0efee0d26907ea
6
+ metadata.gz: 91928d58e4d44849c0873bf39502958a8aaed8bbadd3dd9f2b0cf6b4ee189fe3742eb76977e79a6efd7c53eb58b606f29f10b49e1e2ee309e57b39f75e399cd1
7
+ data.tar.gz: 90b676dba9f6778d7831311dba6f5af15bc71a587846b9f09a68d3342172009e5a5b096a159d46c71469a4104ad99ad398607a12df8840624b7f14cbf871f52f
data/.fern/metadata.json CHANGED
@@ -6,9 +6,9 @@
6
6
  "moduleName": "Apologist",
7
7
  "clientModuleName": "AgentClient"
8
8
  },
9
- "originGitCommit": "260686d6daa2090b871f8509b0b2661bc33c170c",
9
+ "originGitCommit": "b34e9073b4d563508b6a9eab41f15e10ab60fb15",
10
10
  "originGitCommitIsDirty": false,
11
11
  "invokedBy": "ci",
12
12
  "ciProvider": "github",
13
- "sdkVersion": "1.0.3"
13
+ "sdkVersion": "1.0.5"
14
14
  }
@@ -101,6 +101,94 @@ module Apologist
101
101
  raise error_class.new(response.body, code: code)
102
102
  end
103
103
 
104
+ # Returns the status of the LINE channel. Used as a lightweight health/verification endpoint.
105
+ #
106
+ # @param request_options [Hash]
107
+ # @param params [Hash]
108
+ # @option request_options [String] :base_url
109
+ # @option request_options [Hash{String => Object}] :additional_headers
110
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
111
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
112
+ # @option request_options [Integer] :timeout_in_seconds
113
+ # @option params [String] :id
114
+ #
115
+ # @example
116
+ # client.channels.get_line_channel_status(id: "id")
117
+ #
118
+ # @return [Apologist::Channels::Types::GetLineChannelStatusResponse]
119
+ def get_line_channel_status(request_options: {}, **params)
120
+ params = Apologist::Internal::Types::Utils.normalize_keys(params)
121
+ request = Apologist::Internal::JSON::Request.new(
122
+ base_url: request_options[:base_url],
123
+ method: "GET",
124
+ path: "channels/#{URI.encode_uri_component(params[:id].to_s)}/line",
125
+ request_options: request_options
126
+ )
127
+ begin
128
+ response = @client.send(request)
129
+ rescue Net::HTTPRequestTimeout
130
+ raise Apologist::Errors::TimeoutError
131
+ end
132
+ code = response.code.to_i
133
+ if code.between?(200, 299)
134
+ Apologist::Channels::Types::GetLineChannelStatusResponse.load(response.body)
135
+ else
136
+ error_class = Apologist::Errors::ResponseError.subclass_for_code(code)
137
+ raise error_class.new(response.body, code: code)
138
+ end
139
+ end
140
+
141
+ # Receives LINE Messaging API webhook events for the channel. Requests are verified via the `x-line-signature`
142
+ # HMAC-SHA256 (Base64) header using the channel secret unless an `api_key` is present. Payload shape is defined by
143
+ # LINE. The route acknowledges quickly and processes text `message` and `follow` events asynchronously.
144
+ #
145
+ # @param request_options [Hash]
146
+ # @param params [Hash]
147
+ # @option request_options [String] :base_url
148
+ # @option request_options [Hash{String => Object}] :additional_headers
149
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
150
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
151
+ # @option request_options [Integer] :timeout_in_seconds
152
+ # @option params [String] :id
153
+ # @option params [String, nil] :line_signature
154
+ #
155
+ # @example
156
+ # client.channels.receive_line_webhook(
157
+ # id: "id",
158
+ # body: {
159
+ # key: "value"
160
+ # }
161
+ # )
162
+ #
163
+ # @return [untyped]
164
+ def receive_line_webhook(request_options: {}, **params)
165
+ params = Apologist::Internal::Types::Utils.normalize_keys(params)
166
+ path_param_names = %i[id]
167
+ body_params = params.except(*path_param_names)
168
+
169
+ headers = {}
170
+ headers["x-line-signature"] = params[:line_signature] if params[:line_signature]
171
+
172
+ request = Apologist::Internal::JSON::Request.new(
173
+ base_url: request_options[:base_url],
174
+ method: "POST",
175
+ path: "channels/#{URI.encode_uri_component(params[:id].to_s)}/line",
176
+ headers: headers,
177
+ body: body_params,
178
+ request_options: request_options
179
+ )
180
+ begin
181
+ response = @client.send(request)
182
+ rescue Net::HTTPRequestTimeout
183
+ raise Apologist::Errors::TimeoutError
184
+ end
185
+ code = response.code.to_i
186
+ return if code.between?(200, 299)
187
+
188
+ error_class = Apologist::Errors::ResponseError.subclass_for_code(code)
189
+ raise error_class.new(response.body, code: code)
190
+ end
191
+
104
192
  # Handles the Meta webhook verification handshake, echoing `hub.challenge` when `hub.verify_token` matches the
105
193
  # channel's configured token.
106
194
  #
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Apologist
4
+ module Channels
5
+ module Types
6
+ class GetLineChannelStatusRequest < Internal::Types::Model
7
+ field :id, -> { String }, optional: false, nullable: false
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Apologist
4
+ module Channels
5
+ module Types
6
+ class GetLineChannelStatusResponse < Internal::Types::Model
7
+ field :status, -> { String }, optional: true, nullable: false
8
+
9
+ field :channel, -> { String }, optional: true, nullable: false
10
+
11
+ field :active, -> { Internal::Types::Boolean }, optional: true, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Apologist
4
+ module Channels
5
+ module Types
6
+ class ReceiveLineWebhookRequest < Internal::Types::Model
7
+ field :id, -> { String }, optional: false, nullable: false
8
+
9
+ field :line_signature, -> { String }, optional: true, nullable: false, api_name: "x-line-signature"
10
+
11
+ field :body, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -20,7 +20,7 @@ module Apologist
20
20
  @raw_client = Apologist::Internal::Http::RawClient.new(
21
21
  base_url: base_url || Apologist::Environment::DEFAULT,
22
22
  headers: {
23
- "User-Agent" => "apologist/1.0.3",
23
+ "User-Agent" => "apologist/1.0.5",
24
24
  "X-Fern-Language" => "Ruby",
25
25
  "x-api-key" => api_key.to_s
26
26
  },
@@ -142,7 +142,8 @@ module Apologist
142
142
  end
143
143
 
144
144
  # Records a referral for a corpus item and, when a `url` is supplied, issues a 302 redirect to it. Without a
145
- # `url`, responds with a success message. Requires either the search API entitlement or a same-origin request.
145
+ # `url`, responds with a success message. Requires either the search API entitlement or a signed `browser_key`
146
+ # cookie.
146
147
  #
147
148
  # @param request_options [Hash]
148
149
  # @param params [Hash]
@@ -19,6 +19,8 @@ module Apologist
19
19
 
20
20
  field :device, -> { String }, optional: true, nullable: false
21
21
 
22
+ field :referral_code, -> { String }, optional: true, nullable: false
23
+
22
24
  field :shared_prompt, -> { Integer }, optional: true, nullable: false
23
25
 
24
26
  field :translation, -> { String }, optional: true, nullable: false
@@ -7,6 +7,8 @@ module Apologist
7
7
 
8
8
  field :external_id, -> { String }, optional: true, nullable: false
9
9
 
10
+ field :referral_code, -> { String }, optional: true, nullable: false
11
+
10
12
  field :team_id, -> { Integer }, optional: true, nullable: false
11
13
 
12
14
  field :created_at, -> { String }, optional: true, nullable: false
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Apologist
4
- VERSION = "1.0.4"
4
+ VERSION = "1.0.5"
5
5
  end
data/lib/Apologist.rb CHANGED
@@ -61,6 +61,7 @@ require_relative "Apologist/benchmarks/types/benchmark_run_request_reasoning_eff
61
61
  require_relative "Apologist/benchmarks/types/benchmark_run_request_verbosity"
62
62
  require_relative "Apologist/benchmarks/types/get_benchmark_run_response"
63
63
  require_relative "Apologist/channels/types/get_discord_channel_status_response"
64
+ require_relative "Apologist/channels/types/get_line_channel_status_response"
64
65
  require_relative "Apologist/channels/types/verify_facebook_webhook_request_hub_mode"
65
66
  require_relative "Apologist/shares/types/get_shared_messages_response"
66
67
  require_relative "Apologist/types/error"
@@ -121,6 +122,8 @@ require_relative "Apologist/benchmarks/types/get_benchmark_run_request"
121
122
  require_relative "Apologist/channels/client"
122
123
  require_relative "Apologist/channels/types/get_discord_channel_status_request"
123
124
  require_relative "Apologist/channels/types/receive_discord_interaction_request"
125
+ require_relative "Apologist/channels/types/get_line_channel_status_request"
126
+ require_relative "Apologist/channels/types/receive_line_webhook_request"
124
127
  require_relative "Apologist/channels/types/verify_facebook_webhook_request"
125
128
  require_relative "Apologist/channels/types/receive_facebook_message_request"
126
129
  require_relative "Apologist/channels/types/get_instagram_privacy_policy_request"
data/reference.md CHANGED
@@ -908,7 +908,7 @@ client.corpus.log_corpus_impression(
908
908
  <dl>
909
909
  <dd>
910
910
 
911
- Records a referral for a corpus item and, when a `url` is supplied, issues a 302 redirect to it. Without a `url`, responds with a success message. Requires either the search API entitlement or a same-origin request.
911
+ Records a referral for a corpus item and, when a `url` is supplied, issues a 302 redirect to it. Without a `url`, responds with a success message. Requires either the search API entitlement or a signed `browser_key` cookie.
912
912
  </dd>
913
913
  </dl>
914
914
  </dd>
@@ -2478,6 +2478,151 @@ client.channels.receive_discord_interaction(
2478
2478
  </dl>
2479
2479
 
2480
2480
 
2481
+ </dd>
2482
+ </dl>
2483
+ </details>
2484
+
2485
+ <details><summary><code>client.channels.<a href="/lib/Apologist/channels/client.rb">get_line_channel_status</a>(id:) -> Apologist::Channels::Types::GetLineChannelStatusResponse</code></summary>
2486
+ <dl>
2487
+ <dd>
2488
+
2489
+ #### 📝 Description
2490
+
2491
+ <dl>
2492
+ <dd>
2493
+
2494
+ <dl>
2495
+ <dd>
2496
+
2497
+ Returns the status of the LINE channel. Used as a lightweight health/verification endpoint.
2498
+ </dd>
2499
+ </dl>
2500
+ </dd>
2501
+ </dl>
2502
+
2503
+ #### 🔌 Usage
2504
+
2505
+ <dl>
2506
+ <dd>
2507
+
2508
+ <dl>
2509
+ <dd>
2510
+
2511
+ ```ruby
2512
+ client.channels.get_line_channel_status(id: "id")
2513
+ ```
2514
+ </dd>
2515
+ </dl>
2516
+ </dd>
2517
+ </dl>
2518
+
2519
+ #### ⚙️ Parameters
2520
+
2521
+ <dl>
2522
+ <dd>
2523
+
2524
+ <dl>
2525
+ <dd>
2526
+
2527
+ **id:** `String` — The channel id
2528
+
2529
+ </dd>
2530
+ </dl>
2531
+
2532
+ <dl>
2533
+ <dd>
2534
+
2535
+ **request_options:** `Apologist::Channels::RequestOptions`
2536
+
2537
+ </dd>
2538
+ </dl>
2539
+ </dd>
2540
+ </dl>
2541
+
2542
+
2543
+ </dd>
2544
+ </dl>
2545
+ </details>
2546
+
2547
+ <details><summary><code>client.channels.<a href="/lib/Apologist/channels/client.rb">receive_line_webhook</a>(id:, request) -> </code></summary>
2548
+ <dl>
2549
+ <dd>
2550
+
2551
+ #### 📝 Description
2552
+
2553
+ <dl>
2554
+ <dd>
2555
+
2556
+ <dl>
2557
+ <dd>
2558
+
2559
+ Receives LINE Messaging API webhook events for the channel. Requests are verified via the `x-line-signature` HMAC-SHA256 (Base64) header using the channel secret unless an `api_key` is present. Payload shape is defined by LINE. The route acknowledges quickly and processes text `message` and `follow` events asynchronously.
2560
+ </dd>
2561
+ </dl>
2562
+ </dd>
2563
+ </dl>
2564
+
2565
+ #### 🔌 Usage
2566
+
2567
+ <dl>
2568
+ <dd>
2569
+
2570
+ <dl>
2571
+ <dd>
2572
+
2573
+ ```ruby
2574
+ client.channels.receive_line_webhook(
2575
+ id: "id",
2576
+ body: {
2577
+ key: "value"
2578
+ }
2579
+ )
2580
+ ```
2581
+ </dd>
2582
+ </dl>
2583
+ </dd>
2584
+ </dl>
2585
+
2586
+ #### ⚙️ Parameters
2587
+
2588
+ <dl>
2589
+ <dd>
2590
+
2591
+ <dl>
2592
+ <dd>
2593
+
2594
+ **id:** `String` — The channel id
2595
+
2596
+ </dd>
2597
+ </dl>
2598
+
2599
+ <dl>
2600
+ <dd>
2601
+
2602
+ **line_signature:** `String` — Base64-encoded HMAC-SHA256 of the raw body keyed with the LINE channel secret. Required when the webhook URL does not include an api_key.
2603
+
2604
+ </dd>
2605
+ </dl>
2606
+
2607
+ <dl>
2608
+ <dd>
2609
+
2610
+ **request:** `Internal::Types::Hash[String, Object]` — LINE webhook payload (`destination` + `events`).
2611
+
2612
+ </dd>
2613
+ </dl>
2614
+
2615
+ <dl>
2616
+ <dd>
2617
+
2618
+ **request_options:** `Apologist::Channels::RequestOptions`
2619
+
2620
+ </dd>
2621
+ </dl>
2622
+ </dd>
2623
+ </dl>
2624
+
2625
+
2481
2626
  </dd>
2482
2627
  </dl>
2483
2628
  </details>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apologist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Apologist
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-07-31 00:00:00.000000000 Z
11
+ date: 2026-08-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: The Apologist Ruby library provides convenient access to the Apologist
14
14
  API from Ruby.
@@ -40,8 +40,11 @@ files:
40
40
  - lib/Apologist/channels/types/get_discord_channel_status_request.rb
41
41
  - lib/Apologist/channels/types/get_discord_channel_status_response.rb
42
42
  - lib/Apologist/channels/types/get_instagram_privacy_policy_request.rb
43
+ - lib/Apologist/channels/types/get_line_channel_status_request.rb
44
+ - lib/Apologist/channels/types/get_line_channel_status_response.rb
43
45
  - lib/Apologist/channels/types/receive_discord_interaction_request.rb
44
46
  - lib/Apologist/channels/types/receive_facebook_message_request.rb
47
+ - lib/Apologist/channels/types/receive_line_webhook_request.rb
45
48
  - lib/Apologist/channels/types/receive_telegram_update_request.rb
46
49
  - lib/Apologist/channels/types/receive_twilio_message_request.rb
47
50
  - lib/Apologist/channels/types/verify_facebook_webhook_request.rb