statelydb 0.29.0 → 0.30.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: 6d5953d075d48d8ca4449644bb88fe0792587f00da52e29d0937b02416b0c0a0
4
- data.tar.gz: 424e94dd43130382ec000b986d701581dd3a76a7e404ae7c4d2f0b3f3d8927b1
3
+ metadata.gz: e351019a0ad023595d08e9bf19a94facc2d1b92d00682516b929a2fe7c5593f7
4
+ data.tar.gz: d347e52bee873414dfa4709d9be9a3a6fae27cbb0482a369bc725224c863eea5
5
5
  SHA512:
6
- metadata.gz: 2f4c26cdb3399124ee45110ad92611551a64d14df7548d92a537797eef804191d538c267bfc82d9c6c20f9e2f3812fd13f9f4fcfb3b60339df743b265b05e1e9
7
- data.tar.gz: 4661408175189b2ef7320a145bee131404eb0b6a542b00e846dfb8fee0a4d3fdbdfb660d43a675b7362d5b7b94d6e17c3fd0a63cda284e624e4d13419ab7b3be
6
+ metadata.gz: faf9e62e260a7c05b57071ae982105d03de3edc23137d5c068e9478afa5a5c03ed2367caca7f698a41c8b9e71862b49006ce6898db1a828bb5ec393df6d8eccf
7
+ data.tar.gz: e731ba43fdb7699136c2ffdd82f2ff6e2a1b83fe317371ccfb994f657b3a3260d04d5246e1e518470a48e8f9b1295c4118b220a3a2bdb90b24b578cdde82b708
@@ -5,7 +5,7 @@
5
5
  require 'google/protobuf'
6
6
 
7
7
 
8
- descriptor_data = "\n\x15\x64\x62/list_filters.proto\x12\nstately.db\"9\n\x0f\x46ilterCondition\x12\x1d\n\titem_type\x18\x01 \x01(\tH\x00R\x08itemTypeB\x07\n\x05valueBk\n\x0e\x63om.stately.dbB\x10ListFiltersProtoP\x01\xa2\x02\x03SDX\xaa\x02\nStately.Db\xca\x02\nStately\\Db\xe2\x02\x16Stately\\Db\\GPBMetadata\xea\x02\x0bStately::Dbb\x06proto3"
8
+ descriptor_data = "\n\x15\x64\x62/list_filters.proto\x12\nstately.db\"}\n\x0f\x46ilterCondition\x12\x1d\n\titem_type\x18\x01 \x01(\tH\x00R\x08itemType\x12\x42\n\x0e\x63\x65l_expression\x18\x02 \x01(\x0b\x32\x19.stately.db.CelExpressionH\x00R\rcelExpressionB\x07\n\x05value\"L\n\rCelExpression\x12\x1b\n\titem_type\x18\x01 \x01(\tR\x08itemType\x12\x1e\n\nexpression\x18\x02 \x01(\tR\nexpressionBk\n\x0e\x63om.stately.dbB\x10ListFiltersProtoP\x01\xa2\x02\x03SDX\xaa\x02\nStately.Db\xca\x02\nStately\\Db\xe2\x02\x16Stately\\Db\\GPBMetadata\xea\x02\x0bStately::Dbb\x06proto3"
9
9
 
10
10
  pool = ::Google::Protobuf::DescriptorPool.generated_pool
11
11
  pool.add_serialized_file(descriptor_data)
@@ -13,5 +13,6 @@ pool.add_serialized_file(descriptor_data)
13
13
  module Stately
14
14
  module Db
15
15
  FilterCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stately.db.FilterCondition").msgclass
16
+ CelExpression = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("stately.db.CelExpression").msgclass
16
17
  end
17
18
  end
data/lib/statelydb.rb CHANGED
@@ -84,7 +84,7 @@ module StatelyDB
84
84
 
85
85
  # Fetch a single Item from a StatelyDB Store at the given key_path.
86
86
  #
87
- # @param key_path [String] the path to the item
87
+ # @param key_path [StatelyDB::KeyPath, String] the path to the item
88
88
  # @return [StatelyDB::Item, NilClass] the Item or nil if not found
89
89
  # @raise [StatelyDB::Error] if the parameters are invalid or if the item is not found
90
90
  #
@@ -99,7 +99,8 @@ module StatelyDB
99
99
 
100
100
  # Fetch a batch of up to 100 Items from a StatelyDB Store at the given key_paths.
101
101
  #
