statelydb 0.22.0 → 0.23.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/lib/common/auth/interceptor.rb +1 -1
- data/lib/common/auth/token_fetcher.rb +2 -2
- data/lib/key_path.rb +2 -2
- data/lib/statelydb.rb +2 -2
- data/lib/transaction/transaction.rb +4 -4
- data/rbi/auth/get_auth_token_pb.rbi +169 -0
- data/rbi/auth/service_pb.rbi +3 -0
- data/rbi/auth/service_services_pb.rbi +31 -0
- data/rbi/db/continue_list_pb.rbi +163 -0
- data/rbi/db/continue_scan_pb.rbi +123 -0
- data/rbi/db/delete_pb.rbi +329 -0
- data/rbi/db/get_pb.rbi +293 -0
- data/rbi/db/item_pb.rbi +125 -0
- data/rbi/db/item_property_pb.rbi +24 -0
- data/rbi/db/list_pb.rbi +472 -0
- data/rbi/db/list_token_pb.rbi +154 -0
- data/rbi/db/put_pb.rbi +314 -0
- data/rbi/db/scan_pb.rbi +370 -0
- data/rbi/db/scan_root_paths_pb.rbi +301 -0
- data/rbi/db/service_pb.rbi +3 -0
- data/rbi/db/service_services_pb.rbi +184 -0
- data/rbi/db/sync_list_pb.rbi +452 -0
- data/rbi/db/transaction_pb.rbi +1366 -0
- data/rbi/errors/error_details_pb.rbi +146 -0
- data/rbi/statelydb.rbi +12 -83
- data/sig/statelydb.rbs +8 -8
- metadata +20 -1
@@ -0,0 +1,154 @@
|
|
1
|
+
# Code generated by protoc-gen-rbi. DO NOT EDIT.
|
2
|
+
# source: db/list_token.proto
|
3
|
+
# typed: strict
|
4
|
+
|
5
|
+
# ListToken is an opaque token that can be used to continue (paginate) or sync
|
6
|
+
# results from a previous List operation.
|
7
|
+
class Stately::Db::ListToken
|
8
|
+
include ::Google::Protobuf::MessageExts
|
9
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
10
|
+
|
11
|
+
sig do
|
12
|
+
params(
|
13
|
+
token_data: T.nilable(String),
|
14
|
+
can_continue: T.nilable(T::Boolean),
|
15
|
+
can_sync: T.nilable(T::Boolean),
|
16
|
+
schema_version_id: T.nilable(Integer)
|
17
|
+
).void
|
18
|
+
end
|
19
|
+
def initialize(
|
20
|
+
token_data: "",
|
21
|
+
can_continue: false,
|
22
|
+
can_sync: false,
|
23
|
+
schema_version_id: 0
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
# token_data will always be returned, and can be used to expand the result
|
28
|
+
# set via ContinueList (if can_continue is true), or to get changed items
|
29
|
+
# within the result set via SyncList (if can_sync is true). The token_data
|
30
|
+
# itself is opaque and cannot be parsed or modified by clients.
|
31
|
+
sig { returns(String) }
|
32
|
+
def token_data
|
33
|
+
end
|
34
|
+
|
35
|
+
# token_data will always be returned, and can be used to expand the result
|
36
|
+
# set via ContinueList (if can_continue is true), or to get changed items
|
37
|
+
# within the result set via SyncList (if can_sync is true). The token_data
|
38
|
+
# itself is opaque and cannot be parsed or modified by clients.
|
39
|
+
sig { params(value: String).void }
|
40
|
+
def token_data=(value)
|
41
|
+
end
|
42
|
+
|
43
|
+
# token_data will always be returned, and can be used to expand the result
|
44
|
+
# set via ContinueList (if can_continue is true), or to get changed items
|
45
|
+
# within the result set via SyncList (if can_sync is true). The token_data
|
46
|
+
# itself is opaque and cannot be parsed or modified by clients.
|
47
|
+
sig { void }
|
48
|
+
def clear_token_data
|
49
|
+
end
|
50
|
+
|
51
|
+
# can_continue indicates that there are more results available by expanding
|
52
|
+
# the pagination window by calling ContinueList with this token.
|
53
|
+
sig { returns(T::Boolean) }
|
54
|
+
def can_continue
|
55
|
+
end
|
56
|
+
|
57
|
+
# can_continue indicates that there are more results available by expanding
|
58
|
+
# the pagination window by calling ContinueList with this token.
|
59
|
+
sig { params(value: T::Boolean).void }
|
60
|
+
def can_continue=(value)
|
61
|
+
end
|
62
|
+
|
63
|
+
# can_continue indicates that there are more results available by expanding
|
64
|
+
# the pagination window by calling ContinueList with this token.
|
65
|
+
sig { void }
|
66
|
+
def clear_can_continue
|
67
|
+
end
|
68
|
+
|
69
|
+
# can_sync indicates that you could call SyncList with this token later to
|
70
|
+
# get updated items. This is determined by the type of store you're listing
|
71
|
+
# from.
|
72
|
+
sig { returns(T::Boolean) }
|
73
|
+
def can_sync
|
74
|
+
end
|
75
|
+
|
76
|
+
# can_sync indicates that you could call SyncList with this token later to
|
77
|
+
# get updated items. This is determined by the type of store you're listing
|
78
|
+
# from.
|
79
|
+
sig { params(value: T::Boolean).void }
|
80
|
+
def can_sync=(value)
|
81
|
+
end
|
82
|
+
|
83
|
+
# can_sync indicates that you could call SyncList with this token later to
|
84
|
+
# get updated items. This is determined by the type of store you're listing
|
85
|
+
# from.
|
86
|
+
sig { void }
|
87
|
+
def clear_can_sync
|
88
|
+
end
|
89
|
+
|
90
|
+
# schema_version_id represents the version of the schema that was used to
|
91
|
+
# generate token_data. For ContinueList calls, you must ensure the client's
|
92
|
+
# schema version and this field are the same. A mismatch between the two
|
93
|
+
# will result in a SchemaVersionMismatch error. For SyncList calls, you
|
94
|
+
# only need to ensure you handle Reset events correctly by clearing your
|
95
|
+
# local state and consuming a new list of items as Stately will handle
|
96
|
+
# re-send items in the correct version along with a new token at the end.
|
97
|
+
sig { returns(Integer) }
|
98
|
+
def schema_version_id
|
99
|
+
end
|
100
|
+
|
101
|
+
# schema_version_id represents the version of the schema that was used to
|
102
|
+
# generate token_data. For ContinueList calls, you must ensure the client's
|
103
|
+
# schema version and this field are the same. A mismatch between the two
|
104
|
+
# will result in a SchemaVersionMismatch error. For SyncList calls, you
|
105
|
+
# only need to ensure you handle Reset events correctly by clearing your
|
106
|
+
# local state and consuming a new list of items as Stately will handle
|
107
|
+
# re-send items in the correct version along with a new token at the end.
|
108
|
+
sig { params(value: Integer).void }
|
109
|
+
def schema_version_id=(value)
|
110
|
+
end
|
111
|
+
|
112
|
+
# schema_version_id represents the version of the schema that was used to
|
113
|
+
# generate token_data. For ContinueList calls, you must ensure the client's
|
114
|
+
# schema version and this field are the same. A mismatch between the two
|
115
|
+
# will result in a SchemaVersionMismatch error. For SyncList calls, you
|
116
|
+
# only need to ensure you handle Reset events correctly by clearing your
|
117
|
+
# local state and consuming a new list of items as Stately will handle
|
118
|
+
# re-send items in the correct version along with a new token at the end.
|
119
|
+
sig { void }
|
120
|
+
def clear_schema_version_id
|
121
|
+
end
|
122
|
+
|
123
|
+
sig { params(field: String).returns(T.untyped) }
|
124
|
+
def [](field)
|
125
|
+
end
|
126
|
+
|
127
|
+
sig { params(field: String, value: T.untyped).void }
|
128
|
+
def []=(field, value)
|
129
|
+
end
|
130
|
+
|
131
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
132
|
+
def to_h
|
133
|
+
end
|
134
|
+
|
135
|
+
sig { params(str: String).returns(Stately::Db::ListToken) }
|
136
|
+
def self.decode(str)
|
137
|
+
end
|
138
|
+
|
139
|
+
sig { params(msg: Stately::Db::ListToken).returns(String) }
|
140
|
+
def self.encode(msg)
|
141
|
+
end
|
142
|
+
|
143
|
+
sig { params(str: String, kw: T.untyped).returns(Stately::Db::ListToken) }
|
144
|
+
def self.decode_json(str, **kw)
|
145
|
+
end
|
146
|
+
|
147
|
+
sig { params(msg: Stately::Db::ListToken, kw: T.untyped).returns(String) }
|
148
|
+
def self.encode_json(msg, **kw)
|
149
|
+
end
|
150
|
+
|
151
|
+
sig { returns(::Google::Protobuf::Descriptor) }
|
152
|
+
def self.descriptor
|
153
|
+
end
|
154
|
+
end
|
data/rbi/db/put_pb.rbi
ADDED
@@ -0,0 +1,314 @@
|
|
1
|
+
# Code generated by protoc-gen-rbi. DO NOT EDIT.
|
2
|
+
# source: db/put.proto
|
3
|
+
# typed: strict
|
4
|
+
|
5
|
+
class Stately::Db::PutRequest
|
6
|
+
include ::Google::Protobuf::MessageExts
|
7
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
8
|
+
|
9
|
+
sig do
|
10
|
+
params(
|
11
|
+
store_id: T.nilable(Integer),
|
12
|
+
puts: T.nilable(T::Array[T.nilable(Stately::Db::PutItem)]),
|
13
|
+
schema_version_id: T.nilable(Integer)
|
14
|
+
).void
|
15
|
+
end
|
16
|
+
def initialize(
|
17
|
+
store_id: 0,
|
18
|
+
puts: [],
|
19
|
+
schema_version_id: 0
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
# store_id is a globally unique Store ID, which can be looked up from the
|
24
|
+
# console or CLI.
|
25
|
+
sig { returns(Integer) }
|
26
|
+
def store_id
|
27
|
+
end
|
28
|
+
|
29
|
+
# store_id is a globally unique Store ID, which can be looked up from the
|
30
|
+
# console or CLI.
|
31
|
+
sig { params(value: Integer).void }
|
32
|
+
def store_id=(value)
|
33
|
+
end
|
34
|
+
|
35
|
+
# store_id is a globally unique Store ID, which can be looked up from the
|
36
|
+
# console or CLI.
|
37
|
+
sig { void }
|
38
|
+
def clear_store_id
|
39
|
+
end
|
40
|
+
|
41
|
+
# puts is up to 50 items to be put into the Store.
|
42
|
+
sig { returns(T::Array[T.nilable(Stately::Db::PutItem)]) }
|
43
|
+
def puts
|
44
|
+
end
|
45
|
+
|
46
|
+
# puts is up to 50 items to be put into the Store.
|
47
|
+
sig { params(value: ::Google::Protobuf::RepeatedField).void }
|
48
|
+
def puts=(value)
|
49
|
+
end
|
50
|
+
|
51
|
+
# puts is up to 50 items to be put into the Store.
|
52
|
+
sig { void }
|
53
|
+
def clear_puts
|
54
|
+
end
|
55
|
+
|
56
|
+
# schema_version_id refers to the item version to return.
|
57
|
+
#
|
58
|
+
# If the store's schema does not have this version, the operation will error
|
59
|
+
# with SchemaVersionNotFound error. You should not have to set this manually
|
60
|
+
# as your generated SDK should know its schema version and wire this in for
|
61
|
+
# you.
|
62
|
+
sig { returns(Integer) }
|
63
|
+
def schema_version_id
|
64
|
+
end
|
65
|
+
|
66
|
+
# schema_version_id refers to the item version to return.
|
67
|
+
#
|
68
|
+
# If the store's schema does not have this version, the operation will error
|
69
|
+
# with SchemaVersionNotFound error. You should not have to set this manually
|
70
|
+
# as your generated SDK should know its schema version and wire this in for
|
71
|
+
# you.
|
72
|
+
sig { params(value: Integer).void }
|
73
|
+
def schema_version_id=(value)
|
74
|
+
end
|
75
|
+
|
76
|
+
# schema_version_id refers to the item version to return.
|
77
|
+
#
|
78
|
+
# If the store's schema does not have this version, the operation will error
|
79
|
+
# with SchemaVersionNotFound error. You should not have to set this manually
|
80
|
+
# as your generated SDK should know its schema version and wire this in for
|
81
|
+
# you.
|
82
|
+
sig { void }
|
83
|
+
def clear_schema_version_id
|
84
|
+
end
|
85
|
+
|
86
|
+
sig { params(field: String).returns(T.untyped) }
|
87
|
+
def [](field)
|
88
|
+
end
|
89
|
+
|
90
|
+
sig { params(field: String, value: T.untyped).void }
|
91
|
+
def []=(field, value)
|
92
|
+
end
|
93
|
+
|
94
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
95
|
+
def to_h
|
96
|
+
end
|
97
|
+
|
98
|
+
sig { params(str: String).returns(Stately::Db::PutRequest) }
|
99
|
+
def self.decode(str)
|
100
|
+
end
|
101
|
+
|
102
|
+
sig { params(msg: Stately::Db::PutRequest).returns(String) }
|
103
|
+
def self.encode(msg)
|
104
|
+
end
|
105
|
+
|
106
|
+
sig { params(str: String, kw: T.untyped).returns(Stately::Db::PutRequest) }
|
107
|
+
def self.decode_json(str, **kw)
|
108
|
+
end
|
109
|
+
|
110
|
+
sig { params(msg: Stately::Db::PutRequest, kw: T.untyped).returns(String) }
|
111
|
+
def self.encode_json(msg, **kw)
|
112
|
+
end
|
113
|
+
|
114
|
+
sig { returns(::Google::Protobuf::Descriptor) }
|
115
|
+
def self.descriptor
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
class Stately::Db::PutItem
|
120
|
+
include ::Google::Protobuf::MessageExts
|
121
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
122
|
+
|
123
|
+
sig do
|
124
|
+
params(
|
125
|
+
item: T.nilable(Stately::Db::Item),
|
126
|
+
overwrite_metadata_timestamps: T.nilable(T::Boolean),
|
127
|
+
must_not_exist: T.nilable(T::Boolean)
|
128
|
+
).void
|
129
|
+
end
|
130
|
+
def initialize(
|
131
|
+
item: nil,
|
132
|
+
overwrite_metadata_timestamps: false,
|
133
|
+
must_not_exist: false
|
134
|
+
)
|
135
|
+
end
|
136
|
+
|
137
|
+
# item is the data to be put, including its item_type.
|
138
|
+
sig { returns(T.nilable(Stately::Db::Item)) }
|
139
|
+
def item
|
140
|
+
end
|
141
|
+
|
142
|
+
# item is the data to be put, including its item_type.
|
143
|
+
sig { params(value: T.nilable(Stately::Db::Item)).void }
|
144
|
+
def item=(value)
|
145
|
+
end
|
146
|
+
|
147
|
+
# item is the data to be put, including its item_type.
|
148
|
+
sig { void }
|
149
|
+
def clear_item
|
150
|
+
end
|
151
|
+
|
152
|
+
# overwrite_metadata_timestamps indicates that any "fromMetadata" timestamp
|
153
|
+
# fields in the incoming payload should be saved as provided in the database.
|
154
|
+
# Normally these would be ignored as they are automatically maintained, but
|
155
|
+
# this flag can be useful for migrations from other systems. Note that this
|
156
|
+
# only works for timestamps (createdAtTime and lastModifiedAtTime) - versions
|
157
|
+
# cannot be overridden.
|
158
|
+
sig { returns(T::Boolean) }
|
159
|
+
def overwrite_metadata_timestamps
|
160
|
+
end
|
161
|
+
|
162
|
+
# overwrite_metadata_timestamps indicates that any "fromMetadata" timestamp
|
163
|
+
# fields in the incoming payload should be saved as provided in the database.
|
164
|
+
# Normally these would be ignored as they are automatically maintained, but
|
165
|
+
# this flag can be useful for migrations from other systems. Note that this
|
166
|
+
# only works for timestamps (createdAtTime and lastModifiedAtTime) - versions
|
167
|
+
# cannot be overridden.
|
168
|
+
sig { params(value: T::Boolean).void }
|
169
|
+
def overwrite_metadata_timestamps=(value)
|
170
|
+
end
|
171
|
+
|
172
|
+
# overwrite_metadata_timestamps indicates that any "fromMetadata" timestamp
|
173
|
+
# fields in the incoming payload should be saved as provided in the database.
|
174
|
+
# Normally these would be ignored as they are automatically maintained, but
|
175
|
+
# this flag can be useful for migrations from other systems. Note that this
|
176
|
+
# only works for timestamps (createdAtTime and lastModifiedAtTime) - versions
|
177
|
+
# cannot be overridden.
|
178
|
+
sig { void }
|
179
|
+
def clear_overwrite_metadata_timestamps
|
180
|
+
end
|
181
|
+
|
182
|
+
# must_not_exist is a condition that indicates this item must not already
|
183
|
+
# exist at any of its key paths. If there is already an item at one of those
|
184
|
+
# paths, the Put operation will fail with a ConditionalCheckFailed error.
|
185
|
+
# Note that if the item has an `initialValue` field in its key, that initial
|
186
|
+
# value will automatically be chosen not to conflict with existing items, so
|
187
|
+
# this condition only applies to key paths that do not contain the
|
188
|
+
# `initialValue` field.
|
189
|
+
sig { returns(T::Boolean) }
|
190
|
+
def must_not_exist
|
191
|
+
end
|
192
|
+
|
193
|
+
# must_not_exist is a condition that indicates this item must not already
|
194
|
+
# exist at any of its key paths. If there is already an item at one of those
|
195
|
+
# paths, the Put operation will fail with a ConditionalCheckFailed error.
|
196
|
+
# Note that if the item has an `initialValue` field in its key, that initial
|
197
|
+
# value will automatically be chosen not to conflict with existing items, so
|
198
|
+
# this condition only applies to key paths that do not contain the
|
199
|
+
# `initialValue` field.
|
200
|
+
sig { params(value: T::Boolean).void }
|
201
|
+
def must_not_exist=(value)
|
202
|
+
end
|
203
|
+
|
204
|
+
# must_not_exist is a condition that indicates this item must not already
|
205
|
+
# exist at any of its key paths. If there is already an item at one of those
|
206
|
+
# paths, the Put operation will fail with a ConditionalCheckFailed error.
|
207
|
+
# Note that if the item has an `initialValue` field in its key, that initial
|
208
|
+
# value will automatically be chosen not to conflict with existing items, so
|
209
|
+
# this condition only applies to key paths that do not contain the
|
210
|
+
# `initialValue` field.
|
211
|
+
sig { void }
|
212
|
+
def clear_must_not_exist
|
213
|
+
end
|
214
|
+
|
215
|
+
sig { params(field: String).returns(T.untyped) }
|
216
|
+
def [](field)
|
217
|
+
end
|
218
|
+
|
219
|
+
sig { params(field: String, value: T.untyped).void }
|
220
|
+
def []=(field, value)
|
221
|
+
end
|
222
|
+
|
223
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
224
|
+
def to_h
|
225
|
+
end
|
226
|
+
|
227
|
+
sig { params(str: String).returns(Stately::Db::PutItem) }
|
228
|
+
def self.decode(str)
|
229
|
+
end
|
230
|
+
|
231
|
+
sig { params(msg: Stately::Db::PutItem).returns(String) }
|
232
|
+
def self.encode(msg)
|
233
|
+
end
|
234
|
+
|
235
|
+
sig { params(str: String, kw: T.untyped).returns(Stately::Db::PutItem) }
|
236
|
+
def self.decode_json(str, **kw)
|
237
|
+
end
|
238
|
+
|
239
|
+
sig { params(msg: Stately::Db::PutItem, kw: T.untyped).returns(String) }
|
240
|
+
def self.encode_json(msg, **kw)
|
241
|
+
end
|
242
|
+
|
243
|
+
sig { returns(::Google::Protobuf::Descriptor) }
|
244
|
+
def self.descriptor
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
class Stately::Db::PutResponse
|
249
|
+
include ::Google::Protobuf::MessageExts
|
250
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
251
|
+
|
252
|
+
sig do
|
253
|
+
params(
|
254
|
+
items: T.nilable(T::Array[T.nilable(Stately::Db::Item)])
|
255
|
+
).void
|
256
|
+
end
|
257
|
+
def initialize(
|
258
|
+
items: []
|
259
|
+
)
|
260
|
+
end
|
261
|
+
|
262
|
+
# items is the full result of each put operation. The response items are in
|
263
|
+
# the same order as the request items. Each item is fully "filled out" - for
|
264
|
+
# example, `initialValue` and `fromMetadata` fields are resolved.
|
265
|
+
sig { returns(T::Array[T.nilable(Stately::Db::Item)]) }
|
266
|
+
def items
|
267
|
+
end
|
268
|
+
|
269
|
+
# items is the full result of each put operation. The response items are in
|
270
|
+
# the same order as the request items. Each item is fully "filled out" - for
|
271
|
+
# example, `initialValue` and `fromMetadata` fields are resolved.
|
272
|
+
sig { params(value: ::Google::Protobuf::RepeatedField).void }
|
273
|
+
def items=(value)
|
274
|
+
end
|
275
|
+
|
276
|
+
# items is the full result of each put operation. The response items are in
|
277
|
+
# the same order as the request items. Each item is fully "filled out" - for
|
278
|
+
# example, `initialValue` and `fromMetadata` fields are resolved.
|
279
|
+
sig { void }
|
280
|
+
def clear_items
|
281
|
+
end
|
282
|
+
|
283
|
+
sig { params(field: String).returns(T.untyped) }
|
284
|
+
def [](field)
|
285
|
+
end
|
286
|
+
|
287
|
+
sig { params(field: String, value: T.untyped).void }
|
288
|
+
def []=(field, value)
|
289
|
+
end
|
290
|
+
|
291
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
292
|
+
def to_h
|
293
|
+
end
|
294
|
+
|
295
|
+
sig { params(str: String).returns(Stately::Db::PutResponse) }
|
296
|
+
def self.decode(str)
|
297
|
+
end
|
298
|
+
|
299
|
+
sig { params(msg: Stately::Db::PutResponse).returns(String) }
|
300
|
+
def self.encode(msg)
|
301
|
+
end
|
302
|
+
|
303
|
+
sig { params(str: String, kw: T.untyped).returns(Stately::Db::PutResponse) }
|
304
|
+
def self.decode_json(str, **kw)
|
305
|
+
end
|
306
|
+
|
307
|
+
sig { params(msg: Stately::Db::PutResponse, kw: T.untyped).returns(String) }
|
308
|
+
def self.encode_json(msg, **kw)
|
309
|
+
end
|
310
|
+
|
311
|
+
sig { returns(::Google::Protobuf::Descriptor) }
|
312
|
+
def self.descriptor
|
313
|
+
end
|
314
|
+
end
|