smplkit 2.0.14 → 2.0.15

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.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/actions_api.rb +2 -69
  3. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/events_api.rb +17 -17
  4. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/forwarders_api.rb +36 -36
  5. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/functions_api.rb +2 -2
  6. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/resource_types_api.rb +2 -72
  7. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/api/usage_api.rb +4 -4
  8. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event.rb +12 -2
  9. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_list_response.rb +1 -1
  10. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_request.rb +165 -0
  11. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_resource.rb +2 -18
  12. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/event_response.rb +1 -1
  13. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder.rb +17 -17
  14. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery.rb +11 -1
  15. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery_list_response.rb +1 -0
  16. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery_resource.rb +1 -0
  17. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_delivery_response.rb +1 -0
  18. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_http.rb +40 -1
  19. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_list_response.rb +1 -0
  20. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_request.rb +165 -0
  21. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_resource.rb +2 -17
  22. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/forwarder_response.rb +1 -0
  23. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/http_header.rb +3 -1
  24. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/retry_failed_deliveries_summary.rb +4 -0
  25. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/test_forwarder_request.rb +41 -1
  26. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/test_forwarder_response.rb +7 -1
  27. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/usage_attributes.rb +4 -1
  28. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/wipe_response.rb +3 -0
  29. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client/models/wipe_tables_summary.rb +7 -0
  30. data/lib/smplkit/_generated/audit/lib/smplkit_audit_client.rb +2 -0
  31. data/lib/smplkit/_generated/audit/spec/api/actions_api_spec.rb +1 -14
  32. data/lib/smplkit/_generated/audit/spec/api/events_api_spec.rb +5 -5
  33. data/lib/smplkit/_generated/audit/spec/api/forwarders_api_spec.rb +11 -11
  34. data/lib/smplkit/_generated/audit/spec/api/functions_api_spec.rb +1 -1
  35. data/lib/smplkit/_generated/audit/spec/api/resource_types_api_spec.rb +1 -15
  36. data/lib/smplkit/_generated/audit/spec/api/usage_api_spec.rb +2 -2
  37. data/lib/smplkit/_generated/audit/spec/models/event_request_spec.rb +36 -0
  38. data/lib/smplkit/_generated/audit/spec/models/forwarder_http_spec.rb +4 -0
  39. data/lib/smplkit/_generated/audit/spec/models/forwarder_request_spec.rb +36 -0
  40. data/lib/smplkit/_generated/audit/spec/models/forwarder_spec.rb +0 -6
  41. data/lib/smplkit/_generated/audit/spec/models/test_forwarder_request_spec.rb +4 -0
  42. data/lib/smplkit/audit/actions.rb +35 -0
  43. data/lib/smplkit/audit/client.rb +11 -9
  44. data/lib/smplkit/audit/events.rb +8 -45
  45. data/lib/smplkit/audit/models.rb +197 -0
  46. data/lib/smplkit/audit/resource_types.rb +30 -0
  47. data/lib/smplkit/errors.rb +5 -0
  48. data/lib/smplkit/management/audit.rb +111 -0
  49. data/lib/smplkit/management/client.rb +4 -1
  50. data/lib/smplkit.rb +7 -5
  51. metadata +9 -3
  52. data/lib/smplkit/audit/forwarders.rb +0 -282
  53. data/lib/smplkit/audit/functions.rb +0 -58
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Audit
17
+ # JSON:API resource envelope for a forwarder. `id` must not be specified for create requests (the server assigns it).
17
18
  class ForwarderResource < ApiModelBase
18
19
  attr_accessor :id
19
20
 
@@ -52,6 +53,7 @@ module SmplkitGeneratedClient::Audit
52
53
  # List of attributes with nullable: true
53
54
  def self.openapi_nullable
54
55
  Set.new([
56
+ :'id',
55
57
  ])
56
58
  end
57
59
 
@@ -73,8 +75,6 @@ module SmplkitGeneratedClient::Audit
73
75
 
74
76
  if attributes.key?(:'id')
75
77
  self.id = attributes[:'id']
76
- else
77
- self.id = nil
78
78
  end
79
79
 
80
80
  if attributes.key?(:'type')