102
- # @param key_paths [String, Array<String>] the paths to the items. Max 100 key paths.
102
+ # @param key_paths [StatelyDB::KeyPath, String, Array<StatelyDB::KeyPath, String>] the paths
103
+ # to the items. Max 100 key paths.
103
104
  # @return [Array<StatelyDB::Item>, NilClass] the items or nil if not found
104
105
  # @raise [StatelyDB::Error] if the parameters are invalid or if the item is not found
105
106
  #
@@ -124,7 +125,7 @@ module StatelyDB
124
125
 
125
126
  # Begin listing Items from a StatelyDB Store at the given prefix.
126
127
  #
127
- # @param prefix [String] the prefix to list
128
+ # @param prefix [StatelyDB::KeyPath, String] the prefix to list
128
129
  # @param limit [Integer] the maximum number of items to return
129
130
  # @param sort_property [String] the property to sort by
130
131
  # @param sort_direction [Symbol, String, Integer] the direction to sort by (:ascending or :descending)
@@ -350,7 +351,8 @@ module StatelyDB
350
351
 
351
352
  # Delete up to 50 Items from a StatelyDB Store at the given key_paths.
352
353
  #
353
- # @param key_paths [String, Array<String>] the paths to the items. Max 50 key paths.
354
+ # @param key_paths [StatelyDB::KeyPath, String, Array<StatelyDB::KeyPath, String>] the paths
355
+ # to the items. Max 50 key paths.
354
356
  # @raise [StatelyDB::Error] if the parameters are invalid
355
357
  # @raise [StatelyDB::Error] if the item is not found
356
358
  # @return [void] nil
@@ -178,7 +178,7 @@ module StatelyDB
178
178
  # Fetch Items from a StatelyDB Store at the given key_path. Note that Items need to exist before being retrieved inside a
179
179
  # transaction.
180
180
  #
181
- # @param key_path [String] the path to the item
181
+ # @param key_path [StatelyDB::KeyPath, String] the path to the item
182
182
  # @return [StatelyDB::Item, NilClass] the item or nil if not found
183
183
  # @raise [StatelyDB::Error::InvalidParameters] if the parameters are invalid
184
184
  # @raise [StatelyDB::Error::NotFound] if the item is not found
@@ -198,7 +198,7 @@ module StatelyDB
198
198
  # key_paths. Note that Items need to exist before being retrieved inside a
199
199
  # transaction.
200
200
  #
201
- # @param key_paths [String, Array<String>] the paths to the items. Max 100
201
+ # @param key_paths [StatelyDB::KeyPath, String, Array<StatelyDB::KeyPath, String>] the paths to the items. Max 100
202
202
  # key paths.
203
203
  # @return [Array<StatelyDB::Item>] the items
204
204
  # @raise [StatelyDB::Error::InvalidParameters] if the parameters are invalid
@@ -310,7 +310,8 @@ module StatelyDB
310
310
  # Delete up to 50 Items from a StatelyDB Store at the given key_paths. Results are not returned until the transaction is
311
311
  # committed and will be available in the Result object returned by commit.
312
312
  #
313
- # @param key_paths [String, Array<String>] the paths to the items. Max 50 key paths.
313
+ # @param key_paths [StatelyDB::KeyPath, String, Array<StatelyDB::KeyPath, String>] the paths
314
+ # to the items. Max 50 key paths.
314
315
  # @return [void] nil
315
316
  #
316
317
  # Example:
@@ -330,7 +331,7 @@ module StatelyDB
330
331
 
331
332
  # Begin listing Items from a StatelyDB Store at the given prefix.
332
333
  #
333
- # @param prefix [String] the prefix to list
334
+ # @param prefix [StatelyDB::KeyPath, String] the prefix to list
334
335
  # @param limit [Integer] the maximum number of items to return
335
336
  # @param sort_property [String] the property to sort by
336
337
  # @param sort_direction [Symbol] the direction to sort by (:ascending or :descending)
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StatelyDB
4
- VERSION = "0.29.0"
4
+ VERSION = "0.30.0"
5
5
  end
@@ -8,29 +8,55 @@ class Stately::Db::FilterCondition
8
8
 
9
9
  sig do
10
10
  params(
11
- item_type: T.nilable(String)
11
+ item_type: T.nilable(String),
12
+ cel_expression: T.nilable(Stately::Db::CelExpression)
12
13
  ).void
13
14
  end
