statelydb 0.22.0 → 0.24.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.
@@ -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,340 @@
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
+ schema_id: T.nilable(Integer)
15
+ ).void
16
+ end
17
+ def initialize(
18
+ store_id: 0,
19
+ puts: [],
20
+ schema_version_id: 0,
21
+ schema_id: 0
22
+ )
23
+ end
24
+
25
+ # store_id is a globally unique Store ID, which can be looked up from the
26
+ # console or CLI.
27
+ sig { returns(Integer) }
28
+ def store_id
29
+ end
30
+
31
+ # store_id is a globally unique Store ID, which can be looked up from the
32
+ # console or CLI.
33
+ sig { params(value: Integer).void }
34
+ def store_id=(value)
35
+ end
36
+
37
+ # store_id is a globally unique Store ID, which can be looked up from the
38
+ # console or CLI.
39
+ sig { void }
40
+ def clear_store_id
41
+ end
42
+
43
+ # puts is up to 50 items to be put into the Store.
44
+ sig { returns(T::Array[T.nilable(Stately::Db::PutItem)]) }
45
+ def puts
46
+ end
47
+
48
+ # puts is up to 50 items to be put into the Store.
49
+ sig { params(value: ::Google::Protobuf::RepeatedField).void }
50
+ def puts=(value)
51
+ end
52
+
53
+ # puts is up to 50 items to be put into the Store.
54
+ sig { void }
55
+ def clear_puts
56
+ end
57
+
58
+ # schema_version_id refers to the item version to return.
59
+ #
60
+ # If the store's schema does not have this version, the operation will error
61
+ # with SchemaVersionNotFound error. You should not have to set this manually
62
+ # as your generated SDK should know its schema version and wire this in for
63
+ # you.
64
+ sig { returns(Integer) }
65
+ def schema_version_id
66
+ end
67
+
68
+ # schema_version_id refers to the item version to return.
69
+ #
70
+ # If the store's schema does not have this version, the operation will error
71
+ # with SchemaVersionNotFound error. You should not have to set this manually
72
+ # as your generated SDK should know its schema version and wire this in for
73
+ # you.
74
+ sig { params(value: Integer).void }
75
+ def schema_version_id=(value)
76
+ end
77
+
78
+ # schema_version_id refers to the item version to return.
79
+ #
80
+ # If the store's schema does not have this version, the operation will error
81
+ # with SchemaVersionNotFound error. You should not have to set this manually
82
+ # as your generated SDK should know its schema version and wire this in for
83
+ # you.
84
+ sig { void }
85
+ def clear_schema_version_id
86
+ end
87
+
88
+ # schema_id refers to the schema to use for this operation.
89
+ # If the store_id does not have a schema with this ID, the operation will
90
+ # error with SchemaNotFound error. You should not have to set this manually
91
+ # as your generated SDK should know its schema and wire this in for you.
92
+ sig { returns(Integer) }
93
+ def schema_id
94
+ end
95
+
96
+ # schema_id refers to the schema to use for this operation.
97
+ # If the store_id does not have a schema with this ID, the operation will
98
+ # error with SchemaNotFound error. You should not have to set this manually
99
+ # as your generated SDK should know its schema and wire this in for you.
100
+ sig { params(value: Integer).void }
101
+ def schema_id=(value)
102
+ end
103
+
104
+ # schema_id refers to the schema to use for this operation.
105
+ # If the store_id does not have a schema with this ID, the operation will
106
+ # error with SchemaNotFound error. You should not have to set this manually
107
+ # as your generated SDK should know its schema and wire this in for you.
108
+ sig { void }
109
+ def clear_schema_id
110
+ end
111
+
112
+ sig { params(field: String).returns(T.untyped) }
113
+ def [](field)
114
+ end
115
+
116
+ sig { params(field: String, value: T.untyped).void }
117
+ def []=(field, value)
118
+ end
119
+
120
+ sig { returns(T::Hash[Symbol, T.untyped]) }
121
+ def to_h
122
+ end
123
+
124
+ sig { params(str: String).returns(Stately::Db::PutRequest) }
125
+ def self.decode(str)
126
+ end
127
+
128
+ sig { params(msg: Stately::Db::PutRequest).returns(String) }
129
+ def self.encode(msg)
130
+ end
131
+
132
+ sig { params(str: String, kw: T.untyped).returns(Stately::Db::PutRequest) }
133
+ def self.decode_json(str, **kw)
134
+ end
135
+
136
+ sig { params(msg: Stately::Db::PutRequest, kw: T.untyped).returns(String) }
137
+ def self.encode_json(msg, **kw)
138
+ end
139
+
140
+ sig { returns(::Google::Protobuf::Descriptor) }
141
+ def self.descriptor
142
+ end
143
+ end
144
+
145
+ class Stately::Db::PutItem
146
+ include ::Google::Protobuf::MessageExts
147
+ extend ::Google::Protobuf::MessageExts::ClassMethods
148
+
149
+ sig do
150
+ params(
151
+ item: T.nilable(Stately::Db::Item),
152
+ overwrite_metadata_timestamps: T.nilable(T::Boolean),
153
+ must_not_exist: T.nilable(T::Boolean)
154
+ ).void
155
+ end
156
+ def initialize(
157
+ item: nil,
158
+ overwrite_metadata_timestamps: false,
159
+ must_not_exist: false
160
+ )
161
+ end
162
+
163
+ # item is the data to be put, including its item_type.
164
+ sig { returns(T.nilable(Stately::Db::Item)) }
165
+ def item
166
+ end
167
+
168
+ # item is the data to be put, including its item_type.
169
+ sig { params(value: T.nilable(Stately::Db::Item)).void }
170
+ def item=(value)
171
+ end
172
+
173
+ # item is the data to be put, including its item_type.
174
+ sig { void }
175
+ def clear_item
176
+ end
177
+
178
+ # overwrite_metadata_timestamps indicates that any "fromMetadata" timestamp
179
+ # fields in the incoming payload should be saved as provided in the database.
180
+ # Normally these would be ignored as they are automatically maintained, but
181
+ # this flag can be useful for migrations from other systems. Note that this
182
+ # only works for timestamps (createdAtTime and lastModifiedAtTime) - versions
183
+ # cannot be overridden.
184
+ sig { returns(T::Boolean) }
185
+ def overwrite_metadata_timestamps
186
+ end
187
+
188
+ # overwrite_metadata_timestamps indicates that any "fromMetadata" timestamp
189
+ # fields in the incoming payload should be saved as provided in the database.
190
+ # Normally these would be ignored as they are automatically maintained, but
191
+ # this flag can be useful for migrations from other systems. Note that this
192
+ # only works for timestamps (createdAtTime and lastModifiedAtTime) - versions
193
+ # cannot be overridden.
194
+ sig { params(value: T::Boolean).void }
195
+ def overwrite_metadata_timestamps=(value)
196
+ end
197
+
198
+ # overwrite_metadata_timestamps indicates that any "fromMetadata" timestamp
199
+ # fields in the incoming payload should be saved as provided in the database.
200
+ # Normally these would be ignored as they are automatically maintained, but
201
+ # this flag can be useful for migrations from other systems. Note that this
202
+ # only works for timestamps (createdAtTime and lastModifiedAtTime) - versions
203
+ # cannot be overridden.
204
+ sig { void }
205
+ def clear_overwrite_metadata_timestamps
206
+ end
207
+
208
+ # must_not_exist is a condition that indicates this item must not already
209
+ # exist at any of its key paths. If there is already an item at one of those
210
+ # paths, the Put operation will fail with a ConditionalCheckFailed error.
211
+ # Note that if the item has an `initialValue` field in its key, that initial
212
+ # value will automatically be chosen not to conflict with existing items, so
213
+ # this condition only applies to key paths that do not contain the
214
+ # `initialValue` field.
215
+ sig { returns(T::Boolean) }
216
+ def must_not_exist
217
+ end
218
+
219
+ # must_not_exist is a condition that indicates this item must not already
220
+ # exist at any of its key paths. If there is already an item at one of those
221
+ # paths, the Put operation will fail with a ConditionalCheckFailed error.
222
+ # Note that if the item has an `initialValue` field in its key, that initial
223
+ # value will automatically be chosen not to conflict with existing items, so
224
+ # this condition only applies to key paths that do not contain the
225
+ # `initialValue` field.
226
+ sig { params(value: T::Boolean).void }
227
+ def must_not_exist=(value)
228
+ end
229
+
230
+ # must_not_exist is a condition that indicates this item must not already
231
+ # exist at any of its key paths. If there is already an item at one of those
232
+ # paths, the Put operation will fail with a ConditionalCheckFailed error.
233
+ # Note that if the item has an `initialValue` field in its key, that initial
234
+ # value will automatically be chosen not to conflict with existing items, so
235
+ # this condition only applies to key paths that do not contain the
236
+ # `initialValue` field.
237
+ sig { void }
238
+ def clear_must_not_exist
239
+ end
240
+
241
+ sig { params(field: String).returns(T.untyped) }
242
+ def [](field)
243
+ end
244
+
245
+ sig { params(field: String, value: T.untyped).void }
246
+ def []=(field, value)
247
+ end
248
+
249
+ sig { returns(T::Hash[Symbol, T.untyped]) }
250
+ def to_h
251
+ end
252
+
253
+ sig { params(str: String).returns(Stately::Db::PutItem) }
254
+ def self.decode(str)
255
+ end
256
+
257
+ sig { params(msg: Stately::Db::PutItem).returns(String) }
258
+ def self.encode(msg)
259
+ end
260
+
261
+ sig { params(str: String, kw: T.untyped).returns(Stately::Db::PutItem) }
262
+ def self.decode_json(str, **kw)
263
+ end
264
+
265
+ sig { params(msg: Stately::Db::PutItem, kw: T.untyped).returns(String) }
266
+ def self.encode_json(msg, **kw)
267
+ end
268
+
269
+ sig { returns(::Google::Protobuf::Descriptor) }
270
+ def self.descriptor
271
+ end
272
+ end
273
+
274
+ class Stately::Db::PutResponse
275
+ include ::Google::Protobuf::MessageExts
276
+ extend ::Google::Protobuf::MessageExts::ClassMethods
277
+
278
+ sig do
279
+ params(
280
+ items: T.nilable(T::Array[T.nilable(Stately::Db::Item)])
281
+ ).void
282
+ end
283
+ def initialize(
284
+ items: []
285
+ )
286
+ end
287
+
288
+ # items is the full result of each put operation. The response items are in
289
+ # the same order as the request items. Each item is fully "filled out" - for
290
+ # example, `initialValue` and `fromMetadata` fields are resolved.
291
+ sig { returns(T::Array[T.nilable(Stately::Db::Item)]) }
292
+ def items
293
+ end
294
+
295
+ # items is the full result of each put operation. The response items are in
296
+ # the same order as the request items. Each item is fully "filled out" - for
297
+ # example, `initialValue` and `fromMetadata` fields are resolved.
298
+ sig { params(value: ::Google::Protobuf::RepeatedField).void }
299
+ def items=(value)
300
+ end
301
+
302
+ # items is the full result of each put operation. The response items are in
303
+ # the same order as the request items. Each item is fully "filled out" - for
304
+ # example, `initialValue` and `fromMetadata` fields are resolved.
305
+ sig { void }
306
+ def clear_items
307
+ end
308
+
309
+ sig { params(field: String).returns(T.untyped) }
310
+ def [](field)
311
+ end
312
+
313
+ sig { params(field: String, value: T.untyped).void }
314
+ def []=(field, value)
315
+ end
316
+
317
+ sig { returns(T::Hash[Symbol, T.untyped]) }
318
+ def to_h
319
+ end
320
+
321
+ sig { params(str: String).returns(Stately::Db::PutResponse) }
322
+ def self.decode(str)
323
+ end
324
+
325
+ sig { params(msg: Stately::Db::PutResponse).returns(String) }
326
+ def self.encode(msg)
327
+ end
328
+
329
+ sig { params(str: String, kw: T.untyped).returns(Stately::Db::PutResponse) }
330
+ def self.decode_json(str, **kw)
331
+ end
332
+
333
+ sig { params(msg: Stately::Db::PutResponse, kw: T.untyped).returns(String) }
334
+ def self.encode_json(msg, **kw)
335
+ end
336
+
337
+ sig { returns(::Google::Protobuf::Descriptor) }
338
+ def self.descriptor
339
+ end
340
+ end