statelydb 0.25.1 → 0.29.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.
data/rbi/statelydb.rbi CHANGED
@@ -182,7 +182,8 @@ module StatelyDB
182
182
  sig { params(namespace: String, identifier: T.nilable(T.any(String, StatelyDB::UUID, T.untyped))).returns(StatelyDB::KeyPath) }
183
183
  def self.with(namespace, identifier = nil); end
184
184
 
185
- # If the value is a binary string, encode it as a url-safe base64 string with padding removed.
185
+ # If the value is a binary string, encode it as a url-safe
186
+ # base64 string with padding removed.
186
187
  #
187
188
  # _@param_ `value` — The value to convert to a key id.
188
189
  sig { params(value: T.any(String, StatelyDB::UUID, T.untyped)).returns(String) }
@@ -259,16 +260,6 @@ module StatelyDB
259
260
  sig { params(key_paths: T.any(String, T::Array[String])).returns(T.any(T::Array[StatelyDB::Item], NilClass)) }
260
261
  def get_batch(*key_paths); end
261
262
 
262
- # Begin listing Items from a StatelyDB Store at the given prefix.
263
- #
264
- # _@param_ `prefix` — the prefix to list
265
- #
266
- # _@param_ `limit` — the maximum number of items to return
267
- #
268
- # _@param_ `sort_property` — the property to sort by
269
- #
270
- # _@param_ `sort_direction` — the direction to sort by (:ascending or :descending)
271
- #
272
263
  # _@return_ — the list of Items and the token
273
264
  #
274
265
  # ```ruby
@@ -276,13 +267,18 @@ module StatelyDB
276
267
  # ```
277
268
  sig do
278
269
  params(
279
- prefix: String,
280
- limit: Integer,
281
- sort_property: T.nilable(String),
282
- sort_direction: Symbol
270
+ prefix: T.untyped,
271
+ limit: T.untyped,
272
+ sort_property: T.untyped,
273
+ sort_direction: T.untyped,
274
+ item_types: T.untyped,
275
+ gt: T.untyped,
276
+ gte: T.untyped,
277
+ lt: T.untyped,
278
+ lte: T.untyped
283
279
  ).returns(T.any(T::Array[StatelyDB::Item], StatelyDB::Token))
284
280
  end
285
- def begin_list(prefix, limit: 100, sort_property: nil, sort_direction: :ascending); end
281
+ def begin_list(prefix, limit: 100, sort_property: nil, sort_direction: :ascending, item_types: [], gt: nil, gte: nil, lt: nil, lte: nil); end
286
282
 
287
283
  # Continue listing Items from a StatelyDB Store using a token.
288
284
  #
@@ -529,9 +525,11 @@ module StatelyDB
529
525
  module Auth
530
526
  # GRPC interceptor to authenticate against Stately and append bearer tokens to outgoing requests
531
527
  class Interceptor < GRPC::ClientInterceptor
532
- # _@param_ `token_provider` The token provider to use for authentication
528
+ # This must have been started already.
529
+ #
530
+ # _@param_ `token_provider` — The token provider to use for authentication.
533
531
  sig { params(token_provider: StatelyDB::Common::Auth::TokenProvider).void }
534
- def initialize(token_provider: AuthTokenProvider.new); end
532
+ def initialize(token_provider:); end
535
533
 
536
534
  # gRPC client unary interceptor
537
535
  #
@@ -694,6 +692,12 @@ module StatelyDB
694
692
  # TokenProvider is an abstract base class that should be extended
695
693
  # for individual token provider implementations
696
694
  class TokenProvider
695
+ # Start the token provider. Starting multiple times should be a no-op.
696
+ #
697
+ # _@param_ `endpoint` — The endpoint to connect to
698
+ sig { params(endpoint: String).void }
699
+ def start(endpoint: "https://api.stately.cloud"); end
700
+
697
701
  # Get the current access token
698
702
  #
699
703
  # _@param_ `force` — Whether to force a refresh of the token
@@ -712,13 +716,15 @@ module StatelyDB
712
716
  # It will default to using the value of `STATELY_ACCESS_KEY` if
713
717
  # no credentials are explicitly passed and will throw an error if no credentials are found.
714
718
  class AuthTokenProvider < StatelyDB::Common::Auth::TokenProvider
715
- # _@param_ `endpoint` — The endpoint of the auth server
716
- #
717
719
  # _@param_ `access_key` — The StatelyDB access key credential
718
720
  #
719
721
  # _@param_ `base_retry_backoff_secs` — The base retry backoff in seconds