14
15
  def initialize(
15
- item_type: ""
16
+ item_type: "",
17
+ cel_expression: nil
16
18
  )
17
19
  end
18
20
 
19
- # item_type is the type of item to filter by.
21
+ # item_type is the type of item to include in a query response.
20
22
  sig { returns(String) }
21
23
  def item_type
22
24
  end
23
25
 
24
- # item_type is the type of item to filter by.
26
+ # item_type is the type of item to include in a query response.
25
27
  sig { params(value: String).void }
26
28
  def item_type=(value)
27
29
  end
28
30
 
29
- # item_type is the type of item to filter by.
31
+ # item_type is the type of item to include in a query response.
30
32
  sig { void }
31
33
  def clear_item_type
32
34
  end
33
35
 
36
+ # cel_expression is a CEL expression to evaluate against a specific item type.
37
+ # If an expression evaluates to true, the item is included in the results.
38
+ # This expression *only* applies to the item type specified in the
39
+ # CelExpression.item_type field, and is not applied to other item types in the query.
40
+ sig { returns(T.nilable(Stately::Db::CelExpression)) }
41
+ def cel_expression
42
+ end
43
+
44
+ # cel_expression is a CEL expression to evaluate against a specific item type.
45
+ # If an expression evaluates to true, the item is included in the results.
46
+ # This expression *only* applies to the item type specified in the
47
+ # CelExpression.item_type field, and is not applied to other item types in the query.
48
+ sig { params(value: T.nilable(Stately::Db::CelExpression)).void }
49
+ def cel_expression=(value)
50
+ end
51
+
52
+ # cel_expression is a CEL expression to evaluate against a specific item type.
53
+ # If an expression evaluates to true, the item is included in the results.
54
+ # This expression *only* applies to the item type specified in the
55
+ # CelExpression.item_type field, and is not applied to other item types in the query.
56
+ sig { void }
57
+ def clear_cel_expression
58
+ end
59
+
34
60
  sig { returns(T.nilable(Symbol)) }
35
61
  def value
36
62
  end
@@ -67,3 +93,100 @@ class Stately::Db::FilterCondition
67
93
  def self.descriptor
68
94
  end
69
95
  end
96
+
97
+ class Stately::Db::CelExpression
98
+ include ::Google::Protobuf::MessageExts
99
+ extend ::Google::Protobuf::MessageExts::ClassMethods
100
+
101
+ sig do
102
+ params(
103
+ item_type: T.nilable(String),
104
+ expression: T.nilable(String)
105
+ ).void
106
+ end
107
+ def initialize(
108
+ item_type: "",
109
+ expression: ""
110
+ )
111
+ end
112
+
113
+ # item_type is the itemType to evaluate the expression against.
114
+ sig { returns(String) }
115
+ def item_type
116
+ end
117
+
118
+ # item_type is the itemType to evaluate the expression against.
119
+ sig { params(value: String).void }
120
+ def item_type=(value)
121
+ end
122
+
123
+ # item_type is the itemType to evaluate the expression against.
124
+ sig { void }
125
+ def clear_item_type
126
+ end
127
+
128
+ # expression is the CEL expression to evaluate.
129
+ # If the expression evaluates to true, the item is included in the results,
130
+ # otherwise it is excluded.
131
+ #
132
+ # In the context of the CEL expression, 'this' refers to the item being evaluated.
133
+ # For example, the expression is "this.foo == 'bar'" means that the item
134
+ # must have a property 'foo' with the value 'bar' to be included in the results.
135
+ sig { returns(String) }
136
+ def expression
137
+ end
138
+
139
+ # expression is the CEL expression to evaluate.
140
+ # If the expression evaluates to true, the item is included in the results,
141
+ # otherwise it is excluded.
142
+ #
143
+ # In the context of the CEL expression, 'this' refers to the item being evaluated.
144
+ # For example, the expression is "this.foo == 'bar'" means that the item
145
+ # must have a property 'foo' with the value 'bar' to be included in the results.
146
+ sig { params(value: String).void }
147
+ def expression=(value)
148
+ end
149
+
150
+ # expression is the CEL expression to evaluate.
151
+ # If the expression evaluates to true, the item is included in the results,
152
+ # otherwise it is excluded.
153
+ #
154
+ # In the context of the CEL expression, 'this' refers to the item being evaluated.
155
+ # For example, the expression is "this.foo == 'bar'" means that the item
156
+ # must have a property 'foo' with the value 'bar' to be included in the results.
157
+ sig { void }
158
+ def clear_expression
159
+ end
160
+
161
+ sig { params(field: String).returns(T.untyped) }
162
+ def [](field)
163
+ end
164
+
165
+ sig { params(field: String, value: T.untyped).void }
166
+ def []=(field, value)
167
+ end
168
+
169
+ sig { returns(T::Hash[Symbol, T.untyped]) }
170
+ def to_h
171
+ end
172
+
173
+ sig { params(str: String).returns(Stately::Db::CelExpression) }
174
+ def self.decode(str)
175
+ end
176
+
177
+ sig { params(msg: Stately::Db::CelExpression).returns(String) }
178
+ def self.encode(msg)
179
+ end
180
+
181
+ sig { params(str: String, kw: T.untyped).returns(Stately::Db::CelExpression) }
182
+ def self.decode_json(str, **kw)
183
+ end
184
+
185
+ sig { params(msg: Stately::Db::CelExpression, kw: T.untyped).returns(String) }
186
+ def self.encode_json(msg, **kw)
187
+ end
188
+
189
+ sig { returns(::Google::Protobuf::Descriptor) }
190
+ def self.descriptor
191
+ end
192
+ end
data/rbi/statelydb.rbi CHANGED
@@ -245,7 +245,7 @@ module StatelyDB
245
245
  # ```ruby