@@ -95,10 +95,6 @@ module SmplkitGeneratedClient::Audit
95
95
  def list_invalid_properties
96
96
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
97
  invalid_properties = Array.new
98
- if @id.nil?
99
- invalid_properties.push('invalid value for "id", id cannot be nil.')
100
- end
101
-
102
98
  if @attributes.nil?
103
99
  invalid_properties.push('invalid value for "attributes", attributes cannot be nil.')
104
100
  end
@@ -110,21 +106,10 @@ module SmplkitGeneratedClient::Audit
110
106
  # @return true if the model is valid
111
107
  def valid?
112
108
  warn '[DEPRECATED] the `valid?` method is obsolete'
113
- return false if @id.nil?
114
109
  return false if @attributes.nil?
115
110
  true
116
111
  end
117
112
 
118
- # Custom attribute writer method with validation
119
- # @param [Object] id Value to be assigned
120
- def id=(id)
121
- if id.nil?
122
- fail ArgumentError, 'id cannot be nil'
123
- end
124
-
125
- @id = id
126
- end
127
-
128
113
  # Custom attribute writer method with validation
129
114
  # @param [Object] attributes Value to be assigned
130
115
  def attributes=(attributes)
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Audit
17
+ # JSON:API single-resource response envelope for a forwarder.
17
18
  class ForwarderResponse < ApiModelBase
18
19
  attr_accessor :data
19
20
 
@@ -14,10 +14,12 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Audit
17
- # A single header on a forwarder's HTTP destination.
17
+ # A single HTTP header attached to a forwarder delivery request.
18
18
  class HttpHeader < ApiModelBase
19
+ # Header name.
19
20
  attr_accessor :name
20
21
 
22
+ # Header value.
21
23
  attr_accessor :value
22
24
 
23
25
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -14,11 +14,15 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Audit
17
+ # Counts returned by the retry-failed-deliveries action.
17
18
  class RetryFailedDeliveriesSummary < ApiModelBase
19
+ # Number of failed deliveries that were re-attempted.
18
20
  attr_accessor :attempted
19
21
 
22
+ # Number of re-attempts that succeeded.
20
23
  attr_accessor :succeeded
21
24
 
25
+ # Number of re-attempts that failed again.
22
26
  attr_accessor :failed
23
27
 
24
28
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -14,20 +14,48 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Audit
17
- # Plain-JSON body for the test_forwarder execute action. Mirrors the encrypted ``ForwarderHttp`` shape with one addition — ``timeout_ms``, capped server-side.
17
+ # Inputs to the test-forwarder action. Mirrors a forwarder's HTTP destination configuration with one addition: `timeout_ms`, applied per-request and capped server-side.
18
18
  class TestForwarderRequest < ApiModelBase
19
+ # HTTP method used for the test request.
19
20
  attr_accessor :method
20
21
 
22
+ # Destination URL.
21
23
  attr_accessor :url
22
24
 
25
+ # HTTP headers attached to the test request.
23
26
  attr_accessor :headers
24
27
 
28
+ # Request body. If omitted, an empty body is sent.
25
29
  attr_accessor :body
26
30
 
31
+ # HTTP response status that indicates success. Either a specific status code (e.g. `200`, `204`) or a status class (`1xx`, `2xx`, `3xx`, `4xx`, `5xx`).
27
32
  attr_accessor :success_status
28
33
 
34
+ # Per-request timeout in milliseconds. Capped at 30 seconds.
29
35
  attr_accessor :timeout_ms
30
36
 
37
+ class EnumAttributeValidator
38
+ attr_reader :datatype
39
+ attr_reader :allowable_values
40
+
41
+ def initialize(datatype, allowable_values)
42
+ @allowable_values = allowable_values.map do |value|
43
+ case datatype.to_s
44
+ when /Integer/i
45
+ value.to_i
46
+ when /Float/i
47
+ value.to_f
48
+ else
49
+ value
50
+ end
51
+ end
52
+ end
53
+
54
+ def valid?(value)
55
+ !value || allowable_values.include?(value)
56
+ end
57
+ end
58
+
31
59
  # Attribute mapping from ruby-style variable name to JSON key.
32
60
  def self.attribute_map