720
- sig { params(endpoint: String, access_key: String, base_retry_backoff_secs: Float).void }
721
- def initialize(endpoint: "https://api.stately.cloud", access_key: ENV.fetch("STATELY_ACCESS_KEY", nil), base_retry_backoff_secs: 1); end
722
+ sig { params(access_key: String, base_retry_backoff_secs: Float).void }
723
+ def initialize(access_key: ENV.fetch("STATELY_ACCESS_KEY", nil), base_retry_backoff_secs: 1); end
724
+
725
+ # Start the token provider. Starting multiple times is a no-op.
726
+ sig { params(endpoint: String).void }
727
+ def start(endpoint: "https://api.stately.cloud"); end
722
728
 
723
729
  # Close the token provider and kill any background operations
724
730
  # This just invokes the close method on the actor which should do the cleanup
@@ -742,10 +748,10 @@ module StatelyDB
742
748
  sig { params(endpoint: String, access_key: String, base_retry_backoff_secs: Float).void }
743
749
  def initialize(endpoint:, access_key:, base_retry_backoff_secs:); end
744
750
 
745
- # Initialize the actor. This runs on the actor thread which means
751
+ # Start the actor. This runs on the actor thread which means
746
752
  # we can dispatch async operations here.
747
753
  sig { void }
748
- def init; end
754
+ def start; end
749
755
 
750
756
  # Close the token provider and kill any background operations
751
757
  sig { void }
@@ -1000,32 +1006,27 @@ module StatelyDB
1000
1006
  sig { params(key_paths: T.any(String, T::Array[String])).void }
1001
1007
  def delete(*key_paths); end
1002
1008
 
1003
- # Begin listing Items from a StatelyDB Store at the given prefix.
1004
- #
1005
1009
  # Example:
1006
1010
  # client.data.transaction do |txn|
1007
1011
  # (items, token) = txn.begin_list("/ItemType-identifier")
1008
1012
  # (items, token) = txn.continue_list(token)
1009
1013
  # end
1010
1014
  #
1011
- # _@param_ `prefix` — the prefix to list
1012
- #
1013
- # _@param_ `limit` — the maximum number of items to return
1014
- #
1015
- # _@param_ `sort_property` — the property to sort by
1016
- #
1017
- # _@param_ `sort_direction` — the direction to sort by (:ascending or :descending)
1018
- #
1019
1015
  # _@return_ — the list of Items and the token
1020
1016
  sig do
1021
1017
  params(
1022
- prefix: String,
1023
- limit: Integer,
1024
- sort_property: T.nilable(String),
1025
- sort_direction: Symbol
1018
+ prefix: T.untyped,
1019
+ limit: T.untyped,
1020
+ sort_property: T.untyped,
1021
+ sort_direction: T.untyped,
1022
+ item_types: T.untyped,
1023
+ gt: T.untyped,
1024
+ gte: T.untyped,
1025
+ lt: T.untyped,
1026
+ lte: T.untyped
1026
1027
  ).returns([T::Array[StatelyDB::Item], ::Stately::Db::ListToken])
1027
1028
  end
1028
- def begin_list(prefix, limit: 100, sort_property: nil, sort_direction: :ascending); end
1029
+ def begin_list(prefix, limit: 100, sort_property: nil, sort_direction: :ascending, item_types: [], gt: nil, gte: nil, lt: nil, lte: nil); end
1029
1030
 
1030
1031
  # Continue listing Items from a StatelyDB Store using a token.
1031
1032
  #
data/sig/statelydb.rbs CHANGED
@@ -1,5 +1,7 @@
1
1
  # A module for Stately Cloud auth code
2
2
  module StatelyDB
3
+ VERSION: untyped
4
+
3
5
  # UUID is a helper class for working with UUIDs in StatelyDB. The ruby version of a StatelyDB is a binary string,
4
6
  # and this class provides convenience methods for converting to the base16 representation specified in RFC 9562.
5
7
  # Internally this class uses the byte_string attribute to store the UUID as a string with the Encoding::ASCII_8BIT
@@ -149,7 +151,8 @@ module StatelyDB
149
151
  # ```
150
152
  def self.with: (String namespace, ?(String | StatelyDB::UUID | _ToS)? identifier) -> StatelyDB::KeyPath
151
153
 
152
- # If the value is a binary string, encode it as a url-safe base64 string with padding removed.
154
+ # If the value is a binary string, encode it as a url-safe
155
+ # base64 string with padding removed.
153
156
  #
154
157
  # _@param_ `value` — The value to convert to a key id.
155
158
  def self.to_key_id: ((String | StatelyDB::UUID | _ToS) value) -> String
