smplkit 3.0.95 → 3.0.96

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.
@@ -34,7 +34,7 @@ module Smplkit
34
34
  )
35
35
 
36
36
  ResolvedManagementConfig = Struct.new(
37
- :api_key, :base_domain, :scheme, :debug,
37
+ :api_key, :base_domain, :scheme, :debug, :extra_headers,
38
38
  keyword_init: true
39
39
  )
40
40
 
@@ -136,16 +136,22 @@ module Smplkit
136
136
  }
137
137
  ctor.each { |k, v| resolved[k] = v unless v.nil? }
138
138
 
139
- missing_required(resolved, "environment", active_profile)
140
- missing_required(resolved, "service", active_profile)
139
+ # Validate required fields.
140
+ #
141
+ # +environment+ and +service+ are OPTIONAL: an audit-only or jobs-only
142
+ # customer needs neither, and when +environment+ is absent the server
143
+ # derives it from the API key (the key can be scoped to an environment).
144
+ # config/flags/logging simply send no environment signal when it's unset.
145
+ # +api_key+ remains required.
141
146
  missing_required(resolved, "api_key", active_profile)
142
147
 
143
148
  ResolvedConfig.new(
144
149
  api_key: resolved["api_key"].to_s,
145
150
  base_domain: resolved["base_domain"].to_s,
146
151
  scheme: resolved["scheme"].to_s,
147
- environment: resolved["environment"].to_s,
148
- service: resolved["service"].to_s,
152
+ # Preserve nil rather than coercing to the literal string "".
153
+ environment: resolved["environment"]&.to_s,
154
+ service: resolved["service"]&.to_s,
149
155
  debug: resolved["debug"] ? true : false,
150
156
  telemetry: resolved["telemetry"] ? true : false
151
157
  )
@@ -84,6 +84,14 @@ module Smplkit
84
84
  # subscription plan does not include the required entitlement.
85
85
  class PaymentRequiredError < Error; end
86
86
 
87
+ # Raised when a logging operation is attempted before +install+.
88
+ #
89
+ # Smpl Logging monkey-patches the standard logging framework, so it stays
90
+ # opt-in: its live surface requires an explicit +LoggingClient#install+
91
+ # first. Config and flags connect lazily on first live use and never raise
92
+ # this.
93
+ class NotInstalledError < Error; end
94
+
87
95
  module Errors
88
96
  module_function
89
97