33
61
  {
@@ -159,6 +187,8 @@ module SmplkitGeneratedClient::Audit
159
187
  # @return true if the model is valid
160
188
  def valid?
161
189
  warn '[DEPRECATED] the `valid?` method is obsolete'
190
+ method_validator = EnumAttributeValidator.new('String', ["GET", "POST", "PUT", "PATCH", "DELETE"])
191
+ return false unless method_validator.valid?(@method)
162
192
  return false if @url.nil?
163
193
  return false if @url.to_s.length > 2048
164
194
  return false if @url.to_s.length < 1
@@ -169,6 +199,16 @@ module SmplkitGeneratedClient::Audit
169
199
  true
170
200
  end
171
201
 
202
+ # Custom attribute writer method checking allowed values (enum).
203
+ # @param [Object] method Object to be assigned
204
+ def method=(method)
205
+ validator = EnumAttributeValidator.new('String', ["GET", "POST", "PUT", "PATCH", "DELETE"])
206
+ unless validator.valid?(method)
207
+ fail ArgumentError, "invalid value for \"method\", must be one of #{validator.allowable_values}."
208
+ end
209
+ @method = method
210
+ end
211
+
172
212
  # Custom attribute writer method with validation
173
213
  # @param [Object] url Value to be assigned
174
214
  def url=(url)
@@ -14,18 +14,24 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Audit
17
- # Plain-JSON response body. Headers are echoed back unredacted because the caller already supplied them — the response is for the caller, not persisted into the delivery log.
17
+ # Result of a test-forwarder execution.
18
18
  class TestForwarderResponse < ApiModelBase
19
+ # True if the destination responded with a status matching `success_status`.
19
20
  attr_accessor :succeeded
20
21
 
22
+ # HTTP status code returned by the destination.
21
23
  attr_accessor :response_status
22
24
 
25
+ # Headers returned by the destination.
23
26
  attr_accessor :response_headers
24
27
 
28
+ # Response body returned by the destination.
25
29
  attr_accessor :response_body
26
30
 
31
+ # Elapsed time of the request in milliseconds.
27
32
  attr_accessor :latency_ms
28
33
 
34
+ # Error message if the request did not complete.
29
35
  attr_accessor :error
30
36
 
31
37
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -14,12 +14,15 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Audit
17
- # Attribute set for a usage resource. The shape mirrors the ``/api/v1/usage`` contract used by config, flags, and logging — three fields, no per-product extras. Per-period limits live in the product catalog (``GET /api/v1/products``); the usage endpoint reports counts only.
17
+ # Usage counter for a single metered limit.
18
18
  class UsageAttributes < ApiModelBase
19
+ # Identifier of the metered limit, e.g. `audit.customer_events_per_month`.
19
20
  attr_accessor :limit_key
20
21
 
22
+ # Period the counter covers. `current` is the only supported value.
21
23
  attr_accessor :period
22
24
 
25
+ # Count for the period.
23
26
  attr_accessor :value
24
27
 
25
28
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -14,11 +14,14 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Audit
17
+ # Summary of a completed wipe action.
17
18
  class WipeResponse < ApiModelBase
19
+ # Always `true` for a successful wipe.
18
20
  attr_accessor :wiped
19
21
 
20
22
  attr_accessor :tables
21
23
 
24
+ # When the wipe completed.
22
25
  attr_accessor :completed_at
23
26
 
24
27
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -14,17 +14,24 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::Audit
17
+ # Counts of records deleted, broken down by record kind.
17
18
  class WipeTablesSummary < ApiModelBase
19
+ # Number of audit events deleted.
18
20
  attr_accessor :audit_event
19
21
 
22
+ # Number of monthly usage-quota counters deleted.
20
23
  attr_accessor :audit_event_quota
21
24
 
25
+ # Number of forwarders deleted.
22
26
  attr_accessor :forwarder
23
27
 
28
+ # Number of forwarder delivery log entries deleted.
24
29
  attr_accessor :forwarder_delivery
25
30
 
31
+ # Number of distinct `resource_type` entries deleted.
26
32
  attr_accessor :resource_type
27
33
 
34
+ # Number of distinct `action` entries deleted.
28
35
  attr_accessor :action
29
36
 
30
37
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -27,6 +27,7 @@ require 'smplkit_audit_client/models/event'
27
27
  require 'smplkit_audit_client/models/event_list_links'
28
28
  require 'smplkit_audit_client/models/event_list_meta'
29
29
  require 'smplkit_audit_client/models/event_list_response'
30
+ require 'smplkit_audit_client/models/event_request'
30
31
  require 'smplkit_audit_client/models/event_resource'
31
32
  require 'smplkit_audit_client/models/event_response'
32
33
  require 'smplkit_audit_client/models/forwarder'
@@ -38,6 +39,7 @@ require 'smplkit_audit_client/models/forwarder_http'
38
39
  require 'smplkit_audit_client/models/forwarder_list_links'
39
40
  require 'smplkit_audit_client/models/forwarder_list_meta'
40
41
  require 'smplkit_audit_client/models/forwarder_list_response'
42
+ require 'smplkit_audit_client/models/forwarder_request'
41
43
  require 'smplkit_audit_client/models/forwarder_resource'
42
44
  require 'smplkit_audit_client/models/forwarder_response'
43
45
  require 'smplkit_audit_client/models/forwarder_type'
@@ -34,7 +34,7 @@ describe 'ActionsApi' do
34
34
 
35
35
  # unit tests for list_actions
36
36
  # List Actions
37
- # List the distinct &#x60;&#x60;action&#x60;&#x60; slugs seen in the account. Without &#x60;&#x60;filter[resource_type]&#x60;&#x60;, returns one row per distinct action — the same action may have been recorded with multiple resource types and the unfiltered dropdown shows it once. With &#x60;&#x60;filter[resource_type]&#x60;&#x60;, returns the actions seen with that specific resource type, powering the Activity tab&#39;s cascading filter behavior.
37
+ # List the distinct &#x60;action&#x60; slugs recorded for this account. Without &#x60;filter[resource_type]&#x60;, returns one row per distinct action. With &#x60;filter[resource_type]&#x60;, returns the actions recorded for that specific resource type.
38
38
  # @param [Hash] opts the optional parameters
39
39
  # @option opts [String] :filter_resource_type
40
40
  # @option opts [Integer] :page_size
@@ -46,17 +46,4 @@ describe 'ActionsApi' do
46
46
  end
47
47
  end
48
48
 
49
- # unit tests for list_resource_types
50
- # List Resource Types
51
- # List the distinct &#x60;&#x60;resource_type&#x60;&#x60; slugs seen in the account. Each row&#39;s &#x60;&#x60;id&#x60;&#x60; is the slug itself, mirroring the smplkit convention of using customer-provided identifiers as the public-facing resource id (ADR-014).
52
- # @param [Hash] opts the optional parameters
53
- # @option opts [Integer] :page_size
54
- # @option opts [String] :page_after
55
- # @return [ResourceTypeListResponse]
56
- describe 'list_resource_types test' do
57
- it 'should work' do
58
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
59
- end
60
- end
61
-
62
49
  end
@@ -34,7 +34,7 @@ describe 'EventsApi' do
34
34
 
35
35
  # unit tests for get_event
36
36
  # Get Event
37
- # Retrieve a single audit event by id. Returns 404 if no event with that id exists in the caller&#39;s account — RLS enforces tenant isolation; this endpoint never leaks the existence of another tenant&#39;s event.
37
+ # Retrieve a single audit event by id.
38
38
  # @param event_id
39
39
  # @param [Hash] opts the optional parameters
40
40
  # @return [EventResponse]
@@ -46,7 +46,7 @@ describe 'EventsApi' do
46
46
 
47
47
  # unit tests for list_events
48
48
  # List Events
49
- # List audit events for the authenticated account. Default sort is &#x60;&#x60;-created_at&#x60;&#x60;; cursor pagination via &#x60;&#x60;page[after]&#x60;&#x60; (the opaque cursor returned in &#x60;&#x60;links.next&#x60;&#x60;). Filters are exact-match except &#x60;&#x60;filter[occurred_at]&#x60;&#x60; which uses the platform&#39;s range notation (&#x60;&#x60;[2026-01-01T00:00:00Z,*)&#x60;&#x60;) and &#x60;&#x60;filter[search]&#x60;&#x60; which is a case-insensitive substring match (per ADR-014; targets &#x60;&#x60;resource_id&#x60;&#x60; only at this revision).
49
+ # List audit events for this account. Default sort is newest first. Filters are exact-match except &#x60;filter[occurred_at]&#x60;, which uses interval notation (e.g. &#x60;[2026-01-01T00:00:00Z,*)&#x60;), and &#x60;filter[search]&#x60;, which is a case-insensitive substring match against &#x60;resource_id&#x60;.
50
50
  # @param [Hash] opts the optional parameters
51
51
  # @option opts [String] :filter_occurred_at
52
52
  # @option opts [String] :filter_actor_type
@@ -54,7 +54,7 @@ describe 'EventsApi' do
54
54
  # @option opts [String] :filter_action
55
55
  # @option opts [String] :filter_resource_type
56
56
  # @option opts [String] :filter_resource_id
57
- # @option opts [String] :filter_search Case-insensitive substring match. Searches against &#x60;&#x60;resource_id&#x60;&#x60; only — see ADR-014 for the platform-wide &#x60;&#x60;filter[search]&#x60;&#x60; convention. Use &#x60;&#x60;filter[resource_id]&#x60;&#x60; for an exact match.
57
+ # @option opts [String] :filter_search Case-insensitive substring match against &#x60;resource_id&#x60;. Use &#x60;filter[resource_id]&#x60; for an exact match.
58
58
  # @option opts [Integer] :page_size
59
59
  # @option opts [String] :page_after
60
60
  # @return [EventListResponse]
@@ -66,8 +66,8 @@ describe 'EventsApi' do
66
66
 
67
67
  # unit tests for record_event
68
68
  # Record Event
69
- # Record an audit event for the authenticated account. Returns &#x60;&#x60;201 Created&#x60;&#x60; on first write, &#x60;&#x60;200 OK&#x60;&#x60; if the request was a duplicate (matched by &#x60;&#x60;Idempotency-Key&#x60;&#x60; or auto-derived key). Customers may not emit events whose &#x60;&#x60;resource_type&#x60;&#x60; starts with &#x60;&#x60;smpl.&#x60;&#x60; that namespace is reserved for smplkit-emitted events about platform resources.
70
- # @param event_response
69
+ # Record an audit event for this account. Returns &#x60;201 Created&#x60; on first write, &#x60;200 OK&#x60; if the request was a duplicate (matched by &#x60;Idempotency-Key&#x60; or a key derived from the event&#39;s content). &#x60;resource_type&#x60; values beginning with &#x60;smpl.&#x60; are reserved for events that smplkit emits about its own resources and cannot be used here.
70
+ # @param event_request
71
71
  # @param [Hash] opts the optional parameters
72
72
  # @option opts [String] :idempotency_key
73
73
  # @return [EventResponse]
@@ -34,8 +34,8 @@ describe 'ForwardersApi' do
34
34
 
35
35
  # unit tests for create_forwarder
36
36
  # Create Forwarder
37
- # Create a forwarder. Requires the &#x60;&#x60;audit.siem_streaming&#x60;&#x60; entitlement on the account; lower-tier accounts get 402.
38
- # @param forwarder_response
37
+ # Create a forwarder for this account.
38
+ # @param forwarder_request
39
39
  # @param [Hash] opts the optional parameters
40
40
  # @return [ForwarderResponse]
41
41
  describe 'create_forwarder test' do
@@ -46,7 +46,7 @@ describe 'ForwardersApi' do
46
46
 
47
47
  # unit tests for delete_forwarder
48
48
  # Delete Forwarder
49
- # Soft-delete a forwarder. Delivery rows are retained per the normal forwarder_delivery retention; a future create with the same slug is allowed (the unique index is partial on deleted_at IS NULL).
49
+ # Delete a forwarder. Past delivery log entries are retained. A new forwarder may be created later under the same name.
50
50
  # @param forwarder_id
51
51
  # @param [Hash] opts the optional parameters
52
52
  # @return [nil]
@@ -58,7 +58,7 @@ describe 'ForwardersApi' do
58
58
 
59
59
  # unit tests for execute_test_forwarder
60
60
  # Execute Test Forwarder
61
- # Execute a prepared HTTP request server-side and return the response. The same SSRF guard that gates the in-line forwarder loop is applied here internal/private addresses, link-local IPs (including the EC2 metadata service at 169.254.169.254), unique-local IPv6, and ports outside the configured allowlist are all rejected.
61
+ # Send a test HTTP request to a forwarder destination and return the result. Useful for verifying a destination URL, credentials, or transform before saving the forwarder. The same network-safety rules that apply to live deliveries (private/internal address blocking, port allowlist) apply here.
62
62
  # @param test_forwarder_request
63
63
  # @param [Hash] opts the optional parameters
64
64
  # @return [TestForwarderResponse]
@@ -70,7 +70,7 @@ describe 'ForwardersApi' do
70
70
 
71
71
  # unit tests for get_forwarder
72
72
  # Get Forwarder
73
- # Retrieve a single forwarder by id. Returns 404 if no forwarder with that id exists in the caller&#39;s account, including if the forwarder is soft-deleted. Header values in the response are returned in plaintext so callers can perform a GET-modify-PUT round-trip without re-entering secrets (ADR-014). The persisted &#x60;&#x60;forwarder_delivery.request&#x60;&#x60; log column is what keeps redaction; that read path is unaffected by this route.
73
+ # Retrieve a single forwarder by id. Header values are returned in plaintext so the resource can be round-tripped with &#x60;GET&#x60;, mutate, &#x60;PUT&#x60; without re-entering secrets.
74
74
  # @param forwarder_id
75
75
  # @param [Hash] opts the optional parameters
76
76
  # @return [ForwarderResponse]
@@ -82,7 +82,7 @@ describe 'ForwardersApi' do
82
82
 
83
83
  # unit tests for list_forwarder_deliveries
84
84
  # List Forwarder Deliveries
85
- # List delivery rows for a forwarder. Default sort is &#x60;&#x60;-created_at&#x60;&#x60;. Cursor pagination via &#x60;&#x60;page[after]&#x60;&#x60;. Filter by status (&#x60;&#x60;SUCCEEDED&#x60;&#x60; / &#x60;&#x60;FAILED&#x60;&#x60; / &#x60;&#x60;FILTERED_OUT&#x60;&#x60; / &#x60;&#x60;SKIPPED_DO_NOT_FORWARD&#x60;&#x60;, case-insensitive) or by a &#x60;&#x60;created_at&#x60;&#x60; range using the platform&#39;s interval notation (&#x60;&#x60;[2026-01-01T00:00:00Z,*)&#x60;&#x60;). Reads do not require the entitlement — a downgraded account can still inspect historical deliveries from when the forwarder was active.
85
+ # List delivery log entries for a forwarder. Default sort is newest first. Filter by &#x60;status&#x60; (one of &#x60;SUCCEEDED&#x60;, &#x60;FAILED&#x60;, &#x60;FILTERED_OUT&#x60;, &#x60;SKIPPED_DO_NOT_FORWARD&#x60; case-insensitive), by &#x60;event_id&#x60;, or by a &#x60;created_at&#x60; range using interval notation (e.g. &#x60;[2026-01-01T00:00:00Z,*)&#x60;).
86
86
  # @param forwarder_id
87
87
  # @param [Hash] opts the optional parameters
88
88
  # @option opts [String] :filter_status
@@ -99,7 +99,7 @@ describe 'ForwardersApi' do
99
99
 
100
100
  # unit tests for list_forwarders
101
101
  # List Forwarders
102
- # List forwarders for the authenticated account. Reads do not require the entitlement — a downgraded account can still inspect what they configured, they just can&#39;t create new ones.
102
+ # List forwarders for this account.
103
103
  # @param [Hash] opts the optional parameters
104
104
  # @option opts [String] :filter_forwarder_type
105
105
  # @option opts [Boolean] :filter_enabled
@@ -114,7 +114,7 @@ describe 'ForwardersApi' do
114
114
 
115
115
  # unit tests for retry_failed_forwarder_deliveries
116
116
  # Retry Failed Forwarder Deliveries
117
- # Retry every failed delivery for the forwarder. For each failed delivery row, re-attempt with the latest forwarder configuration and the original event payload. Returns counts.
117
+ # Retry every failed delivery for this forwarder. Each failed delivery is re-attempted using the forwarder&#39;s current configuration and the original event. Returns the counts.
118
118
  # @param forwarder_id
119
119
  # @param [Hash] opts the optional parameters
120
120
  # @return [RetryFailedDeliveriesSummary]
@@ -126,7 +126,7 @@ describe 'ForwardersApi' do
126
126
 
127
127
  # unit tests for retry_forwarder_delivery
128
128
  # Retry Forwarder Delivery
129
- # Retry a single failed delivery. Returns the new delivery row with its outcome. Prior delivery rows are not modified.
129
+ # Retry a single failed delivery. Returns the new delivery log entry. The prior entry is left in place.
130
130
  # @param forwarder_id
131
131
  # @param delivery_id
132
132
  # @param [Hash] opts the optional parameters
@@ -139,9 +139,9 @@ describe 'ForwardersApi' do
139
139
 
140
140
  # unit tests for update_forwarder
141
141
  # Update Forwarder
142
- # Full-replace update. PUT semantics every field is overwritten. The GET path returns plaintext header values, so the standard get-mutate-put round-trip (ADR-014) preserves secrets without any extra work from the caller: GET, change one field, PUT the result.
142
+ # Replace an existing forwarder. Every writable field is overwritten.
143
143
  # @param forwarder_id
144
- # @param forwarder_response
144
+ # @param forwarder_request
145
145
  # @param [Hash] opts the optional parameters
146
146
  # @return [ForwarderResponse]
147
147
  describe 'update_forwarder test' do
@@ -34,7 +34,7 @@ describe 'FunctionsApi' do
34
34
 
35
35
  # unit tests for execute_wipe
36
36
  # Execute Wipe
37
- # Delete every audit-database row scoped to the authenticated account. Returns the per-table row counts that were deleted along with the completion timestamp. The action is atomic within the audit database — either every account-scoped row is gone, or none is. The body is required to be &#x60;&#x60;{}&#x60;&#x60;; no parameters are accepted.
37
+ # Delete every audit record this account has stored. Atomic: either every record is deleted, or none is. Returns the per-table counts and the completion timestamp. The request body must be &#x60;{}&#x60;.
38
38
  # @param body
39
39
  # @param [Hash] opts the optional parameters
40
40
  # @return [WipeResponse]
@@ -32,23 +32,9 @@ describe 'ResourceTypesApi' do
32
32
  end
33
33
  end
34
34
 
35
- # unit tests for list_actions
36
- # List Actions
37
- # List the distinct &#x60;&#x60;action&#x60;&#x60; slugs seen in the account. Without &#x60;&#x60;filter[resource_type]&#x60;&#x60;, returns one row per distinct action — the same action may have been recorded with multiple resource types and the unfiltered dropdown shows it once. With &#x60;&#x60;filter[resource_type]&#x60;&#x60;, returns the actions seen with that specific resource type, powering the Activity tab&#39;s cascading filter behavior.
38
- # @param [Hash] opts the optional parameters
39
- # @option opts [String] :filter_resource_type
40
- # @option opts [Integer] :page_size
41
- # @option opts [String] :page_after
42
- # @return [ActionListResponse]
43
- describe 'list_actions test' do
44
- it 'should work' do
45
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
46
- end
47
- end
48
-
49
35
  # unit tests for list_resource_types
50
36
  # List Resource Types
51
- # List the distinct &#x60;&#x60;resource_type&#x60;&#x60; slugs seen in the account. Each row&#39;s &#x60;&#x60;id&#x60;&#x60; is the slug itself, mirroring the smplkit convention of using customer-provided identifiers as the public-facing resource id (ADR-014).
37
+ # List the distinct &#x60;resource_type&#x60; slugs recorded for this account. The resource &#x60;id&#x60; is the slug itself. Useful for populating filter dropdowns in a UI.
52
38
  # @param [Hash] opts the optional parameters
53
39
  # @option opts [Integer] :page_size
54
40
  # @option opts [String] :page_after
@@ -34,8 +34,8 @@ describe 'UsageApi' do
34
34
 
35
35
  # unit tests for list_usage
36
36
  # List Usage
37
- # Current-period usage and quota for the audit product. Only &#x60;&#x60;filter[period]&#x3D;current&#x60;&#x60; is supported; historical usage is a follow-up.
38
- # @param filter_period
37
+ # Report the current-period usage counters for this account.
38
+ # @param filter_period Period to report. &#x60;current&#x60; is the only supported value.
39
39
  # @param [Hash] opts the optional parameters
40
40
  # @return [UsageResponse]
41
41
  describe 'list_usage test' do
@@ -0,0 +1,36 @@
1
+ =begin
2
+ #smplkit Audit API
3
+
4
+ #Append-only change-history substrate for smpl.* resources and customer-application events. ADR-047.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for SmplkitGeneratedClient::Audit::EventRequest
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe SmplkitGeneratedClient::Audit::EventRequest do
21
+ #let(:instance) { SmplkitGeneratedClient::Audit::EventRequest.new }
22
+
23
+ describe 'test an instance of EventRequest' do
24
+ it 'should create an instance of EventRequest' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(SmplkitGeneratedClient::Audit::EventRequest)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "data"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ end
@@ -30,6 +30,10 @@ describe SmplkitGeneratedClient::Audit::ForwarderHttp do
30
30
  describe 'test attribute "method"' do
31
31
  it 'should work' do
32
32
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["GET", "POST", "PUT", "PATCH", "DELETE"])
34
+ # validator.allowable_values.each do |value|
35
+ # expect { instance.method = value }.not_to raise_error
36
+ # end
33
37
  end