@@ -218,26 +221,21 @@ module StatelyDB
218
221
  # ```
219
222
  def get_batch: (*(String | ::Array[String]) key_paths) -> (::Array[StatelyDB::Item] | NilClass)
220
223
 
221
- # Begin listing Items from a StatelyDB Store at the given prefix.
222
- #
223
- # _@param_ `prefix` — the prefix to list
224
- #
225
- # _@param_ `limit` — the maximum number of items to return
226
- #
227
- # _@param_ `sort_property` — the property to sort by
228
- #
229
- # _@param_ `sort_direction` — the direction to sort by (:ascending or :descending)
230
- #
231
224
  # _@return_ — the list of Items and the token
232
225
  #
233
226
  # ```ruby
234
227
  # client.data.begin_list("/ItemType-identifier", limit: 10, sort_direction: :ascending)
235
228
  # ```
236
229
  def begin_list: (
237
- String prefix,
238
- ?limit: Integer,
239
- ?sort_property: String?,
240
- ?sort_direction: Symbol
230
+ untyped prefix,
231
+ ?limit: untyped,
232
+ ?sort_property: untyped,
233
+ ?sort_direction: untyped,
234
+ ?item_types: untyped,
235
+ ?gt: untyped,
236
+ ?gte: untyped,
237
+ ?lt: untyped,
238
+ ?lte: untyped
241
239
  ) -> (::Array[StatelyDB::Item] | StatelyDB::Token)
242
240
 
243
241
  # Continue listing Items from a StatelyDB Store using a token.
@@ -463,8 +461,10 @@ module StatelyDB
463
461
  module Auth
464
462
  # GRPC interceptor to authenticate against Stately and append bearer tokens to outgoing requests
465
463
  class Interceptor < GRPC::ClientInterceptor
466
- # _@param_ `token_provider` The token provider to use for authentication
467
- def initialize: (?token_provider: StatelyDB::Common::Auth::TokenProvider) -> void
464
+ # This must have been started already.
465
+ #
466
+ # _@param_ `token_provider` — The token provider to use for authentication.
467
+ def initialize: (token_provider: StatelyDB::Common::Auth::TokenProvider) -> void
468
468
 
469
469
  # gRPC client unary interceptor
470
470
  #
@@ -608,6 +608,11 @@ module StatelyDB
608
608
  # TokenProvider is an abstract base class that should be extended
609
609
  # for individual token provider implementations
610
610
  class TokenProvider
611
+ # Start the token provider. Starting multiple times should be a no-op.
612
+ #
613
+ # _@param_ `endpoint` — The endpoint to connect to
614
+ def start: (?endpoint: String) -> void
615
+
611
616
  # Get the current access token
612
617
  #
613
618
  # _@param_ `force` — Whether to force a refresh of the token
@@ -624,12 +629,13 @@ module StatelyDB
624
629
  # It will default to using the value of `STATELY_ACCESS_KEY` if
625
630
  # no credentials are explicitly passed and will throw an error if no credentials are found.
626
631
  class AuthTokenProvider < StatelyDB::Common::Auth::TokenProvider
627
- # _@param_ `endpoint` — The endpoint of the auth server
628
- #
629
632
  # _@param_ `access_key` — The StatelyDB access key credential
630
633
  #
631
634
  # _@param_ `base_retry_backoff_secs` — The base retry backoff in seconds
632
- def initialize: (?endpoint: String, ?access_key: String, ?base_retry_backoff_secs: Float) -> void
635
+ def initialize: (?access_key: String, ?base_retry_backoff_secs: Float) -> void
636
+
637
+ # Start the token provider. Starting multiple times is a no-op.
638
+ def start: (?endpoint: String) -> void
633
639
 
634
640
  # Close the token provider and kill any background operations
635
641
  # This just invokes the close method on the actor which should do the cleanup
@@ -650,9 +656,9 @@ module StatelyDB
650
656
  # _@param_ `base_retry_backoff_secs` — The base retry backoff in seconds
651
657
  def initialize: (endpoint: String, access_key: String, base_retry_backoff_secs: Float) -> void
652
658
 
653
- # Initialize the actor. This runs on the actor thread which means
659
+ # Start the actor. This runs on the actor thread which means
654
660
  # we can dispatch async operations here.
655
- def init: () -> void
661
+ def start: () -> void
656
662
 
657
663
  # Close the token provider and kill any background operations
658
664
  def close: () -> void
@@ -881,28 +887,23 @@ module StatelyDB
881
887
  # _@return_ — nil
882
888
  def delete: (*(String | ::Array[String]) key_paths) -> void
