safetykit 0.9.0 → 0.10.0

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: f1a671107be88330ee0f811d53e8682de7abeb3af6a2688377967666e24cd914
4
- data.tar.gz: f3dacbc2b9ec525bf4227eb490ea5e9b49bd9c1504899b0b1211648ea2e78155
3
+ metadata.gz: 18d4c898a7bdefdec9b263795c9926227f77232a5f2da50f728f5bd50c308220
4
+ data.tar.gz: e47f52616b601c40e3402979a2d5f79d3782e5d8aad4027d3521ea9f66399f3c
5
5
  SHA512:
6
- metadata.gz: 236641839506941d2c51deea450ac238e96b06dab2f3127a8e4c2ef6408cb4c4b8fd5c65c514a256ecfd18151c92d4d5122acd0f75898ca88e0d858f5d06e10b
7
- data.tar.gz: 9f0391fc5968b36964e3afff66bc74a39f9abb9889b15f34028ed5a534d52b0cff47f014d0bf499233172796a84cf99721a495c7f07d1fa5329d0e73c6cd25d5
6
+ metadata.gz: 1d2a4c106c7fe8376a58d466cab735769e94110b3cf4360be8b789820a336e007456e6c5ae444bc07512784b6168980cc964f261c7fcbbcf5de2df38c76ac703
7
+ data.tar.gz: 8dc9ec8ced457812412944b1504acd16e7232ff530df96eccdb72ec11fbf85faf16b9f8a21629f7f8aa33bc66e2ee4e94fc27bca098a1d4b642dc0b74c87435c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.0 (2026-06-01)
4
+
5
+ Full Changelog: [v0.9.0...v0.10.0](https://github.com/GetSafetyKit/safetykit-ruby/compare/v0.9.0...v0.10.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([aee3f63](https://github.com/GetSafetyKit/safetykit-ruby/commit/aee3f6328ed102537734db57da1b09fc90c8b5a7))
10
+
3
11
  ## 0.9.0 (2026-06-01)
4
12
 
5
13
  Full Changelog: [v0.8.0...v0.9.0](https://github.com/GetSafetyKit/safetykit-ruby/compare/v0.8.0...v0.9.0)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "safetykit", "~> 0.9.0"
20
+ gem "safetykit", "~> 0.10.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -7,24 +7,85 @@ module SafetyKit
7
7
  extend SafetyKit::Internal::Type::RequestParameters::Converter
8
8
  include SafetyKit::Internal::Type::RequestParameters
9
9
 
10
- # @!attribute customer_session_hash
11
- # Hashed customer browser session value associated with the browser SDK session.
10
+ # @!attribute body
11
+ # Request body for creating a browser-safe webapp SDK session token from
12
+ # server-side code. Provide at least one of customer_user_id or
13
+ # customer_session_hash.
12
14
  #
13
- # @return [String, nil]
14
- optional :customer_session_hash, String
15
+ # @return [SafetyKit::Models::ClientSessionCreateSessionParams::Body::UnionMember0, SafetyKit::Models::ClientSessionCreateSessionParams::Body::UnionMember1, nil]
16
+ optional :body, union: -> { SafetyKit::ClientSessionCreateSessionParams::Body }
15
17
 
16
- # @!attribute customer_user_id
17
- # Customer user identifier associated with the browser SDK session.
18
+ # @!method initialize(body: nil, request_options: {})
19
+ # Some parameter documentations has been truncated, see
20
+ # {SafetyKit::Models::ClientSessionCreateSessionParams} for more details.
18
21
  #
19
- # @return [String, nil]
20
- optional :customer_user_id, String
21
-
22
- # @!method initialize(customer_session_hash: nil, customer_user_id: nil, request_options: {})
23
- # @param customer_session_hash [String] Hashed customer browser session value associated with the browser SDK session.
24
- #
25
- # @param customer_user_id [String] Customer user identifier associated with the browser SDK session.
22
+ # @param body [SafetyKit::Models::ClientSessionCreateSessionParams::Body::UnionMember0, SafetyKit::Models::ClientSessionCreateSessionParams::Body::UnionMember1] Request body for creating a browser-safe webapp SDK session token from server-si
26
23
  #
27
24
  # @param request_options [SafetyKit::RequestOptions, Hash{Symbol=>Object}]
25
+
26
+ # Request body for creating a browser-safe webapp SDK session token from
27
+ # server-side code. Provide at least one of customer_user_id or
28
+ # customer_session_hash.
29
+ module Body
30
+ extend SafetyKit::Internal::Type::Union
31
+
32
+ variant -> { SafetyKit::ClientSessionCreateSessionParams::Body::UnionMember0 }
33
+
34
+ variant -> { SafetyKit::ClientSessionCreateSessionParams::Body::UnionMember1 }
35
+
36
+ class UnionMember0 < SafetyKit::Internal::Type::BaseModel
37
+ # @!attribute customer_user_id
38
+ # Customer user identifier associated with the browser SDK session. Use the same
39
+ # canonical user ID string that you send as user_id in SafetyKit server-to-server
40
+ # events.
41
+ #
42
+ # @return [String]
43
+ required :customer_user_id, String
44
+
45
+ # @!attribute customer_session_hash
46
+ # Stable opaque customer session hash associated with the browser SDK session.
47
+ #
48
+ # @return [String, nil]
49
+ optional :customer_session_hash, String
50
+
51
+ # @!method initialize(customer_user_id:, customer_session_hash: nil)
52
+ # Some parameter documentations has been truncated, see
53
+ # {SafetyKit::Models::ClientSessionCreateSessionParams::Body::UnionMember0} for
54
+ # more details.
55
+ #
56
+ # @param customer_user_id [String] Customer user identifier associated with the browser SDK session. Use the same c
57
+ #
58
+ # @param customer_session_hash [String] Stable opaque customer session hash associated with the browser SDK session.
59
+ end
60
+
61
+ class UnionMember1 < SafetyKit::Internal::Type::BaseModel
62
+ # @!attribute customer_session_hash
63
+ # Stable opaque customer session hash associated with the browser SDK session.
64
+ #
65
+ # @return [String]
66
+ required :customer_session_hash, String
67
+
68
+ # @!attribute customer_user_id
69
+ # Customer user identifier associated with the browser SDK session. Use the same
70
+ # canonical user ID string that you send as user_id in SafetyKit server-to-server
71
+ # events.
72
+ #
73
+ # @return [String, nil]
74
+ optional :customer_user_id, String
75
+
76
+ # @!method initialize(customer_session_hash:, customer_user_id: nil)
77
+ # Some parameter documentations has been truncated, see
78
+ # {SafetyKit::Models::ClientSessionCreateSessionParams::Body::UnionMember1} for
79
+ # more details.
80
+ #
81
+ # @param customer_session_hash [String] Stable opaque customer session hash associated with the browser SDK session.
82
+ #
83
+ # @param customer_user_id [String] Customer user identifier associated with the browser SDK session. Use the same c
84
+ end
85
+
86
+ # @!method self.variants
87
+ # @return [Array(SafetyKit::Models::ClientSessionCreateSessionParams::Body::UnionMember0, SafetyKit::Models::ClientSessionCreateSessionParams::Body::UnionMember1)]
88
+ end
28
89
  end
29
90
  end
30
91
  end
@@ -5,15 +5,19 @@ module SafetyKit
5
5
  # Create browser-safe webapp SDK session tokens from authenticated server-side
6
6
  # code.
7
7
  class ClientSessions
8
- # Create a browser-safe SafetyKit webapp SDK session token from server-side code
9
- # before rendering pages that load the browser SDK. The request must be
10
- # authenticated with a valid Bearer token.
8
+ # Some parameter documentations has been truncated, see
9
+ # {SafetyKit::Models::ClientSessionCreateSessionParams} for more details.
11
10
  #
12
- # @overload create_session(customer_session_hash: nil, customer_user_id: nil, request_options: {})
11
+ # Create a browser-safe SafetyKit webapp SDK session token from server-side code
12
+ # before rendering pages that load the browser SDK. Provide at least one of
13
+ # customer_user_id or customer_session_hash. When customer_user_id is present, use
14
+ # the same canonical user ID string that you send as user_id in SafetyKit
15
+ # server-to-server events. The request must be authenticated with a valid Bearer
16
+ # token.
13
17
  #
14
- # @param customer_session_hash [String] Hashed customer browser session value associated with the browser SDK session.
18
+ # @overload create_session(body: nil, request_options: {})
15
19
  #
16
- # @param customer_user_id [String] Customer user identifier associated with the browser SDK session.
20
+ # @param body [SafetyKit::Models::ClientSessionCreateSessionParams::Body::UnionMember0, SafetyKit::Models::ClientSessionCreateSessionParams::Body::UnionMember1] Request body for creating a browser-safe webapp SDK session token from server-si
17
21
  #
18
22
  # @param request_options [SafetyKit::RequestOptions, Hash{Symbol=>Object}, nil]
19
23
  #
@@ -26,7 +30,7 @@ module SafetyKit
26
30
  @client.request(
27
31
  method: :post,
28
32
  path: path,
29
- body: parsed,
33
+ body: parsed[:body],
30
34
  model: SafetyKit::Models::ClientSessionCreateSessionResponse,
31
35
  options: options
32
36
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SafetyKit
4
- VERSION = "0.9.0"
4
+ VERSION = "0.10.0"
5
5
  end
@@ -14,32 +14,47 @@ module SafetyKit
14
14
  )
15
15
  end
16
16
 
17
- # Hashed customer browser session value associated with the browser SDK session.
18
- sig { returns(T.nilable(String)) }
19
- attr_reader :customer_session_hash
20
-
21
- sig { params(customer_session_hash: String).void }
22
- attr_writer :customer_session_hash
23
-
24
- # Customer user identifier associated with the browser SDK session.
25
- sig { returns(T.nilable(String)) }
26
- attr_reader :customer_user_id
17
+ # Request body for creating a browser-safe webapp SDK session token from
18
+ # server-side code. Provide at least one of customer_user_id or
19
+ # customer_session_hash.
20
+ sig do
21
+ returns(
22
+ T.nilable(
23
+ T.any(
24
+ SafetyKit::ClientSessionCreateSessionParams::Body::UnionMember0,
25
+ SafetyKit::ClientSessionCreateSessionParams::Body::UnionMember1
26
+ )
27
+ )
28
+ )
29
+ end
30
+ attr_reader :body
27
31
 
28
- sig { params(customer_user_id: String).void }
29
- attr_writer :customer_user_id
32
+ sig do
33
+ params(
34
+ body:
35
+ T.any(
36
+ SafetyKit::ClientSessionCreateSessionParams::Body::UnionMember0::OrHash,
37
+ SafetyKit::ClientSessionCreateSessionParams::Body::UnionMember1::OrHash
38
+ )
39
+ ).void
40
+ end
41
+ attr_writer :body
30
42
 
31
43
  sig do
32
44
  params(
33
- customer_session_hash: String,
34
- customer_user_id: String,
45
+ body:
46
+ T.any(
47
+ SafetyKit::ClientSessionCreateSessionParams::Body::UnionMember0::OrHash,
48
+ SafetyKit::ClientSessionCreateSessionParams::Body::UnionMember1::OrHash
49
+ ),
35
50
  request_options: SafetyKit::RequestOptions::OrHash
36
51
  ).returns(T.attached_class)
37
52
  end
38
53
  def self.new(
39
- # Hashed customer browser session value associated with the browser SDK session.
40
- customer_session_hash: nil,
41
- # Customer user identifier associated with the browser SDK session.
42
- customer_user_id: nil,
54
+ # Request body for creating a browser-safe webapp SDK session token from
55
+ # server-side code. Provide at least one of customer_user_id or
56
+ # customer_session_hash.
57
+ body: nil,
43
58
  request_options: {}
44
59
  )
45
60
  end
@@ -47,14 +62,136 @@ module SafetyKit
47
62
  sig do
48
63
  override.returns(
49
64
  {
50
- customer_session_hash: String,
51
- customer_user_id: String,
65
+ body:
66
+ T.any(
67
+ SafetyKit::ClientSessionCreateSessionParams::Body::UnionMember0,
68
+ SafetyKit::ClientSessionCreateSessionParams::Body::UnionMember1
69
+ ),
52
70
  request_options: SafetyKit::RequestOptions
53
71
  }
54
72
  )
55
73
  end
56
74
  def to_hash
57
75
  end
76
+
77
+ # Request body for creating a browser-safe webapp SDK session token from
78
+ # server-side code. Provide at least one of customer_user_id or
79
+ # customer_session_hash.
80
+ module Body
81
+ extend SafetyKit::Internal::Type::Union
82
+
83
+ Variants =
84
+ T.type_alias do
85
+ T.any(
86
+ SafetyKit::ClientSessionCreateSessionParams::Body::UnionMember0,
87
+ SafetyKit::ClientSessionCreateSessionParams::Body::UnionMember1
88
+ )
89
+ end
90
+
91
+ class UnionMember0 < SafetyKit::Internal::Type::BaseModel
92
+ OrHash =
93
+ T.type_alias do
94
+ T.any(
95
+ SafetyKit::ClientSessionCreateSessionParams::Body::UnionMember0,
96
+ SafetyKit::Internal::AnyHash
97
+ )
98
+ end
99
+
100
+ # Customer user identifier associated with the browser SDK session. Use the same
101
+ # canonical user ID string that you send as user_id in SafetyKit server-to-server
102
+ # events.
103
+ sig { returns(String) }
104
+ attr_accessor :customer_user_id
105
+
106
+ # Stable opaque customer session hash associated with the browser SDK session.
107
+ sig { returns(T.nilable(String)) }
108
+ attr_reader :customer_session_hash
109
+
110
+ sig { params(customer_session_hash: String).void }
111
+ attr_writer :customer_session_hash
112
+
113
+ sig do
114
+ params(
115
+ customer_user_id: String,
116
+ customer_session_hash: String
117
+ ).returns(T.attached_class)
118
+ end
119
+ def self.new(
120
+ # Customer user identifier associated with the browser SDK session. Use the same
121
+ # canonical user ID string that you send as user_id in SafetyKit server-to-server
122
+ # events.
123
+ customer_user_id:,
124
+ # Stable opaque customer session hash associated with the browser SDK session.
125
+ customer_session_hash: nil
126
+ )
127
+ end
128
+
129
+ sig do
130
+ override.returns(
131
+ { customer_user_id: String, customer_session_hash: String }
132
+ )
133
+ end
134
+ def to_hash
135
+ end
136
+ end
137
+
138
+ class UnionMember1 < SafetyKit::Internal::Type::BaseModel
139
+ OrHash =
140
+ T.type_alias do
141
+ T.any(
142
+ SafetyKit::ClientSessionCreateSessionParams::Body::UnionMember1,
143
+ SafetyKit::Internal::AnyHash
144
+ )
145
+ end
146
+
147
+ # Stable opaque customer session hash associated with the browser SDK session.
148
+ sig { returns(String) }
149
+ attr_accessor :customer_session_hash
150
+
151
+ # Customer user identifier associated with the browser SDK session. Use the same
152
+ # canonical user ID string that you send as user_id in SafetyKit server-to-server
153
+ # events.
154
+ sig { returns(T.nilable(String)) }
155
+ attr_reader :customer_user_id
156
+
157
+ sig { params(customer_user_id: String).void }
158
+ attr_writer :customer_user_id
159
+
160
+ sig do
161
+ params(
162
+ customer_session_hash: String,
163
+ customer_user_id: String
164
+ ).returns(T.attached_class)
165
+ end
166
+ def self.new(
167
+ # Stable opaque customer session hash associated with the browser SDK session.
168
+ customer_session_hash:,
169
+ # Customer user identifier associated with the browser SDK session. Use the same
170
+ # canonical user ID string that you send as user_id in SafetyKit server-to-server
171
+ # events.
172
+ customer_user_id: nil
173
+ )
174
+ end
175
+
176
+ sig do
177
+ override.returns(
178
+ { customer_session_hash: String, customer_user_id: String }
179
+ )
180
+ end
181
+ def to_hash
182
+ end
183
+ end
184
+
185
+ sig do
186
+ override.returns(
187
+ T::Array[
188
+ SafetyKit::ClientSessionCreateSessionParams::Body::Variants
189
+ ]
190
+ )
191
+ end
192
+ def self.variants
193
+ end
194
+ end
58
195
  end
59
196
  end
60
197
  end
@@ -6,20 +6,26 @@ module SafetyKit
6
6
  # code.
7
7
  class ClientSessions
8
8
  # Create a browser-safe SafetyKit webapp SDK session token from server-side code
9
- # before rendering pages that load the browser SDK. The request must be
10
- # authenticated with a valid Bearer token.
9
+ # before rendering pages that load the browser SDK. Provide at least one of
10
+ # customer_user_id or customer_session_hash. When customer_user_id is present, use
11
+ # the same canonical user ID string that you send as user_id in SafetyKit
12
+ # server-to-server events. The request must be authenticated with a valid Bearer
13
+ # token.
11
14
  sig do
12
15
  params(
13
- customer_session_hash: String,
14
- customer_user_id: String,
16
+ body:
17
+ T.any(
18
+ SafetyKit::ClientSessionCreateSessionParams::Body::UnionMember0::OrHash,
19
+ SafetyKit::ClientSessionCreateSessionParams::Body::UnionMember1::OrHash
20
+ ),
15
21
  request_options: SafetyKit::RequestOptions::OrHash
16
22
  ).returns(SafetyKit::Models::ClientSessionCreateSessionResponse)
17
23
  end
18
24
  def create_session(
19
- # Hashed customer browser session value associated with the browser SDK session.
20
- customer_session_hash: nil,
21
- # Customer user identifier associated with the browser SDK session.
22
- customer_user_id: nil,
25
+ # Request body for creating a browser-safe webapp SDK session token from
26
+ # server-side code. Provide at least one of customer_user_id or
27
+ # customer_session_hash.
28
+ body: nil,
23
29
  request_options: {}
24
30
  )
25
31
  end
@@ -1,32 +1,80 @@
1
1
  module SafetyKit
2
2
  module Models
3
3
  type client_session_create_session_params =
4
- { customer_session_hash: String, customer_user_id: String }
4
+ { body: SafetyKit::Models::ClientSessionCreateSessionParams::body }
5
5
  & SafetyKit::Internal::Type::request_parameters
6
6
 
7
7
  class ClientSessionCreateSessionParams < SafetyKit::Internal::Type::BaseModel
8
8
  extend SafetyKit::Internal::Type::RequestParameters::Converter
9
9
  include SafetyKit::Internal::Type::RequestParameters
10
10
 
11
- attr_reader customer_session_hash: String?
11
+ attr_reader body: SafetyKit::Models::ClientSessionCreateSessionParams::body?
12
12
 
13
- def customer_session_hash=: (String) -> String
14
-
15
- attr_reader customer_user_id: String?
16
-
17
- def customer_user_id=: (String) -> String
13
+ def body=: (
14
+ SafetyKit::Models::ClientSessionCreateSessionParams::body
15
+ ) -> SafetyKit::Models::ClientSessionCreateSessionParams::body
18
16
 
19
17
  def initialize: (
20
- ?customer_session_hash: String,
21
- ?customer_user_id: String,
18
+ ?body: SafetyKit::Models::ClientSessionCreateSessionParams::body,
22
19
  ?request_options: SafetyKit::request_opts
23
20
  ) -> void
24
21
 
25
22
  def to_hash: -> {
26
- customer_session_hash: String,
27
- customer_user_id: String,
23
+ body: SafetyKit::Models::ClientSessionCreateSessionParams::body,
28
24
  request_options: SafetyKit::RequestOptions
29
25
  }
26
+
27
+ type body =
28
+ SafetyKit::ClientSessionCreateSessionParams::Body::UnionMember0
29
+ | SafetyKit::ClientSessionCreateSessionParams::Body::UnionMember1
30
+
31
+ module Body
32
+ extend SafetyKit::Internal::Type::Union
33
+
34
+ type union_member0 =
35
+ { customer_user_id: String, customer_session_hash: String }
36
+
37
+ class UnionMember0 < SafetyKit::Internal::Type::BaseModel
38
+ attr_accessor customer_user_id: String
39
+
40
+ attr_reader customer_session_hash: String?
41
+
42
+ def customer_session_hash=: (String) -> String
43
+
44
+ def initialize: (
45
+ customer_user_id: String,
46
+ ?customer_session_hash: String
47
+ ) -> void
48
+
49
+ def to_hash: -> {
50
+ customer_user_id: String,
51
+ customer_session_hash: String
52
+ }
53
+ end
54
+
55
+ type union_member1 =
56
+ { customer_session_hash: String, customer_user_id: String }
57
+
58
+ class UnionMember1 < SafetyKit::Internal::Type::BaseModel
59
+ attr_accessor customer_session_hash: String
60
+
61
+ attr_reader customer_user_id: String?
62
+
63
+ def customer_user_id=: (String) -> String
64
+
65
+ def initialize: (
66
+ customer_session_hash: String,
67
+ ?customer_user_id: String
68
+ ) -> void
69
+
70
+ def to_hash: -> {
71
+ customer_session_hash: String,
72
+ customer_user_id: String
73
+ }
74
+ end
75
+
76
+ def self?.variants: -> ::Array[SafetyKit::Models::ClientSessionCreateSessionParams::body]
77
+ end
30
78
  end
31
79
  end
32
80
  end
@@ -2,8 +2,7 @@ module SafetyKit
2
2
  module Resources
3
3
  class ClientSessions
4
4
  def create_session: (
5
- ?customer_session_hash: String,
6
- ?customer_user_id: String,
5
+ ?body: SafetyKit::Models::ClientSessionCreateSessionParams::body,
7
6
  ?request_options: SafetyKit::request_opts
8
7
  ) -> SafetyKit::Models::ClientSessionCreateSessionResponse
9
8
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safetykit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Safetykit