246
246
  # client.get("/ItemType-identifier")
247
247
  # ```
248
- sig { params(key_path: String).returns(T.any(StatelyDB::Item, NilClass)) }
248
+ sig { params(key_path: T.any(StatelyDB::KeyPath, String)).returns(T.any(StatelyDB::Item, NilClass)) }
249
249
  def get(key_path); end
250
250
 
251
251
  # Fetch a batch of up to 100 Items from a StatelyDB Store at the given key_paths.
@@ -257,7 +257,7 @@ module StatelyDB
257
257
  # ```ruby
258
258
  # client.data.get_batch("/ItemType-identifier", "/ItemType-identifier2")
259
259
  # ```
260
- sig { params(key_paths: T.any(String, T::Array[String])).returns(T.any(T::Array[StatelyDB::Item], NilClass)) }
260
+ sig { params(key_paths: T.any(StatelyDB::KeyPath, String, T::Array[T.any(StatelyDB::KeyPath, String)])).returns(T.any(T::Array[StatelyDB::Item], NilClass)) }
261
261
  def get_batch(*key_paths); end
262
262
 
263
263
  # _@return_ — the list of Items and the token
@@ -400,7 +400,7 @@ module StatelyDB
400
400
  # ```ruby
401
401
  # client.data.delete("/ItemType-identifier", "/ItemType-identifier2")
402
402
  # ```
403
- sig { params(key_paths: T.any(String, T::Array[String])).void }
403
+ sig { params(key_paths: T.any(StatelyDB::KeyPath, String, T::Array[T.any(StatelyDB::KeyPath, String)])).void }
404
404
  def delete(*key_paths); end
405
405
 
406
406
  # Transaction takes a block and executes the block within a transaction.
@@ -927,7 +927,7 @@ module StatelyDB
927
927
  # item = txn.get("/ItemType-identifier")
928
928
  # end
929
929
  # ```
930
- sig { params(key_path: String).returns(T.any(StatelyDB::Item, NilClass)) }
930
+ sig { params(key_path: T.any(StatelyDB::KeyPath, String)).returns(T.any(StatelyDB::Item, NilClass)) }
931
931
  def get(key_path); end
932
932
 
933
933
  # Fetch a batch of up to 100 Items from a StatelyDB Store at the given
@@ -943,7 +943,7 @@ module StatelyDB
943
943
  # _@param_ `key_paths` — the paths to the items. Max 100
944
944
  #
945
945
  # _@return_ — the items
946
- sig { params(key_paths: T.any(String, T::Array[String])).returns(T::Array[StatelyDB::Item]) }
946
+ sig { params(key_paths: T.any(StatelyDB::KeyPath, String, T::Array[T.any(StatelyDB::KeyPath, String)])).returns(T::Array[StatelyDB::Item]) }
947
947
  def get_batch(*key_paths); end
948
948
 
949
949
  # Put a single Item into a StatelyDB store. Results are not returned until the transaction is
@@ -1003,7 +1003,7 @@ module StatelyDB
1003
1003
  # _@param_ `key_paths` — the paths to the items. Max 50 key paths.