34
38
  end
35
39
 
@@ -0,0 +1,36 @@
1
+ =begin
2
+ #smplkit Audit API
3
+
4
+ #Append-only change-history substrate for smpl.* resources and customer-application events. ADR-047.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for SmplkitGeneratedClient::Audit::ForwarderRequest
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe SmplkitGeneratedClient::Audit::ForwarderRequest do
21
+ #let(:instance) { SmplkitGeneratedClient::Audit::ForwarderRequest.new }
22
+
23
+ describe 'test an instance of ForwarderRequest' do
24
+ it 'should create an instance of ForwarderRequest' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(SmplkitGeneratedClient::Audit::ForwarderRequest)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "data"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ end
@@ -93,10 +93,4 @@ describe SmplkitGeneratedClient::Audit::Forwarder do
93
93
  end
94
94
  end
95
95
 
96
- describe 'test attribute "data"' do
97
- it 'should work' do
98
- # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
99
- end
100
- end
101
-
102
96
  end
@@ -30,6 +30,10 @@ describe SmplkitGeneratedClient::Audit::TestForwarderRequest do
30
30
  describe 'test attribute "method"' do
31
31
  it 'should work' do
32
32
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["GET", "POST", "PUT", "PATCH", "DELETE"])
34
+ # validator.allowable_values.each do |value|
35
+ # expect { instance.method = value }.not_to raise_error
36
+ # end
33
37
  end
