safetykit 0.63.0 → 0.65.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 +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +1 -1
- data/lib/safety_kit/models/data_get_settings_params.rb +22 -0
- data/lib/safety_kit/models/data_get_settings_response.rb +47 -0
- data/lib/safety_kit/models/data_update_settings_params.rb +12 -1
- data/lib/safety_kit/models/data_update_settings_response.rb +14 -1
- data/lib/safety_kit/models/stream_add_frame_params.rb +4 -1
- data/lib/safety_kit/models/stream_add_transcript_params.rb +7 -1
- data/lib/safety_kit/models.rb +2 -0
- data/lib/safety_kit/resources/data.rb +27 -3
- data/lib/safety_kit/resources/streams.rb +5 -2
- data/lib/safety_kit/version.rb +1 -1
- data/lib/safety_kit.rb +2 -0
- data/rbi/safety_kit/models/data_get_settings_params.rbi +40 -0
- data/rbi/safety_kit/models/data_get_settings_response.rbi +67 -0
- data/rbi/safety_kit/models/data_update_settings_params.rbi +17 -0
- data/rbi/safety_kit/models/data_update_settings_response.rbi +16 -3
- data/rbi/safety_kit/models/stream_add_frame_params.rbi +6 -0
- data/rbi/safety_kit/models/stream_add_transcript_params.rbi +6 -0
- data/rbi/safety_kit/models.rbi +2 -0
- data/rbi/safety_kit/resources/data.rbi +24 -2
- data/rbi/safety_kit/resources/streams.rbi +6 -0
- data/sig/safety_kit/models/data_get_settings_params.rbs +23 -0
- data/sig/safety_kit/models/data_get_settings_response.rbs +35 -0
- data/sig/safety_kit/models/data_update_settings_params.rbs +7 -0
- data/sig/safety_kit/models/data_update_settings_response.rbs +8 -3
- data/sig/safety_kit/models.rbs +2 -0
- data/sig/safety_kit/resources/data.rbs +6 -0
- metadata +8 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7a3a1b894c949b710e2b5e61a2915834fa2b9873bb5cb535601adf799249c47d
|
|
4
|
+
data.tar.gz: 9b7272b34376f16f382ef73f49a805bdd436127e22d185d417a97617dc62f341
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5a5b3f912481787155ada90dc1d0c9cae11ac2067f2966b1464cdd7e0354f7b4d40480e6f2497a0acc7615580d741001e8cef3ed28c66af24280f0ba326580ea
|
|
7
|
+
data.tar.gz: a02a32981ebb483000fc384190ba833a530482c68c0baa50986b6eed5de658c17af0b4a9e3525335ca3cbdc9a011f06ba62664bf2756dc9ddd5448452210be1b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.65.0 (2026-08-21)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.64.0...v0.65.0](https://github.com/GetSafetyKit/safetykit-ruby/compare/v0.64.0...v0.65.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([ed87348](https://github.com/GetSafetyKit/safetykit-ruby/commit/ed87348ea0ce90f0bfe8b29dbfbac8e5a2c7da7c))
|
|
10
|
+
|
|
11
|
+
## 0.64.0 (2026-08-20)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v0.63.0...v0.64.0](https://github.com/GetSafetyKit/safetykit-ruby/compare/v0.63.0...v0.64.0)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **api:** api update ([1931e07](https://github.com/GetSafetyKit/safetykit-ruby/commit/1931e07d454e90ef8fd8c67022ed2377e4d86293))
|
|
18
|
+
|
|
3
19
|
## 0.63.0 (2026-08-19)
|
|
4
20
|
|
|
5
21
|
Full Changelog: [v0.62.0...v0.63.0](https://github.com/GetSafetyKit/safetykit-ruby/compare/v0.62.0...v0.63.0)
|
data/README.md
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SafetyKit
|
|
4
|
+
module Models
|
|
5
|
+
# @see SafetyKit::Resources::Data#get_settings
|
|
6
|
+
class DataGetSettingsParams < SafetyKit::Internal::Type::BaseModel
|
|
7
|
+
extend SafetyKit::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include SafetyKit::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute namespace
|
|
11
|
+
# The namespace to ingest data into
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :namespace, String
|
|
15
|
+
|
|
16
|
+
# @!method initialize(namespace:, request_options: {})
|
|
17
|
+
# @param namespace [String] The namespace to ingest data into
|
|
18
|
+
#
|
|
19
|
+
# @param request_options [SafetyKit::RequestOptions, Hash{Symbol=>Object}]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SafetyKit
|
|
4
|
+
module Models
|
|
5
|
+
# @see SafetyKit::Resources::Data#get_settings
|
|
6
|
+
class DataGetSettingsResponse < SafetyKit::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute namespace
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
required :namespace, String
|
|
11
|
+
|
|
12
|
+
# @!attribute schema
|
|
13
|
+
# The stored schema for this namespace, returned exactly as stored.
|
|
14
|
+
#
|
|
15
|
+
# @return [Hash{Symbol=>Object, nil}]
|
|
16
|
+
required :schema, SafetyKit::Internal::Type::HashOf[SafetyKit::Internal::Type::Unknown, nil?: true]
|
|
17
|
+
|
|
18
|
+
# @!attribute settings
|
|
19
|
+
# The stored namespace settings. Configure with guidance from SafetyKit.
|
|
20
|
+
#
|
|
21
|
+
# @return [Hash{Symbol=>Object, nil}]
|
|
22
|
+
required :settings, SafetyKit::Internal::Type::HashOf[SafetyKit::Internal::Type::Unknown, nil?: true]
|
|
23
|
+
|
|
24
|
+
# @!attribute version
|
|
25
|
+
# The current configuration version, incremented each time the configuration is
|
|
26
|
+
# updated through the API or by SafetyKit. Send it as previous_version when
|
|
27
|
+
# updating to detect intervening changes.
|
|
28
|
+
#
|
|
29
|
+
# @return [Integer]
|
|
30
|
+
required :version, Integer
|
|
31
|
+
|
|
32
|
+
# @!method initialize(namespace:, schema:, settings:, version:)
|
|
33
|
+
# Some parameter documentations has been truncated, see
|
|
34
|
+
# {SafetyKit::Models::DataGetSettingsResponse} for more details.
|
|
35
|
+
#
|
|
36
|
+
# The namespace's stored configuration and its current version.
|
|
37
|
+
#
|
|
38
|
+
# @param namespace [String]
|
|
39
|
+
#
|
|
40
|
+
# @param schema [Hash{Symbol=>Object, nil}] The stored schema for this namespace, returned exactly as stored.
|
|
41
|
+
#
|
|
42
|
+
# @param settings [Hash{Symbol=>Object, nil}] The stored namespace settings. Configure with guidance from SafetyKit.
|
|
43
|
+
#
|
|
44
|
+
# @param version [Integer] The current configuration version, incremented each time the configuration is up
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -13,6 +13,15 @@ module SafetyKit
|
|
|
13
13
|
# @return [String]
|
|
14
14
|
required :namespace, String
|
|
15
15
|
|
|
16
|
+
# @!attribute previous_version
|
|
17
|
+
# The version returned by GET (or a prior update). When provided, the update is
|
|
18
|
+
# rejected with 409 if the stored configuration has changed since that read, so a
|
|
19
|
+
# stale sync cannot overwrite a newer update. Strongly recommended for automated
|
|
20
|
+
# schema syncs.
|
|
21
|
+
#
|
|
22
|
+
# @return [Integer, nil]
|
|
23
|
+
optional :previous_version, Integer
|
|
24
|
+
|
|
16
25
|
# @!attribute schema
|
|
17
26
|
# New schema to store for this namespace. Omit to leave the existing schema
|
|
18
27
|
# unchanged.
|
|
@@ -27,12 +36,14 @@ module SafetyKit
|
|
|
27
36
|
# @return [Hash{Symbol=>Object, nil}, nil]
|
|
28
37
|
optional :settings, SafetyKit::Internal::Type::HashOf[SafetyKit::Internal::Type::Unknown, nil?: true]
|
|
29
38
|
|
|
30
|
-
# @!method initialize(namespace:, schema: nil, settings: nil, request_options: {})
|
|
39
|
+
# @!method initialize(namespace:, previous_version: nil, schema: nil, settings: nil, request_options: {})
|
|
31
40
|
# Some parameter documentations has been truncated, see
|
|
32
41
|
# {SafetyKit::Models::DataUpdateSettingsParams} for more details.
|
|
33
42
|
#
|
|
34
43
|
# @param namespace [String] The namespace to ingest data into
|
|
35
44
|
#
|
|
45
|
+
# @param previous_version [Integer] The version returned by GET (or a prior update). When provided, the update is re
|
|
46
|
+
#
|
|
36
47
|
# @param schema [Hash{Symbol=>SafetyKit::Models::DataUpdateSettingsParams::Schema}] New schema to store for this namespace. Omit to leave the existing schema unchan
|
|
37
48
|
#
|
|
38
49
|
# @param settings [Hash{Symbol=>Object, nil}] Namespace settings to store, replacing existing settings. Omit to leave existing
|
|
@@ -14,11 +14,24 @@ module SafetyKit
|
|
|
14
14
|
# @return [Symbol, SafetyKit::Models::DataUpdateSettingsResponse::Status]
|
|
15
15
|
required :status, enum: -> { SafetyKit::Models::DataUpdateSettingsResponse::Status }
|
|
16
16
|
|
|
17
|
-
# @!
|
|
17
|
+
# @!attribute version
|
|
18
|
+
# The configuration version after this update. Send it as previous_version on your
|
|
19
|
+
# next update to detect intervening changes.
|
|
20
|
+
#
|
|
21
|
+
# @return [Integer]
|
|
22
|
+
required :version, Integer
|
|
23
|
+
|
|
24
|
+
# @!method initialize(namespace:, status:, version:)
|
|
25
|
+
# Some parameter documentations has been truncated, see
|
|
26
|
+
# {SafetyKit::Models::DataUpdateSettingsResponse} for more details.
|
|
27
|
+
#
|
|
18
28
|
# Namespace configuration was stored.
|
|
19
29
|
#
|
|
20
30
|
# @param namespace [String]
|
|
31
|
+
#
|
|
21
32
|
# @param status [Symbol, SafetyKit::Models::DataUpdateSettingsResponse::Status]
|
|
33
|
+
#
|
|
34
|
+
# @param version [Integer] The configuration version after this update. Send it as previous_version on your
|
|
22
35
|
|
|
23
36
|
# @see SafetyKit::Models::DataUpdateSettingsResponse#status
|
|
24
37
|
module Status
|
|
@@ -33,6 +33,9 @@ module SafetyKit
|
|
|
33
33
|
required :timestamp, Integer
|
|
34
34
|
|
|
35
35
|
# @!attribute frame_id
|
|
36
|
+
# Your identifier for this frame. If a violation is detected, it is echoed back in
|
|
37
|
+
# the live_video.violation_detected webhook's frame_id and per-policy frame_ids
|
|
38
|
+
# fields.
|
|
36
39
|
#
|
|
37
40
|
# @return [String, nil]
|
|
38
41
|
optional :frame_id, String
|
|
@@ -57,7 +60,7 @@ module SafetyKit
|
|
|
57
60
|
#
|
|
58
61
|
# @param timestamp [Integer]
|
|
59
62
|
#
|
|
60
|
-
# @param frame_id [String]
|
|
63
|
+
# @param frame_id [String] Your identifier for this frame. If a violation is detected, it is echoed back in
|
|
61
64
|
#
|
|
62
65
|
# @param metadata [Hash{Symbol=>Object, nil}] Arbitrary key-value metadata to associate with this frame, at most 8192 bytes wh
|
|
63
66
|
#
|
|
@@ -29,11 +29,17 @@ module SafetyKit
|
|
|
29
29
|
required :timestamp, Integer
|
|
30
30
|
|
|
31
31
|
# @!attribute transcript_id
|
|
32
|
+
# Your identifier for this transcript segment. If the segment is reviewed
|
|
33
|
+
# alongside a detected violation, it is echoed back in the
|
|
34
|
+
# live_video.violation_detected webhook's per-policy transcript_ids field.
|
|
32
35
|
#
|
|
33
36
|
# @return [String, nil]
|
|
34
37
|
optional :transcript_id, String
|
|
35
38
|
|
|
36
39
|
# @!method initialize(namespace:, stream_id:, text:, timestamp:, transcript_id: nil, request_options: {})
|
|
40
|
+
# Some parameter documentations has been truncated, see
|
|
41
|
+
# {SafetyKit::Models::StreamAddTranscriptParams} for more details.
|
|
42
|
+
#
|
|
37
43
|
# @param namespace [String] The namespace to ingest stream data into
|
|
38
44
|
#
|
|
39
45
|
# @param stream_id [String]
|
|
@@ -42,7 +48,7 @@ module SafetyKit
|
|
|
42
48
|
#
|
|
43
49
|
# @param timestamp [Integer]
|
|
44
50
|
#
|
|
45
|
-
# @param transcript_id [String]
|
|
51
|
+
# @param transcript_id [String] Your identifier for this transcript segment. If the segment is reviewed alongsid
|
|
46
52
|
#
|
|
47
53
|
# @param request_options [SafetyKit::RequestOptions, Hash{Symbol=>Object}]
|
|
48
54
|
end
|
data/lib/safety_kit/models.rb
CHANGED
|
@@ -57,6 +57,8 @@ module SafetyKit
|
|
|
57
57
|
|
|
58
58
|
DataGetDownloadURLParams = SafetyKit::Models::DataGetDownloadURLParams
|
|
59
59
|
|
|
60
|
+
DataGetSettingsParams = SafetyKit::Models::DataGetSettingsParams
|
|
61
|
+
|
|
60
62
|
DataGetStatusParams = SafetyKit::Models::DataGetStatusParams
|
|
61
63
|
|
|
62
64
|
DataObject = SafetyKit::Models::DataObject
|
|
@@ -83,6 +83,28 @@ module SafetyKit
|
|
|
83
83
|
)
|
|
84
84
|
end
|
|
85
85
|
|
|
86
|
+
# Fetch the stored schema, settings, and configuration version for a namespace.
|
|
87
|
+
# Use the returned version as previous_version when updating so a stale update is
|
|
88
|
+
# rejected instead of overwriting a newer one.
|
|
89
|
+
#
|
|
90
|
+
# @overload get_settings(namespace, request_options: {})
|
|
91
|
+
#
|
|
92
|
+
# @param namespace [String] The namespace to ingest data into
|
|
93
|
+
#
|
|
94
|
+
# @param request_options [SafetyKit::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
95
|
+
#
|
|
96
|
+
# @return [SafetyKit::Models::DataGetSettingsResponse]
|
|
97
|
+
#
|
|
98
|
+
# @see SafetyKit::Models::DataGetSettingsParams
|
|
99
|
+
def get_settings(namespace, params = {})
|
|
100
|
+
@client.request(
|
|
101
|
+
method: :get,
|
|
102
|
+
path: ["v1/data/%1$s/settings", namespace],
|
|
103
|
+
model: SafetyKit::Models::DataGetSettingsResponse,
|
|
104
|
+
options: params[:request_options]
|
|
105
|
+
)
|
|
106
|
+
end
|
|
107
|
+
|
|
86
108
|
# Retrieve the status of a data ingestion request and, once complete, return
|
|
87
109
|
# processed objects inline. If the processed output exceeds the 5 MiB inline
|
|
88
110
|
# response limit, this endpoint returns an error instructing you to use the
|
|
@@ -116,14 +138,16 @@ module SafetyKit
|
|
|
116
138
|
# Some parameter documentations has been truncated, see
|
|
117
139
|
# {SafetyKit::Models::DataUpdateSettingsParams} for more details.
|
|
118
140
|
#
|
|
119
|
-
# Update the schema and/or settings for a namespace.
|
|
120
|
-
#
|
|
141
|
+
# Update the schema and/or settings for a namespace. Each is replaced in full when
|
|
142
|
+
# provided and left unchanged when omitted. Namespaces whose configuration is
|
|
121
143
|
# managed by SafetyKit cannot be updated through this endpoint.
|
|
122
144
|
#
|
|
123
|
-
# @overload update_settings(namespace, schema: nil, settings: nil, request_options: {})
|
|
145
|
+
# @overload update_settings(namespace, previous_version: nil, schema: nil, settings: nil, request_options: {})
|
|
124
146
|
#
|
|
125
147
|
# @param namespace [String] The namespace to ingest data into
|
|
126
148
|
#
|
|
149
|
+
# @param previous_version [Integer] The version returned by GET (or a prior update). When provided, the update is re
|
|
150
|
+
#
|
|
127
151
|
# @param schema [Hash{Symbol=>SafetyKit::Models::DataUpdateSettingsParams::Schema}] New schema to store for this namespace. Omit to leave the existing schema unchan
|
|
128
152
|
#
|
|
129
153
|
# @param settings [Hash{Symbol=>Object, nil}] Namespace settings to store, replacing existing settings. Omit to leave existing
|
|
@@ -66,7 +66,7 @@ module SafetyKit
|
|
|
66
66
|
#
|
|
67
67
|
# @param timestamp [Integer]
|
|
68
68
|
#
|
|
69
|
-
# @param frame_id [String]
|
|
69
|
+
# @param frame_id [String] Your identifier for this frame. If a violation is detected, it is echoed back in
|
|
70
70
|
#
|
|
71
71
|
# @param metadata [Hash{Symbol=>Object, nil}] Arbitrary key-value metadata to associate with this frame, at most 8192 bytes wh
|
|
72
72
|
#
|
|
@@ -86,6 +86,9 @@ module SafetyKit
|
|
|
86
86
|
)
|
|
87
87
|
end
|
|
88
88
|
|
|
89
|
+
# Some parameter documentations has been truncated, see
|
|
90
|
+
# {SafetyKit::Models::StreamAddTranscriptParams} for more details.
|
|
91
|
+
#
|
|
89
92
|
# Ingest a single transcript segment for a livestream using a relative timestamp
|
|
90
93
|
# in milliseconds. The stream does not need to be created beforehand. Transcript
|
|
91
94
|
# timestamps are relative milliseconds from stream start and should be
|
|
@@ -110,7 +113,7 @@ module SafetyKit
|
|
|
110
113
|
#
|
|
111
114
|
# @param timestamp [Integer]
|
|
112
115
|
#
|
|
113
|
-
# @param transcript_id [String]
|
|
116
|
+
# @param transcript_id [String] Your identifier for this transcript segment. If the segment is reviewed alongsid
|
|
114
117
|
#
|
|
115
118
|
# @param request_options [SafetyKit::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
116
119
|
#
|
data/lib/safety_kit/version.rb
CHANGED
data/lib/safety_kit.rb
CHANGED
|
@@ -70,6 +70,8 @@ require_relative "safety_kit/models/data_create_upload_url_params"
|
|
|
70
70
|
require_relative "safety_kit/models/data_create_upload_url_response"
|
|
71
71
|
require_relative "safety_kit/models/data_get_download_url_params"
|
|
72
72
|
require_relative "safety_kit/models/data_get_download_url_response"
|
|
73
|
+
require_relative "safety_kit/models/data_get_settings_params"
|
|
74
|
+
require_relative "safety_kit/models/data_get_settings_response"
|
|
73
75
|
require_relative "safety_kit/models/data_get_status_params"
|
|
74
76
|
require_relative "safety_kit/models/data_get_status_response"
|
|
75
77
|
require_relative "safety_kit/models/data_object"
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module SafetyKit
|
|
4
|
+
module Models
|
|
5
|
+
class DataGetSettingsParams < SafetyKit::Internal::Type::BaseModel
|
|
6
|
+
extend SafetyKit::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include SafetyKit::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(SafetyKit::DataGetSettingsParams, SafetyKit::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The namespace to ingest data into
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :namespace
|
|
17
|
+
|
|
18
|
+
sig do
|
|
19
|
+
params(
|
|
20
|
+
namespace: String,
|
|
21
|
+
request_options: SafetyKit::RequestOptions::OrHash
|
|
22
|
+
).returns(T.attached_class)
|
|
23
|
+
end
|
|
24
|
+
def self.new(
|
|
25
|
+
# The namespace to ingest data into
|
|
26
|
+
namespace:,
|
|
27
|
+
request_options: {}
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
sig do
|
|
32
|
+
override.returns(
|
|
33
|
+
{ namespace: String, request_options: SafetyKit::RequestOptions }
|
|
34
|
+
)
|
|
35
|
+
end
|
|
36
|
+
def to_hash
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module SafetyKit
|
|
4
|
+
module Models
|
|
5
|
+
class DataGetSettingsResponse < SafetyKit::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
SafetyKit::Models::DataGetSettingsResponse,
|
|
10
|
+
SafetyKit::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(String) }
|
|
15
|
+
attr_accessor :namespace
|
|
16
|
+
|
|
17
|
+
# The stored schema for this namespace, returned exactly as stored.
|
|
18
|
+
sig { returns(T::Hash[Symbol, T.nilable(T.anything)]) }
|
|
19
|
+
attr_accessor :schema
|
|
20
|
+
|
|
21
|
+
# The stored namespace settings. Configure with guidance from SafetyKit.
|
|
22
|
+
sig { returns(T::Hash[Symbol, T.nilable(T.anything)]) }
|
|
23
|
+
attr_accessor :settings
|
|
24
|
+
|
|
25
|
+
# The current configuration version, incremented each time the configuration is
|
|
26
|
+
# updated through the API or by SafetyKit. Send it as previous_version when
|
|
27
|
+
# updating to detect intervening changes.
|
|
28
|
+
sig { returns(Integer) }
|
|
29
|
+
attr_accessor :version
|
|
30
|
+
|
|
31
|
+
# The namespace's stored configuration and its current version.
|
|
32
|
+
sig do
|
|
33
|
+
params(
|
|
34
|
+
namespace: String,
|
|
35
|
+
schema: T::Hash[Symbol, T.nilable(T.anything)],
|
|
36
|
+
settings: T::Hash[Symbol, T.nilable(T.anything)],
|
|
37
|
+
version: Integer
|
|
38
|
+
).returns(T.attached_class)
|
|
39
|
+
end
|
|
40
|
+
def self.new(
|
|
41
|
+
namespace:,
|
|
42
|
+
# The stored schema for this namespace, returned exactly as stored.
|
|
43
|
+
schema:,
|
|
44
|
+
# The stored namespace settings. Configure with guidance from SafetyKit.
|
|
45
|
+
settings:,
|
|
46
|
+
# The current configuration version, incremented each time the configuration is
|
|
47
|
+
# updated through the API or by SafetyKit. Send it as previous_version when
|
|
48
|
+
# updating to detect intervening changes.
|
|
49
|
+
version:
|
|
50
|
+
)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
sig do
|
|
54
|
+
override.returns(
|
|
55
|
+
{
|
|
56
|
+
namespace: String,
|
|
57
|
+
schema: T::Hash[Symbol, T.nilable(T.anything)],
|
|
58
|
+
settings: T::Hash[Symbol, T.nilable(T.anything)],
|
|
59
|
+
version: Integer
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
end
|
|
63
|
+
def to_hash
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -18,6 +18,16 @@ module SafetyKit
|
|
|
18
18
|
sig { returns(String) }
|
|
19
19
|
attr_accessor :namespace
|
|
20
20
|
|
|
21
|
+
# The version returned by GET (or a prior update). When provided, the update is
|
|
22
|
+
# rejected with 409 if the stored configuration has changed since that read, so a
|
|
23
|
+
# stale sync cannot overwrite a newer update. Strongly recommended for automated
|
|
24
|
+
# schema syncs.
|
|
25
|
+
sig { returns(T.nilable(Integer)) }
|
|
26
|
+
attr_reader :previous_version
|
|
27
|
+
|
|
28
|
+
sig { params(previous_version: Integer).void }
|
|
29
|
+
attr_writer :previous_version
|
|
30
|
+
|
|
21
31
|
# New schema to store for this namespace. Omit to leave the existing schema
|
|
22
32
|
# unchanged.
|
|
23
33
|
sig do
|
|
@@ -48,6 +58,7 @@ module SafetyKit
|
|
|
48
58
|
sig do
|
|
49
59
|
params(
|
|
50
60
|
namespace: String,
|
|
61
|
+
previous_version: Integer,
|
|
51
62
|
schema:
|
|
52
63
|
T::Hash[
|
|
53
64
|
Symbol,
|
|
@@ -60,6 +71,11 @@ module SafetyKit
|
|
|
60
71
|
def self.new(
|
|
61
72
|
# The namespace to ingest data into
|
|
62
73
|
namespace:,
|
|
74
|
+
# The version returned by GET (or a prior update). When provided, the update is
|
|
75
|
+
# rejected with 409 if the stored configuration has changed since that read, so a
|
|
76
|
+
# stale sync cannot overwrite a newer update. Strongly recommended for automated
|
|
77
|
+
# schema syncs.
|
|
78
|
+
previous_version: nil,
|
|
63
79
|
# New schema to store for this namespace. Omit to leave the existing schema
|
|
64
80
|
# unchanged.
|
|
65
81
|
schema: nil,
|
|
@@ -74,6 +90,7 @@ module SafetyKit
|
|
|
74
90
|
override.returns(
|
|
75
91
|
{
|
|
76
92
|
namespace: String,
|
|
93
|
+
previous_version: Integer,
|
|
77
94
|
schema:
|
|
78
95
|
T::Hash[Symbol, SafetyKit::DataUpdateSettingsParams::Schema],
|
|
79
96
|
settings: T::Hash[Symbol, T.nilable(T.anything)],
|
|
@@ -21,15 +21,27 @@ module SafetyKit
|
|
|
21
21
|
end
|
|
22
22
|
attr_accessor :status
|
|
23
23
|
|
|
24
|
+
# The configuration version after this update. Send it as previous_version on your
|
|
25
|
+
# next update to detect intervening changes.
|
|
26
|
+
sig { returns(Integer) }
|
|
27
|
+
attr_accessor :version
|
|
28
|
+
|
|
24
29
|
# Namespace configuration was stored.
|
|
25
30
|
sig do
|
|
26
31
|
params(
|
|
27
32
|
namespace: String,
|
|
28
33
|
status:
|
|
29
|
-
SafetyKit::Models::DataUpdateSettingsResponse::Status::OrSymbol
|
|
34
|
+
SafetyKit::Models::DataUpdateSettingsResponse::Status::OrSymbol,
|
|
35
|
+
version: Integer
|
|
30
36
|
).returns(T.attached_class)
|
|
31
37
|
end
|
|
32
|
-
def self.new(
|
|
38
|
+
def self.new(
|
|
39
|
+
namespace:,
|
|
40
|
+
status:,
|
|
41
|
+
# The configuration version after this update. Send it as previous_version on your
|
|
42
|
+
# next update to detect intervening changes.
|
|
43
|
+
version:
|
|
44
|
+
)
|
|
33
45
|
end
|
|
34
46
|
|
|
35
47
|
sig do
|
|
@@ -37,7 +49,8 @@ module SafetyKit
|
|
|
37
49
|
{
|
|
38
50
|
namespace: String,
|
|
39
51
|
status:
|
|
40
|
-
SafetyKit::Models::DataUpdateSettingsResponse::Status::TaggedSymbol
|
|
52
|
+
SafetyKit::Models::DataUpdateSettingsResponse::Status::TaggedSymbol,
|
|
53
|
+
version: Integer
|
|
41
54
|
}
|
|
42
55
|
)
|
|
43
56
|
end
|
|
@@ -28,6 +28,9 @@ module SafetyKit
|
|
|
28
28
|
sig { returns(Integer) }
|
|
29
29
|
attr_accessor :timestamp
|
|
30
30
|
|
|
31
|
+
# Your identifier for this frame. If a violation is detected, it is echoed back in
|
|
32
|
+
# the live_video.violation_detected webhook's frame_id and per-policy frame_ids
|
|
33
|
+
# fields.
|
|
31
34
|
sig { returns(T.nilable(String)) }
|
|
32
35
|
attr_reader :frame_id
|
|
33
36
|
|
|
@@ -64,6 +67,9 @@ module SafetyKit
|
|
|
64
67
|
image_data_uri:,
|
|
65
68
|
stream_id:,
|
|
66
69
|
timestamp:,
|
|
70
|
+
# Your identifier for this frame. If a violation is detected, it is echoed back in
|
|
71
|
+
# the live_video.violation_detected webhook's frame_id and per-policy frame_ids
|
|
72
|
+
# fields.
|
|
67
73
|
frame_id: nil,
|
|
68
74
|
# Arbitrary key-value metadata to associate with this frame, at most 8192 bytes
|
|
69
75
|
# when serialized. If a violation is detected on this frame, the metadata is
|
|
@@ -27,6 +27,9 @@ module SafetyKit
|
|
|
27
27
|
sig { returns(Integer) }
|
|
28
28
|
attr_accessor :timestamp
|
|
29
29
|
|
|
30
|
+
# Your identifier for this transcript segment. If the segment is reviewed
|
|
31
|
+
# alongside a detected violation, it is echoed back in the
|
|
32
|
+
# live_video.violation_detected webhook's per-policy transcript_ids field.
|
|
30
33
|
sig { returns(T.nilable(String)) }
|
|
31
34
|
attr_reader :transcript_id
|
|
32
35
|
|
|
@@ -49,6 +52,9 @@ module SafetyKit
|
|
|
49
52
|
stream_id:,
|
|
50
53
|
text:,
|
|
51
54
|
timestamp:,
|
|
55
|
+
# Your identifier for this transcript segment. If the segment is reviewed
|
|
56
|
+
# alongside a detected violation, it is echoed back in the
|
|
57
|
+
# live_video.violation_detected webhook's per-policy transcript_ids field.
|
|
52
58
|
transcript_id: nil,
|
|
53
59
|
request_options: {}
|
|
54
60
|
)
|
data/rbi/safety_kit/models.rbi
CHANGED
|
@@ -22,6 +22,8 @@ module SafetyKit
|
|
|
22
22
|
|
|
23
23
|
DataGetDownloadURLParams = SafetyKit::Models::DataGetDownloadURLParams
|
|
24
24
|
|
|
25
|
+
DataGetSettingsParams = SafetyKit::Models::DataGetSettingsParams
|
|
26
|
+
|
|
25
27
|
DataGetStatusParams = SafetyKit::Models::DataGetStatusParams
|
|
26
28
|
|
|
27
29
|
DataObject = SafetyKit::Models::DataObject
|
|
@@ -62,6 +62,22 @@ module SafetyKit
|
|
|
62
62
|
)
|
|
63
63
|
end
|
|
64
64
|
|
|
65
|
+
# Fetch the stored schema, settings, and configuration version for a namespace.
|
|
66
|
+
# Use the returned version as previous_version when updating so a stale update is
|
|
67
|
+
# rejected instead of overwriting a newer one.
|
|
68
|
+
sig do
|
|
69
|
+
params(
|
|
70
|
+
namespace: String,
|
|
71
|
+
request_options: SafetyKit::RequestOptions::OrHash
|
|
72
|
+
).returns(SafetyKit::Models::DataGetSettingsResponse)
|
|
73
|
+
end
|
|
74
|
+
def get_settings(
|
|
75
|
+
# The namespace to ingest data into
|
|
76
|
+
namespace,
|
|
77
|
+
request_options: {}
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
|
|
65
81
|
# Retrieve the status of a data ingestion request and, once complete, return
|
|
66
82
|
# processed objects inline. If the processed output exceeds the 5 MiB inline
|
|
67
83
|
# response limit, this endpoint returns an error instructing you to use the
|
|
@@ -82,12 +98,13 @@ module SafetyKit
|
|
|
82
98
|
)
|
|
83
99
|
end
|
|
84
100
|
|
|
85
|
-
# Update the schema and/or settings for a namespace.
|
|
86
|
-
#
|
|
101
|
+
# Update the schema and/or settings for a namespace. Each is replaced in full when
|
|
102
|
+
# provided and left unchanged when omitted. Namespaces whose configuration is
|
|
87
103
|
# managed by SafetyKit cannot be updated through this endpoint.
|
|
88
104
|
sig do
|
|
89
105
|
params(
|
|
90
106
|
namespace: String,
|
|
107
|
+
previous_version: Integer,
|
|
91
108
|
schema:
|
|
92
109
|
T::Hash[
|
|
93
110
|
Symbol,
|
|
@@ -100,6 +117,11 @@ module SafetyKit
|
|
|
100
117
|
def update_settings(
|
|
101
118
|
# The namespace to ingest data into
|
|
102
119
|
namespace,
|
|
120
|
+
# The version returned by GET (or a prior update). When provided, the update is
|
|
121
|
+
# rejected with 409 if the stored configuration has changed since that read, so a
|
|
122
|
+
# stale sync cannot overwrite a newer update. Strongly recommended for automated
|
|
123
|
+
# schema syncs.
|
|
124
|
+
previous_version: nil,
|
|
103
125
|
# New schema to store for this namespace. Omit to leave the existing schema
|
|
104
126
|
# unchanged.
|
|
105
127
|
schema: nil,
|
|
@@ -65,6 +65,9 @@ module SafetyKit
|
|
|
65
65
|
image_data_uri:,
|
|
66
66
|
stream_id:,
|
|
67
67
|
timestamp:,
|
|
68
|
+
# Your identifier for this frame. If a violation is detected, it is echoed back in
|
|
69
|
+
# the live_video.violation_detected webhook's frame_id and per-policy frame_ids
|
|
70
|
+
# fields.
|
|
68
71
|
frame_id: nil,
|
|
69
72
|
# Arbitrary key-value metadata to associate with this frame, at most 8192 bytes
|
|
70
73
|
# when serialized. If a violation is detected on this frame, the metadata is
|
|
@@ -103,6 +106,9 @@ module SafetyKit
|
|
|
103
106
|
stream_id:,
|
|
104
107
|
text:,
|
|
105
108
|
timestamp:,
|
|
109
|
+
# Your identifier for this transcript segment. If the segment is reviewed
|
|
110
|
+
# alongside a detected violation, it is echoed back in the
|
|
111
|
+
# live_video.violation_detected webhook's per-policy transcript_ids field.
|
|
106
112
|
transcript_id: nil,
|
|
107
113
|
request_options: {}
|
|
108
114
|
)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module SafetyKit
|
|
2
|
+
module Models
|
|
3
|
+
type data_get_settings_params =
|
|
4
|
+
{ namespace: String } & SafetyKit::Internal::Type::request_parameters
|
|
5
|
+
|
|
6
|
+
class DataGetSettingsParams < SafetyKit::Internal::Type::BaseModel
|
|
7
|
+
extend SafetyKit::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include SafetyKit::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
attr_accessor namespace: String
|
|
11
|
+
|
|
12
|
+
def initialize: (
|
|
13
|
+
namespace: String,
|
|
14
|
+
?request_options: SafetyKit::request_opts
|
|
15
|
+
) -> void
|
|
16
|
+
|
|
17
|
+
def to_hash: -> {
|
|
18
|
+
namespace: String,
|
|
19
|
+
request_options: SafetyKit::RequestOptions
|
|
20
|
+
}
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
module SafetyKit
|
|
2
|
+
module Models
|
|
3
|
+
type data_get_settings_response =
|
|
4
|
+
{
|
|
5
|
+
namespace: String,
|
|
6
|
+
schema: ::Hash[Symbol, top?],
|
|
7
|
+
settings: ::Hash[Symbol, top?],
|
|
8
|
+
version: Integer
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
class DataGetSettingsResponse < SafetyKit::Internal::Type::BaseModel
|
|
12
|
+
attr_accessor namespace: String
|
|
13
|
+
|
|
14
|
+
attr_accessor schema: ::Hash[Symbol, top?]
|
|
15
|
+
|
|
16
|
+
attr_accessor settings: ::Hash[Symbol, top?]
|
|
17
|
+
|
|
18
|
+
attr_accessor version: Integer
|
|
19
|
+
|
|
20
|
+
def initialize: (
|
|
21
|
+
namespace: String,
|
|
22
|
+
schema: ::Hash[Symbol, top?],
|
|
23
|
+
settings: ::Hash[Symbol, top?],
|
|
24
|
+
version: Integer
|
|
25
|
+
) -> void
|
|
26
|
+
|
|
27
|
+
def to_hash: -> {
|
|
28
|
+
namespace: String,
|
|
29
|
+
schema: ::Hash[Symbol, top?],
|
|
30
|
+
settings: ::Hash[Symbol, top?],
|
|
31
|
+
version: Integer
|
|
32
|
+
}
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -3,6 +3,7 @@ module SafetyKit
|
|
|
3
3
|
type data_update_settings_params =
|
|
4
4
|
{
|
|
5
5
|
namespace: String,
|
|
6
|
+
previous_version: Integer,
|
|
6
7
|
schema: ::Hash[Symbol, SafetyKit::DataUpdateSettingsParams::Schema],
|
|
7
8
|
settings: ::Hash[Symbol, top?]
|
|
8
9
|
}
|
|
@@ -14,6 +15,10 @@ module SafetyKit
|
|
|
14
15
|
|
|
15
16
|
attr_accessor namespace: String
|
|
16
17
|
|
|
18
|
+
attr_reader previous_version: Integer?
|
|
19
|
+
|
|
20
|
+
def previous_version=: (Integer) -> Integer
|
|
21
|
+
|
|
17
22
|
attr_reader schema: ::Hash[Symbol, SafetyKit::DataUpdateSettingsParams::Schema]?
|
|
18
23
|
|
|
19
24
|
def schema=: (
|
|
@@ -26,6 +31,7 @@ module SafetyKit
|
|
|
26
31
|
|
|
27
32
|
def initialize: (
|
|
28
33
|
namespace: String,
|
|
34
|
+
?previous_version: Integer,
|
|
29
35
|
?schema: ::Hash[Symbol, SafetyKit::DataUpdateSettingsParams::Schema],
|
|
30
36
|
?settings: ::Hash[Symbol, top?],
|
|
31
37
|
?request_options: SafetyKit::request_opts
|
|
@@ -33,6 +39,7 @@ module SafetyKit
|
|
|
33
39
|
|
|
34
40
|
def to_hash: -> {
|
|
35
41
|
namespace: String,
|
|
42
|
+
previous_version: Integer,
|
|
36
43
|
schema: ::Hash[Symbol, SafetyKit::DataUpdateSettingsParams::Schema],
|
|
37
44
|
settings: ::Hash[Symbol, top?],
|
|
38
45
|
request_options: SafetyKit::RequestOptions
|
|
@@ -3,7 +3,8 @@ module SafetyKit
|
|
|
3
3
|
type data_update_settings_response =
|
|
4
4
|
{
|
|
5
5
|
namespace: String,
|
|
6
|
-
status: SafetyKit::Models::DataUpdateSettingsResponse::status
|
|
6
|
+
status: SafetyKit::Models::DataUpdateSettingsResponse::status,
|
|
7
|
+
version: Integer
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
class DataUpdateSettingsResponse < SafetyKit::Internal::Type::BaseModel
|
|
@@ -11,14 +12,18 @@ module SafetyKit
|
|
|
11
12
|
|
|
12
13
|
attr_accessor status: SafetyKit::Models::DataUpdateSettingsResponse::status
|
|
13
14
|
|
|
15
|
+
attr_accessor version: Integer
|
|
16
|
+
|
|
14
17
|
def initialize: (
|
|
15
18
|
namespace: String,
|
|
16
|
-
status: SafetyKit::Models::DataUpdateSettingsResponse::status
|
|
19
|
+
status: SafetyKit::Models::DataUpdateSettingsResponse::status,
|
|
20
|
+
version: Integer
|
|
17
21
|
) -> void
|
|
18
22
|
|
|
19
23
|
def to_hash: -> {
|
|
20
24
|
namespace: String,
|
|
21
|
-
status: SafetyKit::Models::DataUpdateSettingsResponse::status
|
|
25
|
+
status: SafetyKit::Models::DataUpdateSettingsResponse::status,
|
|
26
|
+
version: Integer
|
|
22
27
|
}
|
|
23
28
|
|
|
24
29
|
type status = :updated
|
data/sig/safety_kit/models.rbs
CHANGED
|
@@ -17,6 +17,8 @@ module SafetyKit
|
|
|
17
17
|
|
|
18
18
|
class DataGetDownloadURLParams = SafetyKit::Models::DataGetDownloadURLParams
|
|
19
19
|
|
|
20
|
+
class DataGetSettingsParams = SafetyKit::Models::DataGetSettingsParams
|
|
21
|
+
|
|
20
22
|
class DataGetStatusParams = SafetyKit::Models::DataGetStatusParams
|
|
21
23
|
|
|
22
24
|
class DataObject = SafetyKit::Models::DataObject
|
|
@@ -18,6 +18,11 @@ module SafetyKit
|
|
|
18
18
|
?request_options: SafetyKit::request_opts
|
|
19
19
|
) -> SafetyKit::Models::DataGetDownloadURLResponse
|
|
20
20
|
|
|
21
|
+
def get_settings: (
|
|
22
|
+
String namespace,
|
|
23
|
+
?request_options: SafetyKit::request_opts
|
|
24
|
+
) -> SafetyKit::Models::DataGetSettingsResponse
|
|
25
|
+
|
|
21
26
|
def get_status: (
|
|
22
27
|
String request_id,
|
|
23
28
|
namespace: String,
|
|
@@ -26,6 +31,7 @@ module SafetyKit
|
|
|
26
31
|
|
|
27
32
|
def update_settings: (
|
|
28
33
|
String namespace,
|
|
34
|
+
?previous_version: Integer,
|
|
29
35
|
?schema: ::Hash[Symbol, SafetyKit::DataUpdateSettingsParams::Schema],
|
|
30
36
|
?settings: ::Hash[Symbol, top?],
|
|
31
37
|
?request_options: SafetyKit::request_opts
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: safetykit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.65.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Safetykit
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-08-
|
|
11
|
+
date: 2026-08-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|
|
@@ -87,6 +87,8 @@ files:
|
|
|
87
87
|
- lib/safety_kit/models/data_create_upload_url_response.rb
|
|
88
88
|
- lib/safety_kit/models/data_get_download_url_params.rb
|
|
89
89
|
- lib/safety_kit/models/data_get_download_url_response.rb
|
|
90
|
+
- lib/safety_kit/models/data_get_settings_params.rb
|
|
91
|
+
- lib/safety_kit/models/data_get_settings_response.rb
|
|
90
92
|
- lib/safety_kit/models/data_get_status_params.rb
|
|
91
93
|
- lib/safety_kit/models/data_get_status_response.rb
|
|
92
94
|
- lib/safety_kit/models/data_object.rb
|
|
@@ -150,6 +152,8 @@ files:
|
|
|
150
152
|
- rbi/safety_kit/models/data_create_upload_url_response.rbi
|
|
151
153
|
- rbi/safety_kit/models/data_get_download_url_params.rbi
|
|
152
154
|
- rbi/safety_kit/models/data_get_download_url_response.rbi
|
|
155
|
+
- rbi/safety_kit/models/data_get_settings_params.rbi
|
|
156
|
+
- rbi/safety_kit/models/data_get_settings_response.rbi
|
|
153
157
|
- rbi/safety_kit/models/data_get_status_params.rbi
|
|
154
158
|
- rbi/safety_kit/models/data_get_status_response.rbi
|
|
155
159
|
- rbi/safety_kit/models/data_object.rbi
|
|
@@ -212,6 +216,8 @@ files:
|
|
|
212
216
|
- sig/safety_kit/models/data_create_upload_url_response.rbs
|
|
213
217
|
- sig/safety_kit/models/data_get_download_url_params.rbs
|
|
214
218
|
- sig/safety_kit/models/data_get_download_url_response.rbs
|
|
219
|
+
- sig/safety_kit/models/data_get_settings_params.rbs
|
|
220
|
+
- sig/safety_kit/models/data_get_settings_response.rbs
|
|
215
221
|
- sig/safety_kit/models/data_get_status_params.rbs
|
|
216
222
|
- sig/safety_kit/models/data_get_status_response.rbs
|
|
217
223
|
- sig/safety_kit/models/data_object.rbs
|