883
889
 
884
- # Begin listing Items from a StatelyDB Store at the given prefix.
885
- #
886
890
  # Example:
887
891
  # client.data.transaction do |txn|
888
892
  # (items, token) = txn.begin_list("/ItemType-identifier")
889
893
  # (items, token) = txn.continue_list(token)
890
894
  # end
891
895
  #
892
- # _@param_ `prefix` — the prefix to list
893
- #
894
- # _@param_ `limit` — the maximum number of items to return
895
- #
896
- # _@param_ `sort_property` — the property to sort by
897
- #
898
- # _@param_ `sort_direction` — the direction to sort by (:ascending or :descending)
899
- #
900
896
  # _@return_ — the list of Items and the token
901
897
  def begin_list: (
902
- String prefix,
903
- ?limit: Integer,
904
- ?sort_property: String?,
905
- ?sort_direction: Symbol
898
+ untyped prefix,
899
+ ?limit: untyped,
900
+ ?sort_property: untyped,
901
+ ?sort_direction: untyped,
902
+ ?item_types: untyped,
903
+ ?gt: untyped,
904
+ ?gte: untyped,
905
+ ?lt: untyped,
906
+ ?lte: untyped
906
907
  ) -> [::Array[StatelyDB::Item], ::Stately::Db::ListToken]
907
908
 
908
909
  # Continue listing Items from a StatelyDB Store using a token.
@@ -978,8 +979,9 @@ module Stately
978
979
  ListResponse: untyped
979
980
  ListPartialResult: untyped
980
981
  ListFinished: untyped
982
+ KeyCondition: untyped
981
983
  SortDirection: untyped
982
- FilterCondition: untyped
984
+ Operator: untyped
983
985
  BeginScanRequest: untyped
984
986
  SegmentationParams: untyped
985
987
  DeleteRequest: untyped
@@ -1005,6 +1007,7 @@ module Stately
1005
1007
  TransactionPutAck: untyped
1006
1008
  TransactionListResponse: untyped
1007
1009
  TransactionFinished: untyped
1010
+ FilterCondition: untyped
1008
1011
  ContinueListRequest: untyped
1009
1012
  ContinueListDirection: untyped
1010
1013
  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.25.1
4
+ version: 0.29.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-05-02 00:00:00.000000000 Z
11
+ date: 2025-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async
@@ -66,7 +66,9 @@ dependencies:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.64.3
69
- description: ''
69
+ description: Client for StatelyDB, a document database built on top of DynamoDB with
70
+ Elastic Schema that allows you to change your data model any time with automatic
71
+ backwards compatibility.
70
72
  email: support@stately.cloud
71
73
  executables: []
72
74
  extensions: []
@@ -83,6 +85,7 @@ files:
83
85
  - lib/api/db/get_pb.rb
84
86
  - lib/api/db/item_pb.rb
85
87
  - lib/api/db/item_property_pb.rb
88
+ - lib/api/db/list_filters_pb.rb
86
89
  - lib/api/db/list_pb.rb
87
90
  - lib/api/db/list_token_pb.rb
88
91
  - lib/api/db/put_pb.rb
@@ -106,6 +109,7 @@ files:
106
109
  - lib/transaction/queue.rb
107
110
  - lib/transaction/transaction.rb
108
111
  - lib/uuid.rb
112
+ - lib/version.rb
109
113
  - rbi/auth/get_auth_token_pb.rbi
110
114
  - rbi/auth/service_pb.rbi
111
115
  - rbi/auth/service_services_pb.rbi
@@ -115,6 +119,7 @@ files:
115
119
  - rbi/db/get_pb.rbi
116
120
  - rbi/db/item_pb.rbi
117
121
  - rbi/db/item_property_pb.rbi
122
+ - rbi/db/list_filters_pb.rbi
118
123
  - rbi/db/list_pb.rbi
119
124
  - rbi/db/list_token_pb.rbi
120
125
  - rbi/db/put_pb.rbi
@@ -140,14 +145,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
145
  requirements:
141
146
  - - ">="
142
147
  - !ruby/object:Gem::Version
143
- version: 3.3.0
148
+ version: 3.2.0
144
149
  required_rubygems_version: !ruby/object:Gem::Requirement
145
150
  requirements:
146
151
  - - ">="
147
152
  - !ruby/object:Gem::Version
148
153
  version: '0'
149
154
  requirements: []
150
- rubygems_version: 3.5.11
155
+ rubygems_version: 3.4.19
151
156
  signing_key:
152
157
  specification_version: 4
153
158
  summary: A library for interacting with StatelyDB