34
38
  end
35
39
 
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Smplkit
4
+ module Audit
5
+ # +client.audit.actions.list+ — distinct +action+ slugs seen for
6
+ # the account.
7
+ #
8
+ # Without +filter_resource_type+, returns one row per distinct
9
+ # action — an action recorded with multiple resource_types appears
10
+ # once. With the filter, returns the actions seen with that
11
+ # specific resource_type, powering the cascading-filter behavior
12
+ # on the Activity tab.
13
+ #
14
+ # ADR-047 §2.5. Sorted alphabetically; cursor pagination via
15
+ # +page_after+.
16
+ class Actions
17
+ def initialize(api)
18
+ @api = api
19
+ end
20
+
21
+ def list(filter_resource_type: nil, page_size: nil, page_after: nil)
22
+ opts = {}
23
+ opts[:filter_resource_type] = filter_resource_type if filter_resource_type
24
+ opts[:page_size] = page_size if page_size
25
+ opts[:page_after] = page_after if page_after
26
+
27
+ resp = Smplkit::Audit.call_api { @api.list_actions(opts) }
28
+ rows = (resp.data || []).map { |r| Action.from_resource(r) }
29
+ ActionListPage.new(rows, Smplkit::Audit.next_cursor(resp.links&._next))
30
+ end
31
+ end
32
+
33
+ ActionListPage = Struct.new(:actions, :next_cursor)
34
+ end
35
+ end