1004
1004
  #
1005
1005
  # _@return_ — nil
1006
- sig { params(key_paths: T.any(String, T::Array[String])).void }
1006
+ sig { params(key_paths: T.any(StatelyDB::KeyPath, String, T::Array[T.any(StatelyDB::KeyPath, String)])).void }
1007
1007
  def delete(*key_paths); end
1008
1008
 
1009
1009
  # Example:
data/sig/statelydb.rbs CHANGED
@@ -208,7 +208,7 @@ module StatelyDB
208
208
  # ```ruby
209
209
  # client.get("/ItemType-identifier")
210
210
  # ```
211
- def get: (String key_path) -> (StatelyDB::Item | NilClass)
211
+ def get: ((StatelyDB::KeyPath | String) key_path) -> (StatelyDB::Item | NilClass)
212
212
 
213
213
  # Fetch a batch of up to 100 Items from a StatelyDB Store at the given key_paths.
214
214
  #
@@ -219,7 +219,7 @@ module StatelyDB
219
219
  # ```ruby
220
220
  # client.data.get_batch("/ItemType-identifier", "/ItemType-identifier2")
221
221
  # ```
222
- def get_batch: (*(String | ::Array[String]) key_paths) -> (::Array[StatelyDB::Item] | NilClass)
222
+ def get_batch: (*(StatelyDB::KeyPath | String | ::Array[(StatelyDB::KeyPath | String)]) key_paths) -> (::Array[StatelyDB::Item] | NilClass)
223
223
 
224
224
  # _@return_ — the list of Items and the token
225
225
  #
@@ -350,7 +350,7 @@ module StatelyDB
350
350
  # ```ruby
351
351
  # client.data.delete("/ItemType-identifier", "/ItemType-identifier2")
352
352
  # ```
353
- def delete: (*(String | ::Array[String]) key_paths) -> void
353
+ def delete: (*(StatelyDB::KeyPath | String | ::Array[(StatelyDB::KeyPath | String)]) key_paths) -> void
354
354
 
355
355
  # Transaction takes a block and executes the block within a transaction.
356
356
  # If the block raises an exception, the transaction is rolled back.
@@ -813,7 +813,7 @@ module StatelyDB
813
813
  # item = txn.get("/ItemType-identifier")
814
814
  # end
815
815
  # ```
816
- def get: (String key_path) -> (StatelyDB::Item | NilClass)
816
+ def get: ((StatelyDB::KeyPath | String) key_path) -> (StatelyDB::Item | NilClass)
817
817
 
818
818
  # Fetch a batch of up to 100 Items from a StatelyDB Store at the given
819
819
  # key_paths. Note that Items need to exist before being retrieved inside a
@@ -828,7 +828,7 @@ module StatelyDB
828
828
  # _@param_ `key_paths` — the paths to the items. Max 100
829
829
  #
830
830
  # _@return_ — the items
831
- def get_batch: (*(String | ::Array[String]) key_paths) -> ::Array[StatelyDB::Item]
831
+ def get_batch: (*(StatelyDB::KeyPath | String | ::Array[(StatelyDB::KeyPath | String)]) key_paths) -> ::Array[StatelyDB::Item]
832
832
 
833
833
  # Put a single Item into a StatelyDB store. Results are not returned until the transaction is
834
834
  # committed and will be available in the Result object returned by commit. An identifier for
@@ -885,7 +885,7 @@ module StatelyDB
885
885
  # _@param_ `key_paths` — the paths to the items. Max 50 key paths.
886
886
  #
887
887
  # _@return_ — nil
888
- def delete: (*(String | ::Array[String]) key_paths) -> void
888
+ def delete: (*(StatelyDB::KeyPath | String | ::Array[(StatelyDB::KeyPath | String)]) key_paths) -> void
889
889
 
890
890
  # Example:
891
891
  # client.data.transaction do |txn|
@@ -1008,6 +1008,7 @@ module Stately
1008
1008
  TransactionListResponse: untyped
1009
1009
  TransactionFinished: untyped
1010
1010
  FilterCondition: untyped
1011
+ CelExpression: untyped
1011
1012
  ContinueListRequest: untyped
1012
1013
  ContinueListDirection: untyped
1013
1014
  ContinueScanRequest: untyped
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statelydb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.29.0
4
+ version: 0.30.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stately Cloud, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-06-25 00:00:00.000000000 Z
11
+ date: 2025-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async